cancel
Showing results for 
Search instead for 
Did you mean: 

Why does UART not work in my project?

Posted on April 12, 2017 at 13:41

Hi.

I have an stm32nucleo board with the stm32F051 chip.

In CubeMX v.4.20.1 I have created a project based on stm32F030 (F051 is not available) where USART2 and Green LED gpio are activated.

In main() I loop - toggle the LED and transmit a UART message.

I'm running Keil MDK and my project compiles successfully.

When I load the project onto the nucleo the LED starts blinking but there is no activity on the TX pin (PA2).

Does anyone have an idea of what might be wrong? (My project is attached.)

Could it be because my cubeMX project is based on a slightly different ship? In the STM32F0x Reference manual (RM0091) it seems that the F03x and F05x are very similar.

Thanks,

-Esben

#usart #cubemx #stm32f051 #nucleo
4 REPLIES 4
Posted on April 12, 2017 at 14:29

Okay. In my troubleshooting process I discovered, that the UART message is being sent from the CN3 connector RX pin. I find this confusing. I thought the top part of the board where CN3 is located was only there to program the chip on the bottom part of the board. And why is the message being transmitted on the RX pin?

Posted on April 12, 2017 at 15:37

USART2 of your MCU is the one defaulty connected to the Virtual Com Port of the ST-LINK

USART2 TX is then connected to the CN3 RX ( from ST-LINK point of view ) to be rooted to host via USB. 

How did you try to monitor activity on PA2, from Morpho/Arduino connector ? 

If I remember well, due to connection to ST-LINK VCP by default the signal is not rooted to connectors ( require a SB ) 

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Posted on April 12, 2017 at 15:39

In addition then your data transmit to USART should be visible using a Terminal properly set ( word width, baudrate etc. ) on the Virtual Com Port of your PC. 

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Posted on April 12, 2017 at 15:45

Oh okay that explains it. SB63, that connects the PA2 to the Morpho/Arduino connector, was left open.

Thanks for the tip.