bmarcot / vega

vega -- The Unix-like Operating System for micro-controllers (ARM Cortex-M4)
6 stars 1 forks source link

Crash on real target because SCB->SHCSR is overwritten during boot #4

Closed bmarcot closed 8 years ago

bmarcot commented 8 years ago

The SCB->SHCSR is written during boot, when enabling faults. This overwrites the SYSACT bit that was set by branching to Handler_Mode earlier. The integrity checks on exception return fails because the IPSR and the active interrupt in the SCB don't match.

Fixes: (1) enables the faults before, or (2) do not modify other bits in SCB->SHCSR than the fault enabling bits.

Seen on NRF52 eval board, but not in QEMU.

bmarcot commented 8 years ago

Fixed in 486bd2f.