cancel
Showing results for 
Search instead for 
Did you mean: 

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

RomanMH
Associate II

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

11 REPLIES 11
T J
Lead

ask the supplier...

Cyril FENARD
ST Employee

​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