Flash/RAM overflow on example project for NRF52DK_NRF52805 / NCS

Hello,

I had previously successfully merged, built, and tested the NCS examples for Peripheral LBS and an ADC example on an NRF52DK emulating an NRF52805. I attempted to add DFU support by following the (unfortunate outdated since the prj.conf options don't all exist anymore) instructions here ( Add DFU support to your application) with some help from another Q&A post to get the bootloader building, but now it says I'm overflowing flash by 89K and RAM by 9K, just by adding DFU.

I started from prj_minimal.conf, only enabling ADC, Serial logging out, and the BT options necessary to build the LBS example, and then the DFU addition (full file attached below).

At the core, all I'm trying to do is collect ADC data, support a few BLE commands, and OTA DFU. I'd be surprised to learn the flash and RAM of a 52805 could not support that, but perhaps that is the case. I had to enable a few other BT features for it to build with the bootloader as well according to the build output errors I was getting. Am I asking for too much from the available memory or is there something I'm missing in the conf file that would cut the size way down?

Thank you!

  • Hi,

    The short answer is yes, you're asking for too many features for the nRF5205.

    The longer answer is that all of these features will, as you know, increase the ROM/RAM usage of your application image. In addition, if you intend to do dual bank DFU, which is normal for OTA DFU through BLE, you will effectively need to be able to fit 2x your application within your devices flash range since you need an application slot (mcuboot_primary application slot / slot0) to run your application from, and a secondary slot (mcuboot_secondary application slot / slot 1) to hold the update image.

    This unofficial repository created by a colleague of mine explains this and refers to our official documentation while doing so https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples 

    As I see it you have the following options

    1. Upgrade to a device with more flash
    2. Add an external flash device to store the secondary mcuboot slot
    3. Remove features. A general rule of thumb is that the application image needs to be within the total available flash on the DK - MCUboot size - 2x application size - headers, trailers and swap slot
    4. Use single bank serial recovery instead (do note that this will remove any fallback features as it will overwrite your application directly to the primary application slot). 

    There are some optimization to be done for your application w.r.t RAM and ROM, but I unfortunately don't think it will get you near what you need if you want dual bank BLE DFU

    Kind regards,
    Andreas

  • Thanks for the sanity check! Saved me a lot of time Slight smile

Related