# nRF52 does not enter system off

I have following code fragment to enter nRF52 into power-off mode. There is s132 softdevice 3.0.0 running and my SDK is 12.0.0:

 int32_t ret = sd_power_system_off();
// get here if softdevice is not running
debuglnf("sd_power_system_off() == %d", ret);
NRF_POWER->SYSTEMOFF = POWER_SYSTEMOFF_SYSTEMOFF_Enter;


But what really happens, is that by code continues running with a return value 8198 from the sd_power_system_off() call. I guess it might be NRF_ERROR_SOC_POWER_OFF_SHOULD_NOT_RETURN.

Furthermode, although there are those direct register pokings to enter system off if sd_power_system_off() fails, what really happens is that the system continues running. But not like normally! According to my RTT debug prints it looks like it runs VERY SLOWLY, maybe around one tenth of normal speed. It might also be that my timers stop running entirely, since timer based activities are stopped.

What the heck is going on there? I would need help to get the system into true power-off state and would really appreciate any hints.

edit retag close delete

Sort by » oldest newest most voted

I am pretty sure you are seeing this in debugger. In debug mode system off does not work. Instead, emulated system off is used which does not go to deep sleep and the CPU continues to run. But the wakeup source will reset the chip in both emulated system off and normal system off. We added this feature for debugging. One way to verify that your system off feature is working in debugger is to trigger the wakeup source and see if it has reset the chip.

Also it is important to have a while(1); after the triggering the system off. Else in debug mode, since the CPU continues to run, it will cause some hardware fault because it will start executing something which it is not supposed to.

more

did you get to check if this was the case for you Jarmo?

( 2016-12-01 14:56:29 +0100 )editconvert to answer

It might be the case. I am using RTT to see debug printings, so does that mean the system is in debug mode and thus emulates system off?

( 2016-12-01 15:09:49 +0100 )editconvert to answer

No, it is in debug mode if you started debugger or explicitly made chip to go to debug mode by controlling the SWD lines

( 2016-12-01 16:28:21 +0100 )editconvert to answer

[hide preview]

## Recent blog posts

• ### nRF52840 long range demo

Posted 2017-02-14 12:46:03 by Ole Bauck
• ### Setup and Running the OpenMesh DFU on the nRF52 DK v2.0

Posted 2017-02-06 22:33:25 by martindavidb
• ### New NFC feature on nRF52 Series: Read/write capable Type 4 Tag NFC library in nRF5 SDK.

Posted 2017-02-02 10:31:31 by Pär H
• ### Simple Application-level Authentication

Posted 2017-01-30 12:34:01 by Daniel Veilleux
• ### WIZnet's BLE to TCP Gateway

Posted 2017-02-01 01:12:03 by Mason Lee

## Recent questions

• ### How Can I sniff GATT Service or Characteristic Attributes by PCA10031 (NRF51 Dongle)?

Posted 2017-02-25 08:33:42 by Daniel T. Lee
• ### After the host calls "sd_ble_gap_connect_cancel", the slave is not disconnected.

Posted 2017-02-25 05:56:16 by shuhe
• ### How to get device details of BLE devices seen by NRF52?

Posted 2017-02-25 04:37:49 by QDI
• ### GCC/Eclipse tutorial: make: The system cannot find the file specified

Posted 2017-02-25 01:53:35 by dkwill
• ### [Hardware] nRF52 - NFC antenna design

Posted 2017-02-24 23:31:41 by Konrad Traczyk