wlamers
wlamers

Reputation: 1286

LPC17xx sleep modes and software reset error when invoked in interrupt

I have a problem with both the sleepmodes and NVIC_reset(), aka software reset.

The problem is present on two totally distinct boards, both with a LPC1769 uC.

If I enter the sleepmode within main() or another function, except an interrupt routine, the sleep mode is working perfecly. The uC wakes also with an external interrupt on EINT0. The reset function does its job also well in the main function.

But when a sleepmode or reset request is invoked inside an interrupt routine trouble starts. The sleep mode lookes to be entered but the uC does not wake up anymore.

E.g. enter a sleep mode with EINT1 and wake with EINT0:

void EINT0_IRQHandler(void)
{
  EXTI_ClearEXTIFlag(0);
}

void EINT1_IRQHandler(void)
{
    EXTI_ClearEXTIFlag(1);
    CLKPWR_Sleep();
}

Anybody a clue why this does not work properly?

Upvotes: 1

Views: 956

Answers (1)

starblue
starblue

Reputation: 56772

Have you checked your interrupt priorities?

34.3.5.2.1 Wakeup from WFI or sleep-on-exit
Normally, the processor wakes up only when it detects an exception with sufficient priority to cause exception entry.

Upvotes: 3

Related Questions