cancel
Showing results for 
Search instead for 
Did you mean: 

Printf in Keil

samiassaad
Associate II
Posted on March 19, 2011 at 09:36

Printf in Keil

13 REPLIES 13
dannym
Associate II
Posted on July 29, 2012 at 05:19

Ah, got it!

The instructions listed in that blog link will work.  However, as the author mentioned, it doesn't auto-program when entering Debug.  I got no printf() output because I was running stale code.  

The fix is under ''Utilities->Update Target Before Debugging'' (check, obviously).

evgeny23
Associate
Posted on September 28, 2012 at 18:46

Hello!

I was wondering if it's possible to save debug data transferred from the MCU (or at least, from the simulator) to a local file on a PC with KEIL while debugging the MCU. In the IDEs for other microprocessors fprintf() or fwrite() can used for this purpose. So, the data from the microcontroller, instead of being displayed in the Printf Debug window, is saved to a file. 

Thanks.

cgeiger9
Associate II
Posted on November 23, 2012 at 12:02

If you use a Stm32f4 Discoveryboard follwo the instructions in that link:

http://armcortexm.blogs.upv.es/stm32f4-discovery-and-printf-redirection-to-debug-viewer-in-keil/

and change the Clockfreq to 53,76000 MHz. this worked for me. I got the Freq from this Document. This helped a lot.

http://www.keil.com/appnotes/docs/apnt_asp

The *.pdf link does't work right now , but if you search the web you will find the file.

(Discovery evaluation board using ARM® Keil™ MDK Toolkit featuring Serial Wire Viewer Summer 2012 Version 1.1 by Robert Boys, bob.boys@arm.com)

________________

Attachments :

stm32F4_cortex-m4.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I12u&d=%2Fa%2F0X0000000bhv%2F50KssleBJySXtxJ5Py55vIiJhXluGhRSQApXYti1ppE&asPdf=false
frankmeyer9
Associate II
Posted on November 23, 2012 at 13:46

I was wondering if it's possible to save debug data transferred from the MCU (or at least, from the simulator) to a local file on a PC with KEIL while debugging the MCU. In the IDEs for other microprocessors fprintf() or fwrite() can used for this purpose.

 

You might need to check Keil's semihosting library, for what it provides.

I'm using Crossworks, and do this the same style as using debug_printf(). There are the accompanying functions like debug_fopen(), debug_fprintf() and debug_fclose(), which deal with files on the host.