Multi Image Updates on NRF5340 Zephyr

I am working on a project that uses nRF5340.

We are now looking into designing software update mechanism. As a part of this, on the app core I am planning to move slot1_partition to external flash, as we are tight on space on internal flash. Using immutable MCUBoot on APP core. 

I have setup slot1_partition on external flash successfully, with slot0_partition on internal flash.

For the net core update, I am planning to use b0n bootloader, with slot1_partition on external flash, with slot0_partition on internal flash.

My question is, how can I make MCUBoot on APP core understand the partitions on NET core?

Do I need to change NET core's slot0/slot1 to slot2/slot3?

I keep getting missing partitions errors and it looks like it is looking for slot2 partition and not finding it.

Where should I define slot2 and slot3 partitions, in static PM file? Or in the netcore dts file?

I am also trying to figure out a way to test run a software update where an update image saved in SLOT1_PARTITION(external flash) is moved into SLOT0_PARTITION.

Also, if there is an application note(or web page) that shows an example of how to modify Zephyr’s MCUBoot configs to validate and move update image from SLOT1_PARTITION to SLOT0_PARTITION, please let me know.

Any other suggestions with respect to multi-image software updates for both APP core and NET core are welcome!

Thanks,

GT

Parents
  • Hello,

    I am letting you know that I have been assigned to this case and have started looking into it. Could you tell me which version of the nRF Connect SDKs you are using here?

    You could also share the error you are getting; you may share the whole log here (use the insert tab for that). On reading your query, I think you can do this by including the partition inside the pm_static file, and editing the dts file will also make it work, but it's not a recommended method. I will get back to you on Monday with some more information regarding this.

    Kind Regards,

    Abhijith

Reply
  • Hello,

    I am letting you know that I have been assigned to this case and have started looking into it. Could you tell me which version of the nRF Connect SDKs you are using here?

    You could also share the error you are getting; you may share the whole log here (use the insert tab for that). On reading your query, I think you can do this by including the partition inside the pm_static file, and editing the dts file will also make it work, but it's not a recommended method. I will get back to you on Monday with some more information regarding this.

    Kind Regards,

    Abhijith

Children
  • nRF Connect SDK version is 2.6.1

    This is the build error:

    xyz/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h: In function '__flash_area_ids_for_slot':
    xyz/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:48:37: error: 'PM_MCUBOOT_PRIMARY_1_ID' undeclared (first use in this function); did you mean 'PM_MCUBOOT_PRIMARY_ID'?
       48 | #define FLASH_AREA_IMAGE_1_SLOTS    PM_MCUBOOT_PRIMARY_1_ID, PM_MCUBOOT_SECONDARY_1_ID
          |                                     ^~~~~~~~~~~~~~~~~~~~~~~
    xyz/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:55:29: note: in expansion of macro 'FLASH_AREA_IMAGE_1_SLOTS'
       55 |                             FLASH_AREA_IMAGE_1_SLOTS
          |                             ^~~~~~~~~~~~~~~~~~~~~~~~
    xyz/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:67:9: note: in expansion of macro 'ALL_AVAILABLE_SLOTS'
       67 |         ALL_AVAILABLE_SLOTS
          |         ^~~~~~~~~~~~~~~~~~~
    xyz/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:48:37: note: each undeclared identifier is reported only once for each function it appears in
       48 | #define FLASH_AREA_IMAGE_1_SLOTS    PM_MCUBOOT_PRIMARY_1_ID, PM_MCUBOOT_SECONDARY_1_ID
          |                                     ^~~~~~~~~~~~~~~~~~~~~~~
    xyz/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:55:29: note: in expansion of macro 'FLASH_AREA_IMAGE_1_SLOTS'
       55 |                             FLASH_AREA_IMAGE_1_SLOTS
          |                             ^~~~~~~~~~~~~~~~~~~~~~~~
    xyz/bootloader/mcuboot/boot/zephyr/include/sysflash/pm_sysflash.h:67:9: note: in expansion of macro 'ALL_AVAILABLE_SLOTS'
       67 |         ALL_AVAILABLE_SLOTS
    

    It looks like mcuboot_primary_1 is not being found even if I have it in my pm_static file.

    mcuboot_primary_1:
    address: 0x0
    size: 0x40000
    device: flash_ctrl
    region: ram_flash
    slot2_partition:
    address: 0x00000
    orig_span: &id003
    - mcuboot_primary_1
    device: flash_ctrl
    region: ram_flash
    size: 0x40000
    span: *id003

    Let me know if you need any more information.

Related