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

RAM retention / shutdown

Module: ilumi H52 BLE module (nRF52832)
SDK: nRF5_SDK_15.2.0_9412b96
Softdevice: 132_nrf52_6.1.0_softdevice.hex
Compiler: gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (15:7-2018-q2-4)

Hello,

I'm working with ble_central/ble_app_uart_c example and want to shutdown the device to save power.

nrf_ble_scan_stop();
nrf_gpio_cfg_sense_input(9, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);
err_code = sd_power_system_off();
APP_ERROR_CHECK(err_code);

This code seems to work fine. After inserting the command "nrf_ble_scan_stop()" current consumtion dropped down to 0.5 µA. That's pretty good for our application.

But after waking up the program should continue at the point where the shutdown occured instead of starting from reset state. So I tried to insert the following line:

NRF_POWER->RAMON |= (POWER_RAMON_OFFRAM0_RAM0On << POWER_RAMON_OFFRAM0_Pos) | \
                    (POWER_RAMON_OFFRAM1_RAM1On << POWER_RAMON_OFFRAM1_Pos);

nrf_ble_scan_stop();
nrf_gpio_cfg_sense_input(9, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);

NRF_POWER->RAMON |= (POWER_RAMON_OFFRAM0_RAM0On << POWER_RAMON_OFFRAM0_Pos) | \
                    (POWER_RAMON_OFFRAM1_RAM1On << POWER_RAMON_OFFRAM1_Pos);

err_code = sd_power_system_off();
APP_ERROR_CHECK(err_code);

Unfortunately the result was a fatal error (RTT: <error> app: Fatal error). The device resets itself instantly after shutting down.

What could be wrong? Thank you in advance for your assistance.

Parents Reply
  • See chapter 8 Memory, and 18 POWER — Power supply of the Prod Spec. 

    We do not have any example or library that covers this topic in our SDKs. 

    I suggest you start by storing a single variable in a section of RAM, turn on RAM retention on that section, go to SystemOFF and wake up again, then read back the variable to verify that your data has been retained. 
    Do note that the lower part of the RAM is used by the SoftDevice and application and it should not be used to retain data.  

Children
Related