Retained Memory for nrf5340 cpu app

Hello,

We have an nrf522840 board using retained memory feature following this sample and using the NRF_RETENTION setting: 

https://github.com/zephyrproject-rtos/zephyr/tree/191d38dee89dd1e03e525ec2d24a8a1210751517/samples/boards/nordic/system_off

We are upgrading to use the nrf5340 chip and trying to adapt the code. We are setting to use RETAINED_MEM but are having trouble with retainedmemory device not being  defined. 

This is the line throwing an error: const static struct device *retained_mem_device = DEVICE_DT_GET(DT_ALIAS(retainedmemdevice));

The sample has some definitions of the device for the nrf54 boards, but none for the nrf53. 

Appreciate any pointers. We are building using the nrf5340ns.

Parents Reply Children
  • RAM retention works for me only when I am debugging, but as soon as I run the application without  the debugger it stops working.

    I added this code before enter the SYSTEM_OFF and now it all works:

        NRF_VMC_S->RAM[0].POWER = 0xFFFFFFFF;
        NRF_VMC_S->RAM[1].POWER = 0xFFFFFFFF;
        NRF_VMC_S->RAM[2].POWER = 0xFFFFFFFF;
        NRF_VMC_S->RAM[3].POWER = 0xFFFFFFFF;
        NRF_VMC_S->RAM[4].POWER = 0xFFFFFFFF;
        NRF_VMC_S->RAM[5].POWER = 0xFFFFFFFF;
        NRF_VMC_S->RAM[6].POWER = 0xFFFFFFFF;
        NRF_VMC_S->RAM[7].POWER = 0xFFFFFFFF;

Related