cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the "Debug (printf) viewer" with an STM32 on Keil uvision 5

mibou23
Associate II

Hi guys,

I use an STM32L072CZY6TR_LoraWAn and the IDE Keil Uvision 5 and i want to use the "Debug (printf) viewer" to visualize data. I'm a new user of Keil and i search someone who can explain to me what is the code that i need to implement to realize that.

The code should realize the same function that Printf() on Visual studio for example. I try a lot of think that i see on the internet but i don't obtain good results.

Thanks for helping me.

Tim

1 ACCEPTED SOLUTION

Accepted Solutions
Bob Boys
Senior

Hello

This is correct. I am currently writing an appnote that details all the useful debug features uVision has for ST Cortex-M0, M0+.

To get printf you will select DAP instead of ITM.

Attached is a section of the appnote detailing how to set this up.

It is easy.

Thanks

Bob Boys

bob.boys@arm.com

View solution in original post

6 REPLIES 6

SWV/SWO methods don't work on CM0(+) devices, you'd have to use a different method.

Look for @Bob Boys​ ​ app notes on the Event Recorder methods

On the Murata part I've also used PA0 UART4_TX for debug

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Bob Boys
Senior

Hello

This is correct. I am currently writing an appnote that details all the useful debug features uVision has for ST Cortex-M0, M0+.

To get printf you will select DAP instead of ITM.

Attached is a section of the appnote detailing how to set this up.

It is easy.

Thanks

Bob Boys

bob.boys@arm.com

Are there any clever tricks to determining if the CM0(+) is currently attached to a debug pod in Keil (or in general)? There is a BKPT/HardFault trick, but perhaps there is something more subtle?

The SWDIO/SWCLK pins on the L072 in the Murata module can be mapped to LPUART1 RX/TX

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mibou23
Associate II

Thanks for your answer. I really apreciate it. :)

That's seem working :) Thanks for the time you take to answer at my question :=)

Hello

I have finished the appnote describing 1) using Event Recorder in Keil MDK to provide printf (no UART is used) and various useful timing values about your program. I addition is a section on Power Measurement using Keil ULINKplus.

http://www.keil.com/appnotes/docs/apnt_321.asp

This can be easily adapted to work with any STM32 Cortex-M with or without SWV.

Comments are welcome.

Thanks

Bob