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

RAM retention settings with SoftDevice enabled

Hello,

 

I am using nRF52832, SDK_15.3.0, S132 SoftDevice and Segger for flashing the image. I am using ‘ble_app_blinky’.

I have few variables in application. These will be keep on changing based on different conditions in application. Other than power reset, those variables to be retained both in System ON and System OFF mode.

 

1) I searched entire ble_app_blinky project but I could not find sd_power_ram_power_set(). Still RAM content retained, when device wakes from “System ON” mode.

a) Whether SoftDevice will enable these settings, so that variables are retained even in System ON mode.

b) (Or) Since by default after reset, both bits A & B are set to 1 indicating RAM section S0 & S1 are enabled by default in System OF mode.

2) Device went to System OFF mode. But content in variables are lost. As per below links

a) I want to retain entire RAM rather than ".retained_section" for different variables.

b) If entire RAM is not retained during System OFF, then what is the purpose of S0RETENTION and S1RETENTION in RAM[0].POWER register.

c) Whether blow code is good enough so that entire RAM will retained even in System OFF mode.  But still I am not able to see the retained value.

https://devzone.nordicsemi.com/f/nordic-q-a/47620/ram-retention-of-softdevice-ram-region

https://devzone.nordicsemi.com/f/nordic-q-a/36099/ram-retention-problem

    uint8_t i;
    for(i = 0; i < 8; i++) // Retain RAM 0 - RAM 7
    {
        sd_power_ram_power_set(i, (POWER_RAM_POWER_S0POWER_On << POWER_RAM_POWER_S0POWER_Pos) |
                                  (POWER_RAM_POWER_S1POWER_On << POWER_RAM_POWER_S1POWER_Pos) |
                                  (POWER_RAM_POWER_S0RETENTION_On << POWER_RAM_POWER_S0RETENTION_Pos) |
                                  (POWER_RAM_POWER_S1RETENTION_On << POWER_RAM_POWER_S1RETENTION_Pos));
    }
    
    u8SystemOFFTestCounter++;
    // Start execution.
    NRF_LOG_INFO("SystemOFF Test %d", u8SystemOFFTestCounter);

3) Even I thought to skip GPIO initialization. Since variables are not retained in RAM, I am getting code crash.

    /* Reset reason */
    uint32_t rr = log_resetreason();
    
    // During System OFF mode, no need to re-initialize GPIO pins (This will avoid Glitch on pins)
    if(rr == NRF_POWER_RESETREAS_OFF_MASK)
    {
        leds_init();
        buttons_init();
    }

Also I have gone through "ram_retention" which is without softDevice and "ble_app_pwr_profiling" example where sd_power_ram_power_set() is no where called. I am bit confused.

I have gone through lot of mails on forum. But there is not straight froward answer.

Do we need to change any Segger settings to avoid RAM initialization while wake-up from System OFF. Please take this issue on high priority.

Thanks & Regards

Vishnu Beema

Parents
  • Thank you for your confirmation.

    1) So without non_init section, there is no RAM retention even by calling sd_power_ram_power_set().

    2) My worry is, I don't know which are all required to be kept in RAM. As mentioned above when I skip leds_init() and buttons_init() I am getting ASSERT. Below is once such example when I call app_button_enable() or app_button_disable().

    ASSERT(mp_buttons);

    Thanks & Regards

    Vishnu Beema

Reply
  • Thank you for your confirmation.

    1) So without non_init section, there is no RAM retention even by calling sd_power_ram_power_set().

    2) My worry is, I don't know which are all required to be kept in RAM. As mentioned above when I skip leds_init() and buttons_init() I am getting ASSERT. Below is once such example when I call app_button_enable() or app_button_disable().

    ASSERT(mp_buttons);

    Thanks & Regards

    Vishnu Beema

Children
No Data
Related