1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

cpu/cortex-m: Enable STKALIGN to make the Cortex-M keep the stack 8 byte aligned on 4 byte aligned stack pointers

This commit is contained in:
DipSwitch 2016-04-07 00:27:26 +02:00
parent 5b386597c6
commit b6140f15f3

View File

@ -52,4 +52,12 @@ void cortexm_init(void)
/* enable wake up on events for __WFE CPU sleep */
SCB->SCR |= SCB_SCR_SEVONPEND_Msk;
/* for Cortex-M3 r1p0 and up the STKALIGN option was added, but not automatically
* enabled until revision r2p0. For 64bit function arguments to work properly this
* needs to be enabled.
*/
#ifdef SCB_CCR_STKALIGN_Msk
SCB->CCR |= SCB_CCR_STKALIGN_Msk;
#endif
}