sprintf %f float problem-YAGARTO

Guest #1719312
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
Guest #1738283
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)

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.