RE: [arm-gnu] sprintf issue on Cortex-M3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [arm-gnu] sprintf issue on Cortex-M3



> -----Original Message-----
> From: Freddie Chopin [mailto:freddie_chopin@xxxxx]
> Sent: Wednesday, 16 December 2009 7:17 AM
> To: arm-gnu@xxxxxxxxxxxxxxxx
> Subject: Re: [arm-gnu] sprintf issue on Cortex-M3
> 
> Freddie Chopin pisze:
> > There are 2 important things:
> 
> Actually I just found next one:
> 3. Floats work in printf() when the linker has --gc-sections option
> added. Without that option the result is always 0.00000
> 
> This is really crazy, but I actually have no idea why... Anyone cares
to
> explain that?
> 

I remember hearing that later ARMs got really picky about keeping the
stack aligned, and that failure to do so would cause weird problems with
64-bit vars (like doubles) - especially with odd call chains and
interrupts.

Is it possible that --gc-sections is affecting the start address of your
stack?

J