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

fatal error when I power system off

I try to turn off the system with sd_power_system_off()

// Go to system-off mode (this function will not return; wakeup will cause a reset).
err_code = sd_power_system_off();
SEGGER_RTT_printf(0, "sd_power_system_off(). err_code: %#04x\n" ,err_code);
APP_ERROR_CHECK(err_code);

But in the RTT Viewer (debugging with NRF_LOG), there is always an error, I printed the code number is 2006. I do not know the meaning of it and how to avoid it.

 0> sd_power_system_off(). err_code: 2006
 0> APP_ERROR:ERROR:Fatal
  • Firstly by looking to S132 headers in the SDK you will see what error codes mean and also you will see what each SD call can return with some possible indication what error it is and how to fix it. Unfortunately in your case 0x2006 means NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN and there is no real diagnostic for that. You have two obvious options how to go forward:

    • Try to apply simple workaround with firstly disabling SD and then sending the chip to POWER OFF directly through register write instead of SD function call. I used this on old S110 stacks and nRF51, in some situations I was getting similar error when trying to do it through SD (probably my fault but this was faster and functionally equivalent way then debugging).
    • You can indeed debug the situation by going to Nordic SDK examples where sd_power_system_off function is used and working. If example works on your board then you can try to make your code as close as possible to it and maybe you will find what is missing (probably something to be finished/disabled in SD before this call) or what is redundant.
  • Thanks a lot. Even though the fatal error exists, the system still goes to sleep and can be waked up. So I ignore it.

Related