Some Questions regarding the usage of MCUboot as bootloader

Hello,

I have the task to integrate MCUboot in a project that will be deployed on a nrf5340. I've enabled MCUboot using KKonfig option `CONFIG_BOOTLOADER_MCUBOOT`. According to this documentation https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/config_and_build/multi_image.html#ug-multi-image-add-child-image-oot I should have added MCUboot also as child image to the CMake configuration. However, this leads to errors when running CMake:

    add_custom_target cannot create target "mcuboot_shared_property_target"  because another target with the same name already exists.

So I guess, this isn't required anymore in the current version of the SDK, right?

Am I'm right, that `CONFIG_SECURE_BOOT` is not an option meant for MCUboot, but would enable the "Nordic Bootloader"?

According to the MCUBoot / Zephyr documentation, I should provide `boot_partition`, `slot0_partition`, and `slot1_partition` as partitions. However, if I use this as a first version of a partition layout (pm_static.yml):

  boot_partition:
    address: 0x0
    size: 0xD000
    region: flash_primary
  slot0_partition:
    address: 0xD000
    size: 0x100000
    region: flash_primary
  slot1_partition:
    address: 0x10D000
    size: 0x100000
    region: flash_primary

I get this partitioning (make partition_manager_report):

  flash_primary (0x21c200 - 2160kB): 
+---------------------------------------------------------+
| 0x0: boot_partition (0xd000 - 52kB)                     |
| 0xd000: slot0_partition (0x100000 - 1024kB)             |
| 0x10d000: slot1_partition (0x100000 - 1024kB)           |
| 0x20d000: mcuboot (0xc000 - 48kB)                       |
| 0x219000: EMPTY_0 (0x3000 - 12kB)                       |
+---0x21c000: mcuboot_primary (0x200 - 512B)--------------+
| 0x21c000: mcuboot_pad (0x200 - 512B)                    |
+---0x21c200: mcuboot_primary_app (-0x11c200 - -1163776B)-+
| 0x21c200: app (-0x11c200 - -1163776B)                   |
+---------------------------------------------------------+

So, what are the exact names of the partitions that I have to define, to have a partition for MCUboot, the application and a firmware update?

There are some options to configure MCUBoot itself. For example `MCUBOOT_VALIDATE_PRIMARY_SLOT`, which is also mentioned in the Nordic-Zephry documentation. Where does this configurations have to be applied? Are they CMake cache variables or are they KKonfig options?

thanks in advance and best regards

Torsten

  • Hi, 

    Due to the Easter holidays in Norway, we are less staffed than usual. You can expect a delayed answer. 

    You could enable the mcoboot by adding "CONFIG_BOOTLOADER_MCUBOOT=y" in the prj.conf, CONFIG_SECURE_BOOT is for nRF Secure Immutable Bootloader as an immutable bootloader. See Secure bootloader chain and Adding a bootloader chain for more information.

    what are the exact names of the partitions that I have to define, to have a partition for MCUboot, the application and a firmware update?

    It's unnecessary to define those partitions manually. The partition manager would generate partitions.yml automatically without pm_static.yml. You could duplicate the partitions.yml under the build folder, rename it to pm_static.yml, and put it under the app for the next build. 

    There are some options to configure MCUBoot itself. For example `MCUBOOT_VALIDATE_PRIMARY_SLOT`, which is also mentioned in the Nordic-Zephry documentation. Where does this configurations have to be applied? Are they CMake cache variables or are they KKonfig options?

    You could create child_image/mcuboot.conf to set the mcuboot configs.

    Regards, 
    Amanda

  • Hi  ,

    that answers my questions already.

    Have nice Easter holidays!

    Torsten

Related