NRF9160 Power On Sleep Waking without Discrete Event or Interrupt

I am using a NRF9160 module using NCS 1.8.

My application is successfully using GNSS, HTTPS, and MQTT.  The issue I am currently having is premature wakeup from the POWER ON Sleep state.

I currently launch a oneshot timer with:

 k_timer_start(&my_one_shot_timer,  K_SECONDS(sleep_time), K_NO_WAIT );//one shot timer

Then I am placing the NRF9160 into sleep mode with 

__WFI();
__SEV();
__WFI();

The issue I am currently having is the unit wakes from sleep prior to the timer timeout.

I have confirmed the timer was still running by using this code after wakeup that I found on the forum.

if ((cnt = k_timer_status_get(&multi_shot_timer)) > 0) {
/* timer has expired */
printk("Timer count %d\n", cnt);
} else if (k_timer_remaining_get(&multi_shot_timer) == 0) {
printk("Woke without timer?");
/* timer was stopped (by someone else) before expiring */
} else {
printk("Timer still running");
/* timer is still running */
}

I have disabled UART interrupts in the config and am using RTT instead of serial to eliminate UART.

Is there a better way to put the device to power on sleep/idle?  Could the MQTT or Socket handlers be causing events to fire even though they aren't actively being called?  Should I just ksleep instead?

Parents Reply Children
No Data
Related