2012-04-19 02:43 AM
Dear all,
What is the stack width of STM32L151r8? Thank you2012-04-19 02:58 AM
Not sure what you mean.
The stack is placed in RAM, and is 32 bit wide in an 32 bit architecture like CM3. The stack size is purely a property of your toolchain / application, as it is just some reserved RAM, with the stack pointer pointing to the begin.2012-04-19 08:46 PM
Hi,
Thanks for replying. But I am still having my confusion. It is true that STM32L is a 32 bit micro controller. But if I am having the following definition in my linker configuration file, define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; alignment = 8 means, I am aligning my stack to 8 bytes. Is that mean my stack width is 8 bytes? Any clarifications regrading this will be highly appreciated. Thank you.2012-04-20 12:09 AM
An alignment of 8 means that the stack begins at an address which is a multiple of 8. This is no architectural constraint, because most of the data handled with the stack are 32 bit.
This 8 byte alignment is a requirement for the ARM architecture ABI. It is assumed to make object files / libraries easily exchangable, i.e., you can link in a libraries compiled with a different toolchains. Suggested reading: AppsNote179.pdf and IHI0046B_ABI_Advisory_1.pdf from2012-04-20 04:57 AM
Hi fm,
Thanks for your reply and the given resource links. I will go through it. This means the stack width (stack word size) of STM32L is 4 bytes or 32 bit. Thank you.2012-04-20 05:27 AM
Unless you intentionally break the alignment playing with the SP, the push/pop will keep the alignment at 32-bits.