EmbDev.net

Forum: ARM programming with GCC/GNU tools sprintf %f float problem-YAGARTO


von Kamil B. (kamil51)


Rate this post
useful
not useful
Hello,

I am using yagarto 4.4.2 version. if i use sprintf with %f the program 
seems to be halts!! but no any problem in &d %x....

anybody have the same problem???

Regards

kamil

von Alexander (Guest)


Rate this post
useful
not useful
Hello Kamil,

i have also problems using %f with this version of the toolchain. I am 
using sprintf to print a float number into a string. What i have found 
is that the sprintf with %f prints float numbers that are nearly 200 
chars long. So i got a overflow of my char array. Now im using an older 
version of gnuarm that works without errors.
What type of CPU are you using? Has it hardware float support? Im using 
an AT91RM9200 without float support. I'm using soft float and that works 
well, with the exeption of the printf function.

Greetings

Alexander

von kamil bahadir (Guest)


Rate this post
useful
not useful
Hello Alexander,

I am using LPC 2138. it has no float hardw.
i found a solution by using float2str() function.

but no any solution by using "syscall" functions.


Greetings

kamil

von Martin Thomas (Guest)


Rate this post
useful
not useful
A few thinks you may try to test:

- if enabled: disable thumb/thumb-interwork during tests. Options can be 
enabled later when problem has been located.

- check if the linker uses the correct libc and libm (no -L options 
poiting into the toolchain installation-directory, arm-*-gcc used for 
linking - not arm-*-ld)

- check the defintion of the heap-start address  (linker-script, 
map-file, symbol-table) and the sbrk syscall are correct

- make sure dynamic memory allocation works (use malloc and free for 
tests). I suggest to allocate at least 8KB during the tests which should 
lead to 3 calls to sbrk (with a newlib that has been configured without 
SMALL_MEMORY, AFAIK M. Fischer does not configure with SMALL_MEMORY for 
Yagarto)

- check if the math-library is linked (option -lm for linkage, library 
name libm-a)

- try with the latest version of Yagarto or with Codesourcery G++ lite 
for ARM EABI (both arm-eabi)

von Kamil B. (kamil51)


Rate this post
useful
not useful
Hello Martin,

Very thanks for your suggestions. after testing i will be back to you.

Best Regards

kamil

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.