Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

[nrf52832] How to update retention memory configuration through DFU?

When the system is working normally, we will transmit logs and other data from the local to the peer through rf communication. 

However, when the system suddenly goes to sleep or restarts due to an abnormal error, the logs will not be transmitted to the peer end in time, and this part of the logs will be lost.

Therefore, we want to save the logs by reserving memory, and transmit this part of the logs to the peer after the system restarts again.

In fact, this part of the function has been implemented and can work normally (use nrfgo through jlink connection). Refer to the following configuration:

devzone.nordicsemi.com/.../152338

But the problem is that if the new reserved memory configuration is upgraded through dfu, it will not take effect, and this part of the memory is still not reserved.

So my question is, how to update retention memory configuration through DFU.

  • By the way, we have a bootloader, if possible, please tell me how to configure this part.

  • Hi,

    I'll have to consult with a colleague on this Ram retention issue. Meanwhile, have you considered backing up your logs to some flash partition (non-volatile storage) before performing a DFU, and retrieving it afterwards?

    Best regards,

    Raoul

  • Hi,

    Thank you for your reply. I don't know much about it, I just think that flash has a limit on the number of erasing and writing, so I didn't choose this way. In addition, if the power is turned off abnormally during the process of saving logs, will there be problems?

    If there is a solution to save the log in flash, I can try it.

    Thanks.

  • Hi, regarding the RAM retention:

    My colleague tells me that the startup script of the bootloader (which places data to designated places in RAM) is probably overwriting the .noinit section of your application. So according to him, the only thing you have to do is to define the same address range as .noinit in the bootloader, as you did in your application. Then the data won't be initialized to 0 during startup of either the application or the bootloader.

    You can take a look at the generated .map files to verify that the same ranges are defined as .noinit.

    I assume you are using Keil, since you linked to that previous case on RAM retention.

    Best regards,

    Raoul

  • Hi,

    Ok, thank you, yes, I use keil, so back to this question, can I update the memory configuration by using dfu (such as adding a noinit area)?

    In fact, I added a noinit area through the example of the above url link. After compiling the upgrade package, and then using dfu to upgrade, I found that the relevant memory area has not been reserved.

    (I don't know if I am missing the necessary configuration, or if the modification of the memory configuration cannot take effect through the dfu upgrade.)

    In addition, you mentioned saving logs to flash, is there any relevant information? I want to find out if it can meet my needs.

    Thanks.

Related