Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RAM retention problem

Hello,

      I'm using nRF5 SDK with version 15, nRF52832 IC and softdevice s132. I need to save hold the data in the ram even in sleep mode. I'm using the below code. However it did not resolved my issue. 

 sd_power_ram_power_set(4,(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));

Parents
  • Hi,

     

    In WFE (or sd_app_evt_wait when using the softdevice) there is no need to change the RAM retention settings (assuming using reset values), as WFE will start executing based on where it previously was (just like any C function).

    However, if using SystemOFF, then a wakeup will generate a reset condition, thus must of your states are reset. When using SystemOFF, it is not enough just to set the RAM retention in sleep, but you will also need to make sure that your firmware does not clear/overwrite your data at boot up. This is normally done by making a no-init/zero_init section.

    Q1. Are you using Systemoff?

    Q2: What compiler are you using?

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    In WFE (or sd_app_evt_wait when using the softdevice) there is no need to change the RAM retention settings (assuming using reset values), as WFE will start executing based on where it previously was (just like any C function).

    However, if using SystemOFF, then a wakeup will generate a reset condition, thus must of your states are reset. When using SystemOFF, it is not enough just to set the RAM retention in sleep, but you will also need to make sure that your firmware does not clear/overwrite your data at boot up. This is normally done by making a no-init/zero_init section.

    Q1. Are you using Systemoff?

    Q2: What compiler are you using?

     

    Kind regards,

    Håkon

Children
Related