I'm having some trouble successfully entering ON,IDLE mode. I have pared-down my application to do the following:
- Initializes the app_timer using the scheduler:
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, true);
- Initializes the BLE stack and softdevice:
BLE_STACK_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, BLE_L2CAP_MTU_DEF, bleApp_evtDispatch, true);
-
Creates an application timer using app_timer_create(). The timer is created, but never started.
-
Initializes the scheduler:
APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE);
- Enters an infinite loop alternatively calling app_sched_execute() and sd_app_event_wait().
If during the infinite loop of step #5, I call app_timer_stop() before sd_app_event_wait(), the nRF51844 never appears to enter ON,IDLE mode. Instead, sd_app_event_wait() appears to return immediately, and total current consumption remains around 4mA.
Likewise, if I remove the call to app_timer_stop(), the nRF enters ON,IDLE mode without any issue.
Is there potentially a bug in the app_timer system, or am I doing something wrong?
I'm using
- SDK v4.4.0.31803
- s110_nrf51822_5.2.1_softdevice.hex
- nRF51822 C0