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

Problem with emulated System OFF mode with NRF52

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

  • 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

    ...

    Symptoms

    GPIO pin configuration is reset on wakeup from System OFF.

  • Thank you very much for this detailed explanation!

Related