I'm using the recommended code for handling errata 87 on the nRF52840.
__STATIC_INLINE void pwr_mgmt_fpu_sleep_prepare(void) { uint32_t fpscr; CRITICAL_REGION_ENTER(); fpscr = __get_FPSCR(); __set_FPSCR(fpscr & ~0x9Fu); __DMB(); NVIC_ClearPendingIRQ(FPU_IRQn); CRITICAL_REGION_EXIT(); ASSERT((fpscr & 0x07) == 0); }
Why is the Assert() necessary if this code works around errata 87?
Is there anything that could cause the Assert() condition to be true? (other than an a higher priority interrupt or process using the FPU that executes as soon as the critical region exits)