System-Off Example with Ram retention - power off ram

Hello,
I want to disable parts of my RAM to save power. I implemented this in my project based on the System_Off ram retention example. I'm now not sure if RAM retention is the right approach for me since debugging still has RAM power on.
How do I check these registers or switch off the RAM areas?

nRF connect sdk 2.3.0
nRF 52840

  • Hi

    In system OFF, there is no RAM retention as long as CONFIG_APP_RETENTION is set to n in your project configuration. What exactly are you planning on doing in your application? Do you need RAM retention in your application at all?

    Best regards,

    Simon

  • Hello Simon,
    Sorry for the imprecise question.
    My application should collect sensor-data in an interval of 2 seconds and consume as little energy as possible in between. The sleep mode must therefore be a System_ON mode in order to access the RTC. An external crystal has already been used to reduce power consumption.
    The RAM size used is currently approx. 33KByte. My current state is that POWER_ON_RETENTION_ON should be applied to blocks 4-8. I currently do this as follows (here as an example for block 8):

    	nrf_power_rampower_mask_off(NRF_POWER, 8, (POWER_RAM_POWER_S0POWER_On << POWER_RAM_POWER_S0POWER_Pos) |
          (POWER_RAM_POWER_S1POWER_On << POWER_RAM_POWER_S1POWER_Pos) |
          (POWER_RAM_POWER_S0RETENTION_Off << POWER_RAM_POWER_S0RETENTION_Pos) |
          (POWER_RAM_POWER_S1RETENTION_Off << POWER_RAM_POWER_S1RETENTION_Pos));

    Am I understanding and applying this correctly, or is there a better way?

    Best regards, 
    Jonas 

  • Hi Jonas

    This looks fine to me at a glance at least, and it's entirely up to you how many blocks you want to have retention on. We have multiple cases on DevZone already explaining how to implement RAM retention, so please check out one of those cases if you run into trouble. Due to the summer vacation period here in Norway we're currently short on staff so delayed replies must be expected I'm afraid.

    Best regards,

    Simon

  •  the link you provided does not work anymore. Can you please give new link?


Related