ARMmbed / target-mbed-gcc

DEPRECATED Base for mbed yotta compilation targets compiling with GCC
Apache License 2.0
6 stars 12 forks source link

Printf not working with float data type #17

Closed awatt196 closed 3 years ago

awatt196 commented 8 years ago

I'm trying to print a float using printf, but it just appears as a blank space.

simonqhughes commented 8 years ago

ARM Internal Ref: IOTSFW-1075

hugovincent commented 8 years ago

Currently our standard library is configured to disable floating point printf (since it adds several kB of code, even if it's not used). We're working on making this configurable.

0xc0170 commented 8 years ago

@autopulated The commit for c++11 flags might have defined the wrong issue number. This issue was automatically closed by the merge. Please have a look and reopen if this issue is still valid.

autopulated commented 8 years ago

@0xc0170 thanks – This was caused by some commits from mbed-armcc accidentally being pushed to this repository, instead of the experimental https://github.com/armmbed/target-mbed

amdshrif commented 3 years ago

I still see the issue with mbed os 6 and it drove me crazy, any updates or what are the alternatives to print float numbers.

I literally hard coded a simple test in my code and still see the issue.

printf("peakVoltage: %f \n", 2.2);

In the serial console, it prints :

peakVoltage: %f

amdshrif commented 3 years ago

and it would be great if you add note in this doc https://os.mbed.com/docs/mbed-os/v6.13/program-setup/serial-communication.html highlithing this limitaiton becuase it litterlly wasted a lot of my time.

0xc0170 commented 3 years ago

@Shrif88 This is Mbed 3 target, I'll archive this repository now as deprecated.

Depending on your target and components config (Mbed 6 has small c lib option that has some limitations but full std should not).