Skip to content

Commit f39d8bb

Browse files
niedzwiecki-dawidcarlescufi
authored andcommitted
arm: clear UNALIGN_TRP bit in CCR register
Clear the UNALIGN_TRP bit in the CCR register, if the config CONFIG_TRAP_UNALIGNED_ACCESS is not set. Despite the fact that the reset value of UNALIGN_TRP is 0, always clear the bit. It is useful in double image systems. The new image can't rely on settings left by the previous image. Signed-off-by: Dawid Niedzwiecki <[email protected]>
1 parent e3cd6fc commit f39d8bb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arm/core/cortex_m/fault.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,5 +1192,7 @@ void z_arm_fault_init(void)
11921192
#endif /* CONFIG_BUILTIN_STACK_GUARD */
11931193
#ifdef CONFIG_TRAP_UNALIGNED_ACCESS
11941194
SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk;
1195+
#else
1196+
SCB->CCR &= ~SCB_CCR_UNALIGN_TRP_Msk;
11951197
#endif /* CONFIG_TRAP_UNALIGNED_ACCESS */
11961198
}

0 commit comments

Comments
 (0)