cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F405RGTx_FLASH.ld uses unaligned SP

markb
Associate II
Posted on June 01, 2015 at 08:51

Hello ST People,

The .ld file that the cube generates for me (STM32F405RGTx_FLASH.ld) contains:

_estack = 0x2001FFFF;    /* end of RAM */

but this makes the initial SP unaligned which I only noticed because some floating point numbers were

not getting printed out correctly (I was using vprintf()). I changed it to the following and floats now print OK.

_estack = 0x20020000;    /* end of RAM */

I believe that ARM require that the stack is 8 byte aligned.

Cheers,

Mark

5 REPLIES 5
stm32cube-t
Senior III
Posted on June 08, 2015 at 18:31

Hello,

Can you please indicate which toolchain and STM32CubeMX versions you are using?

Thanks.

Posted on June 08, 2015 at 18:56

One of the GNU chains.

It was discussed recently in another thread, can't find it right now.

It should be aligned, at the very least 4-byte to the top of memory, as it predecrements.

ARM has mentioned an 8-byte alignment in the past, not sure that's rigorously enforced, and perhaps more salient in CPU/FPU situations where a 64-bit load/store is used.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
markb
Associate II
Posted on June 08, 2015 at 19:33

Hi,

I am using cube version 4.8.0. I am generating code for SW4STM32 but I am not using that toolchain. Instead I am using

arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20150303 (release).

I think this has been wrong for a while now.

Cheers,

Mark

stm32cube-t
Senior III
Posted on July 01, 2015 at 13:43

Hello,

Thank you for your feedback. This problem will be resolved in next CubeMX release 4.9.