24. March 2014 2 min read

Nucleo-F401RE UART serial debugging port

There are many guides around internet but none really tell you that you can get serial output (or printf) through ST-Link debugging tool. As usual for serial ports you will need to install program that prints COM port data. For Windows I suggest Termite, while for Linux you can just write a simple script in Python. Now windows part is a lot easier for ST as you have drivers and everything, all you have to do it check Device Manager and search for: STMicroelectronics STLink Virtual COM Port under COM ports. Beside it you will find the corresponding number of this COM Port.

Preparation in mbed

First of all you will need to define ports PA_2 and PA_3 as TX and RX. After that you will need to probably also set baud rate with serial.baudrate(whateveryouwant); . As usual mbed has a good guide. Once you have your binary code on your computer you will need to do following or get a script waiting as here comes the tricky part.

Open serial port for Nucleo-F401RE debugging

Just as you upload code you need to open the serial port. It is best that serial port open is retrying while you upload your code to ST Nucleo. This will enable you to access your STLink Virtual COM port and read data from it.
Enjoy your serial output without any additional cables and UART/USB adapters. People at ST already predicted this is one of most needed debugging tools and they have implemented it into mbed ST Nucleo boards.

Newest from this category: