[87] CPU: Unexpected wake from System ON Idle when using FPU

This anomaly applies to IC Rev. Engineering A, build codes QFAA-AA0, QFAA-AC0, CGAA-AA0.

Symptoms

The CPU is unexpectedly awoken from System ON Idle.

Conditions

The FPU has been used.

Consequences

The CPU is awoken from System ON Idle.

Workaround

The FPU can generate pending interrupts just like other peripherals, but unlike other peripherals there are no INTENSET, INTENCLR registers for enabling or disabling interrupts at the peripheral level. In order to prevent unexpected wake-up from System ON Idle, add this code before entering sleep:

#define FPU_EXCEPTION_MASK 0x0000009F 
 _set_FPSCR(_get_FPSCR() & ~(FPU_EXCEPTION_MASK)); 
 (void) __get_FPSCR();
 NVIC_ClearPendingIRQ(FPU_IRQn);
 __WFE();