Unable to get printf to print floating point

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

Unable to get printf to print floating point

跳至解决方案
9,299 次查看
aberger
Contributor V

I am using the NXP MCU Tools toolchain with Gnu Make Builder in the MCUXpresso IDE. I am able to use printf statements generally while debugging, but floating point specifiers (%f) do not print. I have enabled PRINTF_FLOAT_ENABLE=1 in the preprocessor (see below), but that makes no difference. I also have the Floating point mode set to "FPv4-SP (Hard ABI)." How can I get a floating point number to print using printf?

pastedImage_1.png

标记 (2)
1 解答
7,273 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

Remove the symbol "CR_INTEGER_PRINTF" from the preprocessor settings, then clean/rebuild.

For more information, see section 13.5.1,"Redlib printf variants" in the supplied MCUXpresso IDE v10.1. User Guide.

Regards,

MCUXpresso IDE Support

在原帖中查看解决方案

3 回复数
7,273 次查看
remybringold
Contributor I

For me this helped:
float.jpg

7,274 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

Remove the symbol "CR_INTEGER_PRINTF" from the preprocessor settings, then clean/rebuild.

For more information, see section 13.5.1,"Redlib printf variants" in the supplied MCUXpresso IDE v10.1. User Guide.

Regards,

MCUXpresso IDE Support

7,273 次查看
giampietropompo
Contributor I

I have the same problem, follow the case.

0 项奖励
回复