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
8,720 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
6,694 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
6,694 Views
remybringold
Contributor I

For me this helped:
float.jpg

6,695 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

6,694 Views
giampietropompo
Contributor I

I have the same problem, follow the case.

0 Kudos
Reply