cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L010 - printf debug

Claus_CE
Associate II

Hello together,

 

I developed a PCB with the STM32L010RBT6 on it and I would like to debug with printf. I connected the SWD Pins (3.3V, SWCLK, SWDIO, GND, NRST) to my Nucleo F446RE kit for SWD debugging. So far so good I can now debug in the CubeIDE but I can't read any of my printf statements. Is there any chance to printf debug on that Cortex-M0?

I tried to connect to the serial communication with the CubeIDE included "SWV ITM Data Console" and with my terminal but never read something out of it. 

 

I would appreciate any help or tips. Thank you!

 

 

4 REPLIES 4

The Cortex-M0(+) doesn't support the SWV/SWO model.

Use a UART. Perhaps use a buffer to hold text you can view in stopped instance of the debugger?

Keil had an Event Recording Method   https://developer.arm.com/documentation/kan321/latest/

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Rim LANDOLSI
ST Employee

Hello @Claus_CE  and welcome to the community,

 

You can have a look at the AN4989 STM32 Microcontroller, it  explains how to debug with printf.

Could you also include the debug configuration settings and the type of variable you want to print? This would be more helpful.

 

Thanks,

Rim

 

Thank you for your fast reply. I tried the Event Recorder in Keil's uVision but it's not working for me, so my last choice would be using an UART->USB adapter and then I can view it in the Keil or CubeIDE. 

Is there any chance to make it work without UART->USB adapter?


@Claus_CE wrote:

I tried the Event Recorder in Keil's uVision but it's not working for me

Why not? What went wrong with it?