cancel
Showing results for 
Search instead for 
Did you mean: 

UART communication not working

Pincate
Visitor

Hi there, I have been trying to send a receive messages via serial with the transmit and receive commands on a H7A3ZI Nucleo board, however when I build the code and run it with the debugger I cannot see the messages in the console or command shell console. I have used a 115200 Baud rate, and connected to COM 3 with 8 bits and 1 stop bit. This has also been set up in my device manager.

When trying to connect the command shell console it is intermittent when connecting, and normally needs to be physically disconnected to reconnect.

I am using suart2 with PA2 as the TX, and PA3 as the RX.

SB16 and SB17 are soldered, and SB12 and SB64 aren't soldered.

please let me know what else I could try, here is a example of the code that I have tried to run...

Pincate_0-1759138672214.jpeg

 

2 REPLIES 2
Andrew Neil
Super User

@Pincate wrote:

I have used a 115200 Baud rate, and connected to COM 3 with 8 bits and 1 stop bit


So, presumably, you are trying to use the Virtual COM Port (VCP) in the Nudleo board's ST-Link?

 


@Pincate wrote:

I am using suart2 with PA2 as the TX, and PA3 as the RX.


Are those pins actually connected to the VCP?

See: 

https://community.st.com/t5/stm32-mcus-embedded-software/bidirectional-serial-communication-with-st-link-usart2-using/m-p/838720#M68026:~:text=The%20main%20problem%20people%20posting%20here%20seem%20to%20face%20with%20using%20the%20Virtual%20COM%20Port%20(VCP)%20on%20Nucleo%20%26%20Discovery%20board....

 

PS:

Rather than posting code as a screenshot, please see How to insert source code

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

@Andrew Neil wrote:

 

@Pincate wrote:

I am using suart2 with PA2 as the TX, and PA3 as the RX.


Are those pins actually connected to the VCP?


It seems not. From the schematics, USART3 instance is the one that should be used with PD8 for Tx and PD9 for Rx.

mALLEm_0-1759141981316.png

So the question here, @Pincate are you using an externa USB/UART converter connected externally to USART2? if not, you need to use USART3 (PD8 for Tx and PD9 for Rx) and the STLINK VCP.

 

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.