[Icc-avr] stack size needed to use fp?
Rich Webb
webbra.mlist at verizon.net
Tue Apr 29 11:37:41 PDT 2008
> Good clue Rich! So my whole problem could be sort of an fp underflow.....
> Wonder if I could hide an 0x55aa before and after the fp convert
> buffer and check for buffer overrun after cprintfs? Any idea how to
> find the address of the fp buffer?
I was thinking more along the lines of overflowing an sprintf(buf,...)
buffer, rather than a side effect of printf() or cprintf(). I typically
load a buffer with sprintf() and then fire the characters out the e.g.,
UART, one at a time when the UDRE (UART data ready empty) interrupt occurs.
In the fragment that I threw together I just pulled a nice round
"#define BUFLEN 128" out of the air rather than trying to optimize space
for the anticipated maximum length of the output string, or else I would
have tromped over who knows what when the error strings were printed
instead of the numerics.
I do use floats for user interfaces and such but the values are usually
on the order of 1 to 100 (4.8 V, 23.7 C, ...) and had not hit upon the
ftoa error message before this.
More information about the Icc-avr
mailing list