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

ram retention nrf52

Hello,

I've taken the example from the SDK 12.0.0 for RAM retention. I've added additional NRF_LOG statements to check if the RAM retention is happening. I do not have the softdevice enabled for my application. But it is not working.

See the main.c

At line number 184, I see that the value RAM_MEMORY_TEST_WORD is stored at RAM address RAM_MEMORY_TEST_ADDRESS. So after performing system off and then again wakeup using button 1, at line number 117, I expect that the value at address RAM_MEMORY_TEST_ADDRESS is displayed in the log. But this is not happening.

I have gone through the post here which talks about taking care of data being zeroed at startup. But even then, it did not work. I'm also attaching the linker file also here Example_App_gcc_nrf52.ld

I also tried with defining the variables using the following code hoping that this variable value will be retained at systemoff and at systemon. But it is not.

static uint8_t VarName __attribute__ ((section(".noinit")));

I also tried to make the changes based on the errata finding documented here in section 3.31. But even that did not help.

Could anyone of you please help? My requirement is to enable RAM retention for a section of memory without using softdevice.

Thanks in advance.

  • Hi Aryan,

    I've taken the example of RAM retention from SDK 12.0.0. I just added some NRF_LOG statements to check if I can see after system wakeup, if we have the right values in pointer p_ram_test. I was doing this using eclipse platform. There I had the NRF logging on serial port enabled. With this, it was not working.

    But upon your request for the project, I ran the keil project from "..\nRF5_SDK_12.0.0_12f24da\examples\peripheral\ram_retention\pca10040\blank\arm5_no_packs\ram_retention_pca10040.uvprojx" using the same main.c which I had already attached previously. But for some reason, when I try to enable NRF logging from Keil project, I get errors.

    Could you please use the main.c file which I've attached here and then try the same on the existing keil project with NRF logging enabled? If you see that the values are ok, then I know that there is something wrong in my eclipse settings. The nRF hardware which I've is nRF52832.

    Thanks in advance.

  • Sorry for the late response ManishK. I just tried your main.c and yes there are compilation errors because the peripheral examples are not constructed for logging. You can fix this by comparing the sdk_config-h file from example that has logging like sdk\examples\ble_peripheral. A lot of macros are missing in the sdk_config.h file in the ram_retention example.

    you also need to add files like nrf_log_frontend.c and other dependencies to the project.

Related