This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Cortex-M4输出格式化sprintf失效该如何解决?

Other Parts Discussed in Thread: TM4C123GH6PM

我现在在使用TM4C123GH6PM这款芯片,从LM3S9B96移植过来的程序很多都无法使用。

我在测试Uart输出的时候发现sprintf函数不能格式化float类型的变量。

程序代码:

#include "stdio.h"

   char cBuf[16];

   sprintf(cBuf,"V0=%f \n",12.34);

   UARTSend(cBuf,20);

按照设想Uart输出的应该是“V0=12.340000”,可是实际输出的是“V0=0.000000”,在TM4C123GH6PM上为什么会出现这个情况,在LM3S9B96上测试通过,请指点,谢谢.