Skip to main content
mibou23
Associate II
June 18, 2019
Solved

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

  • June 18, 2019
  • 3 replies
  • 8977 views

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

This topic has been closed for replies.
Best answer by Bob Boys

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

3 replies

Tesla DeLorean
Guru
June 18, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Bob Boys
Bob BoysAnswer
Visitor II
June 19, 2019

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

Tesla DeLorean
Guru
June 20, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
mibou23
mibou23Author
Associate II
June 20, 2019

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

Bob Boys
Visitor II
July 25, 2019

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