cancel
Showing results for 
Search instead for 
Did you mean: 

SWD printf debuggin issues..

MLemo.1
Associate III

Hello,

I'm just a beginner that tryes to migrate from the arduino world to ST and before I start the dev jorney I'd like to hand on to a debbuging method that requiers as little hardware and sofware setup as possible while still having the logging and direct debugging capabilities now ST linkV2 as a debugger works just fine by default but I'd like to also have a running debugging option with printf like in arduino so following this guide:

http://blog.atollic.com/cortex-m-debugging-printf-redirection-to-a-debugger-console-using-swv/itm-part-1

I saw it is possible and relativelly simple but can't manage to make it work no matter if I just the ITM_SendChar( 65 ); function of printf(); the SWV ITM data @Port0 just stays empty and I've enabled everything that the guide shows

Any idea what else needs to happen or if that even possible using an stm32F411ceu black pill with ST-Link V2 dongle?

5 REPLIES 5
LMI2
Lead

Do you really need Arduino style printf. Arduino has no real IDE, integrated development environment, just a tool to download code to CPU and a good serial monitor.

With STM32 CPU and real IDE you can single step your code one instruction at time and see easily what the SW is doing. There is very little need for huge amount of print commands.

For serial bus/UART/USART you need a serial to USB converter and serial monitor in your computer.

But why do it with additional device instead of using the same st link for debugging and printing?

Pavel A.
Evangelist III

Is the SWO pin connected to the ST-LINK?

--pa

No, but is it necessary if I could debug and flash the chip in the current setup with just two wires?

Piranha
Chief II

ITM_SendChar() sends data over SWO line...