I have an issue on 52833 board, SDK 16.0.0, SD s113 v7.1.0
I am using Hard FPU : arm_fp_abi="Hard" arm_fpu_type="FPv4-SP-D16"
I have a computation that runs for a few seconds on main loop, and that sometimes does a float computation.
After it returns from the main loop, every call of nrf_pwr_mgmt_run, directly goes through, due to the FPU interrupt not being cleared.
So power consumption is very high as it never sleeps.
This is similar to https://devzone.nordicsemi.com/f/nordic-q-a/12433/fpu-divide-by-0-and-high-current-consumption, but I am not dividing by 0.
I reproduce with something as minimal as :
while (count++ < 5000) {
nrf_delay_ms(4);
watchdog_feed();
if (count % 30 == 0) {
uint8_t percent = (float) count / 5000 * 100;
}
}
Replacing the float computation by a integer computation solves the issue.
Clearing the interrupt flag manually before nrf_pwr_mgmt_run alspo solves the issue :__set_FPSCR(__get_FPSCR() & ~(FPU_EXCEPTION_MASK));
(void) __get_FPSCR();
NVIC_ClearPendingIRQ(FPU_IRQn);
nrf_pwr_mgmt_run();
What do you think happens ? What should I do ?