cannot wakeup from sd_power_system_off()

Hi,

I'm following the ble_template example on my custom board. I'm having an issue with waking up (soft reset) the device from sd_power_system_off. I can power off the system, however, the configured button couldn't reset it. I also noticed 52840 resets itself after 120 s when I turn it off. I'm wondering if these are related.

I'm using pin13 to wakeup the system, and I checked the pin active state is correctly configured. any hints?

Thanks,

  • Hello,

    Could you share with me the code which you use to prepare the device for SYSTEM_OFF sleep?
    I would recommend that you take a look at how the sleep_mode_enter is implemented in the ble_peripheral examples, to see how you could set up a device to wake up from SYSTEM_OFF sleep with the push of a button or pin interrupt.

    I also noticed 52840 resets itself after 120 s when I turn it off.

    Are you saying that the device wakes up on its own after 120s? Then I suspect that the device is not actually in SYSTEM_OFF sleep, since it is unable to wake itself from SYSTEM_OFF. Could you elaborate more on this behavior?

    Best regards,
    Karl

  • Hi Karl,

    I'm using the example from ble_peripheral. I only added some gpio resetting before entering sleep mode. If I press the button, it does trigger this function, and sd_power_system_off() is not returning. (I think this is expected).

    when it enters the "power off mode", I couldn't wake up using the GPIO, and after 120 seconds, it will wake up by itself (soft reset)

    I use the same pin to sleep and wake, so I think the GPIO is configured correctly, and I tried other pins but doesn't work either. 

     static void sleep_mode_enter(void) {
    
         poweroff_reset_gpio();
    
         ret_code_t err_code;
    
         err_code = bsp_indication_set(BSP_INDICATE_IDLE);
         APP_ERROR_CHECK(err_code);
    
         // Prepare wakeup buttons.
         // The wakeup ID pin is defined in bsp_btn_ble.c
         err_code = bsp_btn_ble_sleep_mode_prepare();
         APP_ERROR_CHECK(err_code);
    
         // Go to system-off mode (this function will not return; wakeup will cause a
         // reset).
         err_code = sd_power_system_off();
         APP_ERROR_CHECK(err_code);
     }
    

  • Hi Karl,

    I figured what's going on there. I use the same pin to put the device into sleep/wake/enter DFU. when I try to wake up the device, it immediately enters DFU mode (and I totally wasn't aware of that). When it times out, it resets into the main application. That explains everything!

    Thanks for the help!

Related