This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF51822 and S110 why does device wake from sleep and call main?

I am working with the nRF51822 chip and the S110 softdevice on a device that uses an accelerometer to wake up. Battery life is a concern, so we have developed the device so that it advertises with a timeout of 10 seconds when the device is shaken (triggering an accelerometer interrupt). We put the device to sleep using sd_app_evt_wait() when possible.

I have noticed that when the device wakes up after it has stopped advertising, it calls main again, and my global variables stored in RAM are set to zero. This behavior did not occur when we were continuously advertising (timeout value of 0).

Is there a way to prevent the device calling main again? Is the device entering a "deeper sleep"? I am worried that I will have to persist my global variables in flash.

Parents Reply Children
No Data
Related