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

sd_power_system_off returns immediately and forces reset

I hope this isn't a duplicate of another question. I searched on sd_power_system_off and didn't see anything exactly like this.

I'm creating a new project, based on ble_app_template from SDK 11.0.0 . So far, all I've done is tested to make sure my combination of services advertises correctly. It does, but I noticed via debug output that the application restarts regularly and I tracked it to the sleep_mode_enter call (due to advertising timeout) and sd_power_system_off. The latter call is made and immediately exits with error NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN.

What might cause this?

I'm attaching my main.c. main.c

ble_whts.c ble_whts.h

Parents
  • Hi.

    The chip cannot be put in system_off when in Debug mode. It will most likely work when you run it without the debugger, but you should confirm this with a test.

    -Anders

    UPDATE 2016.10.14:

    The chip will be put in emulated system off mode if in debug interface mode and calling sd_power_system_off(). This will lead to the CPU executing code after the call. Therefore it is recommended to add an infinite loop after going system off. See this and this post.

Reply
  • Hi.

    The chip cannot be put in system_off when in Debug mode. It will most likely work when you run it without the debugger, but you should confirm this with a test.

    -Anders

    UPDATE 2016.10.14:

    The chip will be put in emulated system off mode if in debug interface mode and calling sd_power_system_off(). This will lead to the CPU executing code after the call. Therefore it is recommended to add an infinite loop after going system off. See this and this post.

Children
Related