Skip to main content
MLemo.1
Associate III
July 9, 2020
Question

SWD printf debuggin issues..

  • July 9, 2020
  • 3 replies
  • 1337 views

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?

This topic has been closed for replies.

3 replies

LMI2
Senior III
July 9, 2020

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.

MLemo.1
MLemo.1Author
Associate III
July 9, 2020

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

Pavel A.
Super User
July 9, 2020

Is the SWO pin connected to the ST-LINK?

--pa

MLemo.1
MLemo.1Author
Associate III
July 10, 2020

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

Piranha
Principal III
July 11, 2020

ITM_SendChar() sends data over SWO line...