Debug console for printf.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Debug console for printf.

1,328 次查看
sreejithmenon
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 happen.so 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?

标记 (1)
0 项奖励
回复
1 回复

899 次查看
danielchen
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 

Regards

Daniel

0 项奖励
回复