[En-Nut-Discussion] Problem with ARM floating point, again
apcom at tlen.pl
Wed Jan 30 15:51:05 CET 2013
> Me again,
> On 30.01.2013 09:52, Harald Kipp wrote:
>> a user reported, that printf output of a double float fails on SAM7X
>> with Nut/OS 4.10, using the latest Yagarto toolchain.
> What I learned so far is, that the problem still exists with a number of
> previous releases of the Yagarto toolchain and probably with Linux
> toolchains as well. It looks like an alignment problem with newlib's
> _dtoa_r function.
> Printing floats on Nut/OS for ARM is considered broken until further
> notice. If you want to print float values, convert them to integer
> first, e.g.
> double val = 15.1;
> int d = val * 1000;
> printf("Float: %d.%03d\n", d / 1000, d % 1000);
> I remember similar problems on the AVR platform. IMHO, the best solution
> is to provide our own dtoa function. But that's a challenge. All
> existing code I found so far is based on the ancient AT&T (later Lucent)
For above reason, up today I use Yagarto 4.3.2 (with Ethernut 4.10.2)
without any problem with floating point formatting.
More information about the En-Nut-Discussion