Unable to get printf to print floating point

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to get printf to print floating point

Jump to solution
7,745 Views
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

Tags (2)
1 Solution
5,719 Views
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

View solution in original post

3 Replies
5,719 Views
remybringold
Contributor I

For me this helped:
float.jpg

5,720 Views
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

5,719 Views
giampietropompo
Contributor I

I have the same problem, follow the case.

0 Kudos