Skip to main content
RomanMH
Associate
September 6, 2018
Question

STM32-MAT-TARGET: Simultaneous reception on two different UARTs

  • September 6, 2018
  • 11 replies
  • 2702 views

Hello!

I'm experiencing difficulties using STM32-MAT-TARGET to generate code for STM32 controllers from Simulink models using the provided blocks for USART communication.

I'm using this setup:

  • Nucleo-F401RE
  • USART1 and USART6 with interrupt enabled
  • EXTI1 and EXTI13 for use with software interrupt

The following pictures show my Simulink model:

0690X000006BzNRQA0.png0690X000006BzNWQA0.png0690X000006BzNbQAK.png

Unfortunately, the program only does half the job. I observe that only one USART is actually receiving anything. The other just doesn't respond when I send it a byte. Either USART works if I have just one of them in my model. But with both USARTS in my model, one will work, the other won't. It seems to be whichever USART happens to get put into receptin mode first, will be the one that's working.

Can anyone help me with a solution to this problem? Is my setup correct? Does STM32-MAT-TARGET support this kind of operation?

Best regards

Roman

This topic has been closed for replies.

11 replies

Cyril FENARD
ST Employee
December 2, 2019

​Hi  @Roman Müller-Hainbach​ ,

Please keep in mind that the STM32-MAT/TARGET tool facilitates the development of the Simulink application and integrates it (sources of the model + customization of main()) into the final STM32CubeMX project.

You will notice that the initialization configured by STM32CubeMX is an integral part of the final project.

It is therefore normal for interrupts to be enabled if they are configured in this way in the STM32CubeMX project.

Hoping it highlights some details with the Simulink/STM32CubeMX collaboration to bring your applications.

Regards.

Cyril