Update mcuboot with SMP

I cannot find any information on how to update mcuboot over SMP when using the immutable bootloader.

I have my NRF52840 setup with the chained bootloader: b0 -> mcuboot -> app.

Is there a way to update mcuboot via SMP (UART or BLE)?

I saw this post but nothing newer.

Parents Reply Children
  • I tested with your example and it works for updating mcuboot once like you describe.

    I suspect to update mcuboot a second time, you need to use signed_by_mcuboot_and_b0_s0_image_update.bin but I havent tried this yet.

    I tried this with my code and its not working correctly. I suspect it is because I have slot1 configured to be in external QSPI.

    So I tried your example with external QSPI for slot1 and it breaks. Seems there is an issue if you want to put slot1 in QSPI. I would like to see if we can get this resolved because I need to have slot1 in QSPI.

    Heres the code diff I tested with against your sample:

    diff --git a/bootloader_samples/nsib_mcuboot_smp/boards/nrf52840dk_nrf52840.overlay b/bootloader_samples/nsib_mcuboot_smp/boards/nrf52840dk_nrf52840.overlay
    new file mode 100644
    index 0000000..b58f8c7
    --- /dev/null
    +++ b/bootloader_samples/nsib_mcuboot_smp/boards/nrf52840dk_nrf52840.overlay
    @@ -0,0 +1,29 @@
    +
    +/ {
    +	chosen {
    +		/* required for partition manager to use external flash */
    +		nordic,pm-ext-flash = &mx25r64;
    +	};
    +};
    +
    +/delete-node/ &slot1_partition;
    +/delete-node/ &scratch_partition;
    +
    +
    +&mx25r64 {
    +
    +        partitions {
    +                compatible = "fixed-partitions";
    +                #address-cells = <1>;
    +                #size-cells = <1>;
    +
    +                slot1_partition: partition@0 {
    +                        label = "image-1";
    +                        reg = <0x00000000 0x00067000>;
    +                };
    +                scratch_partition: partition@da000 {
    +                        label = "image-scratch";
    +                        reg = <0x00070000 0x00001000>;
    +                };
    +        };
    +};
    diff --git a/bootloader_samples/nsib_mcuboot_smp/child_image/mcuboot/prj.conf b/bootloader_samples/nsib_mcuboot_smp/child_image/mcuboot/prj.conf
    index 5fda561..12bc10e 100644
    --- a/bootloader_samples/nsib_mcuboot_smp/child_image/mcuboot/prj.conf
    +++ b/bootloader_samples/nsib_mcuboot_smp/child_image/mcuboot/prj.conf
    @@ -7,4 +7,10 @@ CONFIG_MAIN_STACK_SIZE=10240
     CONFIG_LOG=y
     CONFIG_LOG_MODE_MINIMAL=y
     
    -CONFIG_FW_INFO_FIRMWARE_VERSION=5
    +CONFIG_FW_INFO_FIRMWARE_VERSION=2
    +
    +CONFIG_MULTITHREADING=y
    +CONFIG_NORDIC_QSPI_NOR=y
    +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
    +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=4
    +CONFIG_BOOT_MAX_IMG_SECTORS=256
    diff --git a/bootloader_samples/nsib_mcuboot_smp/prj.conf b/bootloader_samples/nsib_mcuboot_smp/prj.conf
    index f497585..672a8da 100644
    --- a/bootloader_samples/nsib_mcuboot_smp/prj.conf
    +++ b/bootloader_samples/nsib_mcuboot_smp/prj.conf
    @@ -10,5 +10,9 @@ CONFIG_SECURE_BOOT=y
     CONFIG_SB_SIGNING_KEY_FILE="nsib_priv.pem"
     CONFIG_BUILD_S1_VARIANT=y
     
    -CONFIG_FW_INFO_FIRMWARE_VERSION=1
    -CONFIG_MCUBOOT_IMAGE_VERSION="1.1.1"
    +CONFIG_MCUBOOT_IMAGE_VERSION="1.0.0"
    +
    +CONFIG_MULTITHREADING=y
    +CONFIG_NORDIC_QSPI_NOR=y
    +CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
    +CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=4
    

  • Hi

    I think I managed to update multiple times in a row by decreasing the "CONFIG_SB_NUM_VER_COUNTER_SLOTS" to 120. It was 240 by default.
    This change was pushed to the git repository.

    I will look at the QSPI issue next week.

    Regards,
    Sigurd Hellesvik

  • Hi

    Just checking in to say that I am still trying to make QSPI work with up-gradable MCUBoot, but no luck so far.

    Regards,
    Sigurd Hellesvik

  • Hi

    The nRF Machine Learning Application and the Matter: Door lock Sample seems to use External Flash using QSPI with the bootloader.
    I have not been able to make a simple sample from these, but you might be able to learn what you need from the.

    Regards,
    Sigurd Hellesvik

Related