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

DFU Bootloader fails to correctly allocate memory for SoftDevice update

Hello,

My team and I are experiencing a problem with our custom DFU Bootloader, which is based on the Experimental Bootloader Secure Serial example (SDK 13), running in a custom NRF52832 board. Our main app uses a single bank, and we're also using the S132 v4 SoftDevice, our custom Bootloader and Bootloader settings.

The whole flash process seems to work fine, whether we update the Application, the SoftDevice or the Bootloader itself. However, when our boards are flashed with an application using almost all the flash space allocated to the application, problems occur when attempting to update the Bootloader or the SoftDevice using our custom Bootloader.

When our app uses more than 307200 bytes, leaving only about 3 pages of unused space, the function nrf_dfu_find_cache() fails to safely allocate space for the temporary swap space required by the update process, leading to the write operations overwriting the Bootloader region that is executing the DFU requests. This causes the Bootloader itself to become corrupt and the system hangs (only recovers after a re-flash with the programmer).

We are wondering if this is a known problem with SDK 13 and if there is a solution to the problem. (As a workaround, we're currently limiting our application size in the linker so that it fails to compile if grows beyond the aforementioned size.)

Thank you for your attention to this matter, please let me know if we are required to provide more details regarding this issue, TC

Related