cancel
Showing results for 
Search instead for 
Did you mean: 

Stack aligment in STM32f103, bit STKALIGN

sholojda
Associate III

HI. I'm trying to understand what is Stack aligment and what is it for.

Cortex-M3 has a special bit STKALIGN in SCB->CCR register. Theoretically this bit is set to 1 in new revision of core, but when i look through debugger this bit is clear.

I've read that there is a sepcial attribute for GCC ARM :

__attribute__((interrupt))

and it should be used with old revision r0p0 to align the stack by compiler, but when i make the code i do not know what is the revision of core in uC so do i need to use this attribute or not?

And what happen when do not make aligment?

0 REPLIES 0