Problem with emulated System OFF mode with NRF52

Remosennhauser gravatar image

asked 2016-10-12 15:15:31 +0100

Hi all

I have two questions/problems regarding the emulated System OFF mode with the NRF52832 and the SoftDevice S132 V2.0.1:

  1. According to this thread, an infinite loop should be placed after the function call sd_power_system_off() when debugging. Did this behavior change since the NRF51822 and S130 V2.0.1? Because the function sd_power_system_off() of the S130 V2.0.1 didn't return in the emulated System OFF mode...
  2. When the nRF52832 "woke up" from the emulated OFF mode, the GPIO configurations are NOT retained as it is the case for the real OFF mode. All GPIOs are then set to input/disconnected. Is this a bug or am I doing anything wrong?

Thanks in advance!

Kind regards

edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
olba gravatar image

answered 2016-10-14 14:05:27 +0100

According to nRF51 and nRF52 specification when entering emulated system off it is recommended to add an infinite loop directly after entering System OFF. Problem here is that sd_power_system_off() will execute instructions after entering emulated system off (including returning to the application) before the application code is run. On nRF51 this leads to a hardfault.

You can check this by stopping code execution in the debugger after calling sd_power_system_off(). The ISR number (xPSR->ISR in the registers panel) will be 3, which is the HardFault_IRQn (see nrf51.h, you have to subtract 16 from the ISR number as this starts at 1 and the enum starts at -15).

On the nRF52 it does not hardfault and the function returns, which is why it seems that the two chips are acting different to emulated system off.

I will report this internally and see if we can change the sd_power_system_off() function.

For your other question this is a bug with the nRF52 and is found in the errata:

GPIO: PIN_CNF is not retained when in debug interface mode



GPIO pin configuration is reset on wakeup from System OFF.

edit flag offensive delete publish link more


Thank you very much for this detailed explanation!

Remo ( 2016-10-17 09:59:43 +0100 )editconvert to answer

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

User menu

    or sign up

Recent questions

Question Tools

1 follower


Asked: 2016-10-12 15:15:31 +0100

Seen: 535 times

Last updated: okt. 14 '16