Hi
I have observed a strange behaviour on the MSP432. A hard fault is triggered (isr_fault) when the SCB_SCR_SLEEPONEXIT flag is cleared inside an ISR.
Example:
void main(void)
{
// init code
[...]
// enter LPM4
SYSCTL_SRAM_BANKRET |= SYSCTL_SRAM_BANKRET_BNK7_RET;
MAP_PCM_gotoLPM3();
while (1);
}
void isr_p1(void)
{
uint32_t status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P1);
MAP_GPIO_clearInterruptFlag(GPIO_PORT_P1, status);
if (status & GPIO_PIN1) // switch S1 pressed
{
// toggle LED
LED_TOGGLE(LED_0);
} else if (status & GPIO_PIN4) // switch S2 pressed
{
SCB_SCR &= ~SCB_SCR_SLEEPONEXIT;
// -> isr_fault() is called after this line
}
}