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

nRF52840 ram_retention demo

Hello!

I'm trying to use the ram_retention in sdk 15 alpha to retain RAM in system off mode and do some power profiling.

The default code seems to retain 8 kB of RAM. copy and pasting the appended section of the code and replacing 0 with 1,2,3..7 did not increase the power consumption as expected.

What am I missing?

Thank you, Nishant

NRF_POWER->RAM[0].POWERSET = (POWER_RAM_POWER_S0POWER_On << POWER_RAM_POWER_S0POWER_Pos) | // (POWER_RAM_POWER_S1POWER_On << POWER_RAM_POWER_S1POWER_Pos) | // (POWER_RAM_POWER_S2POWER_On << POWER_RAM_POWER_S2POWER_Pos) | // (POWER_RAM_POWER_S3POWER_On << POWER_RAM_POWER_S3POWER_Pos) | // (POWER_RAM_POWER_S4POWER_On << POWER_RAM_POWER_S4POWER_Pos) | // (POWER_RAM_POWER_S5POWER_On << POWER_RAM_POWER_S5POWER_Pos) | // (POWER_RAM_POWER_S6POWER_On << POWER_RAM_POWER_S6POWER_Pos) | // (POWER_RAM_POWER_S7POWER_On << POWER_RAM_POWER_S7POWER_Pos) | // (POWER_RAM_POWER_S8POWER_On << POWER_RAM_POWER_S8POWER_Pos) | // (POWER_RAM_POWER_S9POWER_On << POWER_RAM_POWER_S9POWER_Pos) | // (POWER_RAM_POWER_S10POWER_On << POWER_RAM_POWER_S10POWER_Pos) | // (POWER_RAM_POWER_S11POWER_On << POWER_RAM_POWER_S11POWER_Pos) | // (POWER_RAM_POWER_S12POWER_On << POWER_RAM_POWER_S12POWER_Pos) | // (POWER_RAM_POWER_S13POWER_On << POWER_RAM_POWER_S13POWER_Pos) | // (POWER_RAM_POWER_S14POWER_On << POWER_RAM_POWER_S14POWER_Pos) | // (POWER_RAM_POWER_S15POWER_On << POWER_RAM_POWER_S15POWER_Pos) | // (POWER_RAM_POWER_S0RETENTION_On << POWER_RAM_POWER_S0RETENTION_Pos) | // (POWER_RAM_POWER_S1RETENTION_On << POWER_RAM_POWER_S1RETENTION_Pos) | // (POWER_RAM_POWER_S2RETENTION_On << POWER_RAM_POWER_S2RETENTION_Pos) | // (POWER_RAM_POWER_S3RETENTION_On << POWER_RAM_POWER_S3RETENTION_Pos) | // (POWER_RAM_POWER_S4RETENTION_On << POWER_RAM_POWER_S4RETENTION_Pos) | // (POWER_RAM_POWER_S5RETENTION_On << POWER_RAM_POWER_S5RETENTION_Pos) | // (POWER_RAM_POWER_S6RETENTION_On << POWER_RAM_POWER_S6RETENTION_Pos) | // (POWER_RAM_POWER_S7RETENTION_On << POWER_RAM_POWER_S7RETENTION_Pos) | // (POWER_RAM_POWER_S8RETENTION_On << POWER_RAM_POWER_S8RETENTION_Pos) | // (POWER_RAM_POWER_S9RETENTION_On << POWER_RAM_POWER_S9RETENTION_Pos) | // (POWER_RAM_POWER_S10RETENTION_On << POWER_RAM_POWER_S10RETENTION_Pos) | // (POWER_RAM_POWER_S11RETENTION_On << POWER_RAM_POWER_S11RETENTION_Pos) | // (POWER_RAM_POWER_S12RETENTION_On << POWER_RAM_POWER_S12RETENTION_Pos) | // (POWER_RAM_POWER_S13RETENTION_On << POWER_RAM_POWER_S13RETENTION_Pos) | // (POWER_RAM_POWER_S14RETENTION_On << POWER_RAM_POWER_S14RETENTION_Pos) | // (POWER_RAM_POWER_S15RETENTION_On << POWER_RAM_POWER_S15RETENTION_Pos); // }

Parents
  • Hello nishant

    I apologize for the late answer, but it took me a little while to get to the bottom of this. According to the errata for the nRF52840, here, chapter 3.20, the RAM retention is controlled by the section power bits, NOT the retention bits. This means that for the current version of the nRF52840 RAM registers will always have retention enabled, as long as they are powered (which they are by default). As long as the RAM registers are not altered on initialization, data stored in RAM should be kept through reset.

    I have tried using the POWERSET and POWERCLR registers to see if there was any difference, but from what I can find there is no way to turn off the retention in the current version, without powering down the entire RAM section.

    Best regards

    Jørn Frøysa

Reply
  • Hello nishant

    I apologize for the late answer, but it took me a little while to get to the bottom of this. According to the errata for the nRF52840, here, chapter 3.20, the RAM retention is controlled by the section power bits, NOT the retention bits. This means that for the current version of the nRF52840 RAM registers will always have retention enabled, as long as they are powered (which they are by default). As long as the RAM registers are not altered on initialization, data stored in RAM should be kept through reset.

    I have tried using the POWERSET and POWERCLR registers to see if there was any difference, but from what I can find there is no way to turn off the retention in the current version, without powering down the entire RAM section.

    Best regards

    Jørn Frøysa

Children
Related