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

nrf_pwr_mgmt_shutdown() fails while debugging.

Hi

Im using nRF52832-QAAB0. SDK 15.3. Softdevice is running. 

With debugger connected, calling nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_STAY_IN_SYSOFF) will assert in shutdown_process() when sd_power_system_off() returns. 
According to https://devzone.nordicsemi.com/f/nordic-q-a/15677/why-does-nrf52-hrs-sdk11-example-sd_power_off-return-6 nordic employee recommends adding while(1); after calling sd_power_system_off()

Is there any reason nrf_pwr_mgmt_shutdown() does not handle debugging?
Parents
  • Yeah, it's called "emulated shutdown". If the MCU goes into SystemOFF mode with a debugger attached then the DAP - Debug access port will also shut down and you will exit whatever debugging session you're in. This is not really conducive to debugging so we emulated the shutdown, either by putting the system into SystemON Idle mode , holding the CPU in an infinite loop, or stopping the CPU. 

    Try compiling without the DEBUG flags, in SES you can use the "release" build environment. 

Reply
  • Yeah, it's called "emulated shutdown". If the MCU goes into SystemOFF mode with a debugger attached then the DAP - Debug access port will also shut down and you will exit whatever debugging session you're in. This is not really conducive to debugging so we emulated the shutdown, either by putting the system into SystemON Idle mode , holding the CPU in an infinite loop, or stopping the CPU. 

    Try compiling without the DEBUG flags, in SES you can use the "release" build environment. 

Children
Related