Secure storage of variables in no-init RAM section

Hi,

I've set-up a no-init section in the RAM of my nrf52833 and want to store data in it, which I can read after reboot of the device. I configured my application and bootloader project with the same adress space. It works as expected but I want to know if the address space is used by the softdevice or other components and could be overwritten or deleted? Or is the content of the RAM section untouched until I changed something?

Best regards,

Christian

Parents
  • Hi Christian,

    As you write SoftDevice I assume you are using the nRF5 SDK with the old SoftDevices? If so, the SoftDevice use the first part of the RAM (see Adjustment of RAM and Flash memory for details), and will never touch anything in the application region. So in that regard the content of the RAM is safe during resets when configured as no-init.

    There is another issue however, which is that the content of the RAM is not guaranteed during most resets (see the Reset behavior table in the product specification). The RAM is not explicitly cleared during resets, and in most cases, most of the content will be intact. But you are not guaranteed that it is the case, so you should add a checksum to the data so that you can verify that it is intact, and you should write firmware that properly handels the cases where it is not.

    Einar

Reply
  • Hi Christian,

    As you write SoftDevice I assume you are using the nRF5 SDK with the old SoftDevices? If so, the SoftDevice use the first part of the RAM (see Adjustment of RAM and Flash memory for details), and will never touch anything in the application region. So in that regard the content of the RAM is safe during resets when configured as no-init.

    There is another issue however, which is that the content of the RAM is not guaranteed during most resets (see the Reset behavior table in the product specification). The RAM is not explicitly cleared during resets, and in most cases, most of the content will be intact. But you are not guaranteed that it is the case, so you should add a checksum to the data so that you can verify that it is intact, and you should write firmware that properly handels the cases where it is not.

    Einar

Children
Related