2025-09-12 8:24 AM - last edited on 2025-09-17 3:02 AM by mƎALLEm
The integrated ST-Link debugger/programmer on STMicroelectronics NUCLEO boards is widely appreciated for its ability to output messages to a serial port, enabling easy debugging and communication with host PCs. However, setting up the board to not only send but also receive commands from PC-based applications such as Tera Term requires additional programming effort. This guide will walk you through the steps to implement bidirectional serial communications, allowing your NUCLEO board to interact dynamically with your computer.
Solved! Go to Solution.
2025-09-17 3:16 AM
Hello @Gretchev and thank you again for your contribution.
I tested the project and it works well.
If I summarize: This is a communication between a PC or any other device with a NUCLEO-C092RC board over USART2.
You send a character from the PC to the NUCLEO-C092RC board over a HyperTerminal, the board will receive that character and it will respond accordingly.
This is the log obtained:
Welcome to bidirectional ST-Link template
Starting default task
Starting UART command task
A: toggle green LED
B: toggle blue LED
C: How now brown cow?
D: Same way black bull
sending 'a' or 'A' will toggle the green LED
sending 'b' or 'B' will toggle the blue LED
sending 'c' or 'C' will print the message "How now brown cow?"
sending 'd' or 'D' will print the message "Same way black bull"
The example could be enhanced by sending a complete string and printing it back.
I will mark this comment as solution to give it more visibility for other users to help them to find efficiently this solution.
2025-09-12 8:42 AM
@Gretchev wrote:setting up the board to not only send but also receive commands from PC-based applications such as Tera Term requires additional programming effort.
No it doesn't.
Nucleo boards come out-of-the box with connections fully-wired for full-duplex comms.
There is no more setup for RX than for TX.
The Guide focusses on setting up FreeRTOS - which is, of course, a lot more work ...
2025-09-12 8:49 AM
Thanks for pointing this out, Andrew. I searched all over for a simpler solution and found none. My work with CAN FD always included FreeRTOS, so this was a natural fit.
2025-09-12 10:00 AM
I've edited the title to make that clear.
2025-09-13 3:56 AM - edited 2025-09-13 3:57 AM
For the benefit of others who may find this:
The main problem people posting here seem to face with using the Virtual COM Port (VCP) on Nucleo & Discovery boards is using the wrong UART pins.
It is important to check in the User Manual to find which UART pins are connected to the ST-Link for the VCP.
The User Manual can be found on the 'Documentation' tab of the board's Product Page.
The Schematics should also be available on the 'CAD Resources' tab.
Note that some early boards didn't have a VCP at all, or didn't provide the connection to the Target MCU; eg,
UART doesn't work on STM32F407G-DISC1
#NucleoVCP #VCPUART #UseCorrectUART
2025-09-17 3:16 AM
Hello @Gretchev and thank you again for your contribution.
I tested the project and it works well.
If I summarize: This is a communication between a PC or any other device with a NUCLEO-C092RC board over USART2.
You send a character from the PC to the NUCLEO-C092RC board over a HyperTerminal, the board will receive that character and it will respond accordingly.
This is the log obtained:
Welcome to bidirectional ST-Link template
Starting default task
Starting UART command task
A: toggle green LED
B: toggle blue LED
C: How now brown cow?
D: Same way black bull
sending 'a' or 'A' will toggle the green LED
sending 'b' or 'B' will toggle the blue LED
sending 'c' or 'C' will print the message "How now brown cow?"
sending 'd' or 'D' will print the message "Same way black bull"
The example could be enhanced by sending a complete string and printing it back.
I will mark this comment as solution to give it more visibility for other users to help them to find efficiently this solution.