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

detect wake up reason from deep sleep.

Hello,

i have a application with two operating states
state1: device is in deep sleep
state 2: device is running

i wake up the device from deep sleep via gpio interrupt. this is working very well so far.

after flashing the firmware the device should go into deep sleep (state 1), when i wake it up with my gpio pin the chip makes a reset and jumps into deep sleep again.

so how can i detect that the reason for the reset was the gpio interrupt to jump into state 2.

i tried

int32_t reset_reason = 0;    
 reset_reason = NRF_POWER->RESETREAS;
NRF_LOG_PRINTF("reset_reason: 0x%08x.\n",reset_reason );   

but the console output is always 0x0005000d. After the first start after flashing new firmware it is also the same value.
So i am not able to use that information to switch between my states.

Do you have any idea? or solution for me?

best regards

Max

Related