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

System resets on sd_power_system_off

Hi,

I want to power the system off when a a characteristic is written. I do so by calling sleep_mode_enter function listed below. When sd_power_system_off is called the system resets instead of turning off. I read on other threads that this could be because of being in debug mode. I tried turning off everything related to debug mode and disconnecting the debug probe but the issue still exists. 

static void sleep_mode_enter(void)
{
    ret_code_t err_code;

    err_code = bsp_indication_set(BSP_INDICATE_IDLE);
    APP_ERROR_CHECK(err_code);

    // Prepare wakeup buttons.
    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).
    #ifdef DEBUG
     (void) sd_power_system_off();
     while(1);
    #else
      err_code = sd_power_system_off();
      APP_ERROR_CHECK(err_code);
    #endif  // DEBUG
}


What could be the reason? How do I make sure debug mode is properly disabled?
I found on another thread that I could use an #ifdef to check if DEBUG is defined and set an infinite loop after calling sd_power_system_off but that didn't help either!

Thanks

Parents
  • Hi

    You might need to power cycle the board in order to get out of DEBUG mode. Please try turning it off and removing the power source(s) before powering it back on. This should set the board to release mode if configured correctly. If the board still just resets, could it be that the wake-up call is called immediately after the device goes to sleep causing the reset?

    Best regards,

    Simon

Reply
  • Hi

    You might need to power cycle the board in order to get out of DEBUG mode. Please try turning it off and removing the power source(s) before powering it back on. This should set the board to release mode if configured correctly. If the board still just resets, could it be that the wake-up call is called immediately after the device goes to sleep causing the reset?

    Best regards,

    Simon

Children
Related