nRF54L15 RAM retention in off state.

Hi 

I am working on nRF54L15-DK (PCA10156 0.9.2 2024.49) with chip N54L15 QFAAB0 2444AA

I am using Nordic SDK 3.0.2 and Zephyr 4.0.99

My task is to have the top 2K of the RAM as retained and survive during OFF (battery still connecrted :-) )

In device tree:

/ {
    soc {
        cpuflpr_sram: memory@2003f800 {
            compatible = "zephyr,memory-region", "mmio-sram";
            reg = <0x2003F800 DT_SIZE_K(2)>;
            #address-cells = <1>;
            #size-cells = <1>;
            ranges = <0x0 0x2003f800 DT_SIZE_K(2)>;
            zephyr,memory-region = "Retained";
        };
    };
};

In linker.cmd for both mcuboot and application contains; "Retained ( rw ) : ORIGIN = (537131008), LENGTH = (2048)"

I access the area like this:

#define RETAINED_RAM_BASE DT_REG_ADDR(DT_NODELABEL(cpuflpr_sram))
#define RETAINED_RAM_SIZE DT_REG_SIZE(DT_NODELABEL(cpuflpr_sram))

I experience that a magic value 0xBEEF0AA0  placed in that area is set correctly just before sys_poweroff() but in pre_kernel_init() value is what seems to be a random value - not 0x00000000.

SYS_INIT(pre_kernel_init, PRE_KERNEL_1, 39);

The system wakes up from off by GPIO sense.

                nrf_gpio_cfg_sense_input(pin, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);

... which works fine.

From the nRF54L15 datasheet I see that this area should be retained by default. and I have confirmed that by stopping at a breakpoint at sys_poweroff(). 

POWER[0].CONTROL = 0x000000FF

POWER[0].RET = 0xFFFFFFFF

POWER[0].RET2 = 0xFFFFFF80

What am I missing ?

Best regards

     GoodOld

 

  • Hi .... 

    Found the issue. The definition needed to be like this:

    / {
        soc {
            cpuapp_sram_ret: memory@2003f800 {
                compatible = "zephyr,memory-region", "mmio-sram";
                reg = <0x2003F800 DT_SIZE_K(2)>;
                #address-cells = <1>;
                #size-cells = <1>;
                ranges = <0x0 0x2003f800 DT_SIZE_K(2)>;
                zephyr,memory-region = "Retained";
                status = "okay";

                retained0: retained0 {
                    compatible = "zephyr,retained-ram";
                    status = "okay";
                };
            };
        };
    };

    Please do not make a ticket for this. :-) 

Related