Hi,
We use the nRF radio timeslot API to take control over the radio and other peripherals periodically. We have noticed that when the timeslot is active (we own the peripherals) and we call nrf_pwr_mgmt_run() to sleep, the system never wakes again. To solve it we have to do the following workaround:
static void IdleStateHandler(void)
{
// Handle pending app events before going to sleep
app_sched_execute();
// NOTE: Dont sleep if radio timeslot active since it does not wake again
// Likely related to the usage of radio timeslot
if (!RadioTimeslotIsActive() && NRF_LOG_PROCESS() == false)
{
#if NRF_MODULE_ENABLED(NRF_PWR_MGMT)
nrf_pwr_mgmt_run();
#endif
}
}
I would like to know how this is meant to work!
I understand that it may be an issue if the system goes to deep sleep since the wakeup time may introduce a jitter. However, it should be possible to go to shallow sleep (WFI) to save the power consumption of the MCU core. The workaround above means that the MCU core is spinning as long as the timeslot is active, which drains the battery faster.
We use:
nRF52840 DK
nRF5 SDK ver 16.0.0
Softdevice: s113_nrf52_7.0.1_softdevice.hex
BR / Björn