AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Debugging a nucleo board1/1/2024 ![]() It will allow to do a printf-style logging. Then you should redirect your stdout to ITM macrocells, for that purpose you can use code from this article. First of all you should enable SWO pin in CubeMX utility. You can redirect stdout of your application through this interface by means of ITM Trace technology which is a part of CoreSight debug core of your MCU. Original ST-Link V2 (and even chinese clones except the cheapest dongles) have SWO pin. ![]() There is much better and easier way to achieve your goal and it is shown in the video. But it will take a lot of effort to configure and run this. More advanced option is to redirect stdout to that UART. Then you can transmit your logs for example with function HAL_Uart_Transmit(). The first way is to configure your UART (the process may be very straightforward if you use CubeMX) to send text and then hook-up RX and GND pins of your USB-RS232 to TX and GND pins of your board respectively. to build something that samples a signal rapidly (that's why I used USB on an ARM the first time) in the long term. The USB interface allows you to send USB data packets through USB2 Full Speed (that's the 12Mb/s standard) – that can be hell of an advantage if you need e.g. Be warned though that USB is way more complicated than UART, and if you just want to occasionally print short strings, UART certainly is sufficient. ST offers a library to do that, and that comes with examples. ![]() You can, adding a few resistors, directly connect that to your PC, and let it look like a serial adapter itself, just giving you your messages or data! That is, given you have a firmware that handles the USB stack. If you're tempted to directly communicate with the PC: Your MCU comes with a USB2 transceiver. The Nucleo boards just contain a second microcontroller that plays a USB-to-STLink and USB-to-TTL-UART bridge.įor "easy" debugging, the UART is certainly the least error-prone communications interface in the chip. The knowledge of how to do that can be taken from the Reference Manual of that family (ST Document number RM0008), or just straight from the UART driver within the STM Cube software package.Įlectrically, you'll really get a TTL UART – any TTL serial-to-USB converter will do. All the STM32F0 that I can think of come with UART hardware – meaning that you just need to write your string to some address, and trigger the transfer. ![]()
0 Comments
Read More
Leave a Reply. |