MCUBoot on nrf5340: only upgrade firmware on application core

Hi Support team,

I encountered some flash overflow errors when I enabled the MCUboot on nrf5340. Could I ask several questions?

My situations and requirements:
1. My project is based on nrf5340 and NCS V2.5.2, the network core was only used for BLE controller (runs hci_rpmsg child image).
2. Before enabling MCUboot, the flash consumption is below:

           

3. I only need to upgrade the firmware on the application core because I use BLE for system configuration, and there is no need to upgrade the network core. The upgrade mode should be "swap" to support firmware rollback when the DFU fails.

Considering my current bin on the application core is 313.9KB, I believe the primary flash (1MB) can meet my requirement. 

When I set partitions in pm_static.yml like below


There are some errors occurred:
1. mcuboot flash ordata overflow, if I change mcuboot size to 64K, the error disappears. But I prefer to allocate 48K for
mcuboot and need to minimize MCUboot configuration.

2. I only want to upgrade the application core, but there was some information about the network core in the building log:

Could you help me with the below questions:
1. For my current application bin size 313.9 KB, is the primary flash enough for the solution of MCUboot swap upgrade only for the application core?

2. Could you help me revise a MCUboot configuration that can meet my requirements and consume less than 48KB partition?
My current MCUboot configuration is below:


Any guidance is appreciated, thank you very much.


Best regards,
Yanpeng Wu

  • Should I create a file child_image/mcuboot.conf for MCUboot?

  • When I deleted the code in pm_static.yml, and only set 

    CONFIG_BOOTLOADER_MCUBOOT=y in proj.conf (follow the sample C:\ncs\v2.5.2\bootloader\mcuboot\samples\zephyr\hello-world\), the error still occurred:



  • Hi,

    1. For my current application bin size 313.9 KB, is the primary flash enough for the solution of MCUboot swap upgrade only for the application core?

    It should be big enough if you only intend to do what is called "non-simultaneous" dfu of the application core only. You will be left with

    1MB - MCUBoot - 2x application - (overheadspace + settings + other custom partitions + swap partition) -> 48k - 2x400k (what you defined it as in the partition map) - ~50k ~<= 1024k, i.e it should fit. 

    2. Could you help me revise a MCUboot configuration that can meet my requirements and consume less than 48KB partition?
    My current MCUboot configuration is below:

    This will depend a bit Here's a couple of additions to your bootloader configurations that can help you reduce the size. 

    Yes, you need to add a child_image/mcuboot.conf and /mcuboot.overlay for MCUBoot.

    For instance here's a sample of a minimal MCUboot with USB DFU support, you can add the following to <yourproject>/child_image/mcuboot/prj.conf you can add 



    In <yourproject>/child_image/mcuboot/mcuboot.overlay, you can add the following (if you're using USB to do dfu. If not, just remove those items regarding CDC_ACM)

    Let me know if these items helps you reduce the size. You can also have a look at https://docs.nordicsemi.com/bundle/ncs-2.5.2/page/nrf/test_and_optimize.html and https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-9-bootloaders-and-dfu-fota/, i.e the relevant lessons for 2.5.2 

    Kind regards,
    Andreas

  • Hi Andreas,

    Thank you for your reply. Yes, my requirement is to use a "non-simultaneous" DFU, but I only need the first step to upgrade application firmware. The DFU will be over BLE at this moment; over cellular will be considered in the future because there is a modem on our target.

    I will follow your guidance to minimize the size of the MCUboot image. I can compile successfully now, but the MCUBoot image is very large, and I have disabled the log.

    In my current build result, there are b0n_subimage and net_core_app_update.bin in the dfu_application.zip. Could you help give guidance for disabling the netcore upgrade in "non-simultaneous" dfu (I don't have external flash for DFU) firstly, then I will based on it to minimize the size of MCUboot?

    Thank you very much. 

    Best regards,
    Yanpeng Wu

  • Yanpengwu said:
    Could you help give guidance for disabling the netcore upgrade in "non-simultaneous" dfu (I don't have external flash for DFU) firstly, then I will based on it to minimize the size of MCUboot?

    https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-9-bootloaders-and-dfu-fota/topic/dfu-for-the-nrf5340/ and https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-9-bootloaders-and-dfu-fota/topic/exercise-5-fota-over-bluetooth-low-energy/ should go through how to implement non-simultaneous DFU over BLE for only the application core! :) FYI https://academy.nordicsemi.com/simultaneous-updates-for-both-cores-of-the-nrf5340/ goes through simultaneous DFU (with external flash), so you can compare them and see the difference.

    This should result in something like the following sample (nonsimultaneous DFU of both cores without internal flash)

    6_nrf5340_non_sim.zip

    Let me know if you're able to get it up and running using this sample!
    Kind regards,
    Andreas

1 2 3