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

nRF52840 SDK16 S140 - How to put in RAM retention

Hi everyone,

I am working on a project where I have to enter the system into System OFF mode and RAM retention. What I actually want is to retain the value of some variables.

How could I do that in terms of software? Are there any specific functions I have to use? I also read that I have to make a no-init/zero_init section in order to ensure that the firmware does not clear the values at boot up but I don't even know what is this and how to implement it.

Could someone guide me? Or is there a similar example I could follow?

Thanks in advance

Nick

Parents Reply
  • See Memory: RAM0-9 and the sections within each RAM block. The sections correspond to the Q-F bit positions. (S[i]RETENTION (i=0..15)). F.ex. if the variable is at address 0x2002 8420 that will be RAM8, section 3. 

    You mean RAM0-8? I found that my variable is at address 0x200041E0, that means RAM2, section 0 isn't it?

    Is this correct?

    #define RAM_AHB_slave 2
    
    ret_code_t err_code;
    err_code = sd_power_ram_power_set(RAM_AHB_slave, POWER_RAM_POWER_S2RETENTION_On << POWER_RAM_POWER_S2RETENTION_Pos);
    APP_ERROR_CHECK(err_code);

Children
No Data
Related