cancel
Showing results for 
Search instead for 
Did you mean: 

Can't get Printf to work on CubeIDE

Hafez1
Associate II

Currently using a STM32L4R9I-DISCO and I've been struggling to get the SWV ITNM Data Console to work so I can do some debugging. I'm quite new to this, but I've followed every tutorial online to enable UART and how to set it all up, to no avail. I've managed to get the Trace Log to work, but I am looking for values of the variables in loops as the code is executed. Is there any other way to do this or is someone capable of helping me set this up?

13 REPLIES 13

@Pavel A. wrote:

 stdout is line-buffered. 


I had noticed that!

So, rather than just a 'send-a-char', your could use a 'send-a-buffer' ...

I'm now getting a bunch of errors in Drivers>CMSIS>Device>ST>STM32L4xx>Source>Templates>system_stm32l4xx.c in SystemCoreClockUpdate() and SystemInit(). It says multiple definitions. It seems that I have two system_stm32l4xx.c files. One in the location I just specified and the other in Core.

Nevermind. Manually deleted it. Currently trying to see the output in PuTTY. Will keep you posted.

That shouldn't have anything specifically to do with printf - there's something fundamentally broken with the project.

I'd suggest you start from scratch with a new project.