multi image example with the nRF5340 DK

I'm trying to get multi image to work. I'm using the nRF SDK 2.3.0 with Zephyr. I tried following the instructions here:

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/working_with_nrf/nrf53/nrf5340.html#simultaneous-multi-image-dfu

but it is unclear to me how and where to change partition table. I tried different combinations with the partition names and labels, but no luck.

So my goal is now to get one of the sample applications to use multi image first, then I can see what I have to do in my application. I tried "nrf/applications/machine_learning", because it says multi image is already working for it. But when trying to compile with "west build -b nrf5340dk_nrf5340_cpuapp", I get this error:

...bootloader/mcuboot/boot/zephyr/boot_serial_extensions.c:9:10: fatal error: zephyr/mgmt/mcu
mgr/zephyr_groups.h: No such file or directory
   9 | #include <zephyr/mgmt/mcumgr/zephyr_groups.h>
     |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

But it is a pretty big application anyway, so I tried the nrf/samples/bluetooth/peripheral_lbs example, which is also mentioned. Out of the box, it doesn't create a zip file for multi image update. I tried to add the following in prj.conf:

CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_PCD_APP=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2
CONFIG_NRF53_MULTI_IMAGE_UPDATE=y
but this results in error messages that BOOT_UPGRADE_ONLY and NRF53_MULTI_IMAGE_UPDATE is undefined.
So how do I change the prj.conf file of the peripheral_lbs to use multi image, and where and how do I specify the partitions for it? My goal is to use only 2 partitions for the internal flash: mcuboot and the first application image. The update and scratch partitions should be on the external QSPI. I also want to update both images, the network core and application core, OTA with nRF Connect.
Parents Reply Children
  • Did you remember to change something in the application before testing the DFU?

    I have struggled some to update the sample to v2.3.0 myself.

    But I got something working now.
    The sample likely have too many configurations enabled, but it works for me.
    I suggest that you test with this sample, and then go from there:

    mcuboot_smp_ble_simultaneous_2_3_0.zip

    Regards,
    Sigurd Hellesvik

  • Thanks, this sample app worked! The application can now be up to 975 kB, says the partition report:

     external_flash (0x800000 - 8192kB):  
    +------------------------------------------------+
    | 0x0: mcuboot_secondary (0xf4000 - 976kB)       |
    | 0xf4000: mcuboot_secondary_1 (0x40000 - 256kB) |
    | 0x134000: external_flash (0x6cc000 - 6960kB)   |
    +------------------------------------------------+

     flash_primary (0x100000 - 1024kB):  
    +-------------------------------------------------+
    | 0x0: mcuboot (0xc000 - 48kB)                    |
    +---0xc000: mcuboot_primary (0xf4000 - 976kB)-----+
    | 0xc000: mcuboot_pad (0x200 - 512B)              |
    +---0xc200: mcuboot_primary_app (0xf3e00 - 975kB)-+
    | 0xc200: app (0xf3e00 - 975kB)                   |
    +-------------------------------------------------+

     otp (0x2fc - 764B):  
    +------------------------------+
    | 0xff8100: otp (0x2fc - 764B) |
    +------------------------------+

     ram_flash (0x40000 - 256kB):  
    +------------------------------------------+
    | 0x0: mcuboot_primary_1 (0x40000 - 256kB) |
    | 0x40000: ram_flash (0x0 - 0B)            |
    +------------------------------------------+

     sram_primary (0x80000 - 512kB):  
    +-----------------------------------------------+
    | 0x20000000: pcd_sram (0x2000 - 8kB)           |
    | 0x20002000: sram_primary (0x6e000 - 440kB)    |
    | 0x20070000: rpmsg_nrf53_sram (0x10000 - 64kB) |
    +-----------------------------------------------+

    CPUNET flash_primary (0x40000 - 256kB):  
    +--------------------------------------------+
    +---0x1000000: b0n_container (0x8800 - 34kB)-+
    | 0x1000000: b0n (0x8580 - 33kB)             |
    | 0x1008580: provision (0x280 - 640B)        |
    +---0x1008800: app (0x37800 - 222kB)---------+
    | 0x1008800: hci_rpmsg (0x37800 - 222kB)     |
    +--------------------------------------------+

    CPUNET sram_primary (0x10000 - 64kB):  
    +-------------------------------------------+
    | 0x21000000: sram_primary (0x10000 - 64kB) |
    +-------------------------------------------+

    Will try to use the same settings now for my application.

Related