Debug console for printf.

Showing results for 
Search instead for 
Did you mean: 

Debug console for printf.

Contributor I

I am working with a k22 microcontroller. I wanted to use one of the UART s as a debug port.I was planning on using the debug console functionality and mapping the output to a UART to make this my PRINTF is remapped to the hash defined  DbgConsole_Printf . I had 2 questions regarding this.

1) I am assuming that by using the debug console PRINTF and not actual 'printf' I can reduce the code footprint.Is this correct. are there any other adv/disadvantages to using the DbgConsole_Printf ?

2) For some strange reason when i try to print out float values using DbgConsole_Printf , its not showing in the console..? integer and char format specifiers works just fine.Anyone has had similar problems or insights into this?

Tags (1)
0 Kudos
1 Reply

NXP TechSupport
NXP TechSupport

Hi Sreejith:

Yes, printf() is memory consuming, so in project, we need to make sure have enough stack and heap allocated. But printf have more features than debug console.

To print floating point values, you need to enable float/double support.

Please check the following link for more detals:

sprintf, PRINTF, DbgConsole_Printf with float and double 



0 Kudos