Partition Manager and device tree partitions

I needed to add my own partition to the primary flash, and was able to do so successfully by adding a section to the device tree partitions.

However, when adding MCUBoot, the build would fail. I found that this was due to the build invoking a multi-image build and thus using Partition Manager.

I'd like this partition to remain at a static address, so I was able to get things going by creating a pm_static.yml in my project with the appropriate address and size.

I'm now cleaning things up, and if I remove the partitions and "zephyr,code-partition = &slot0_partition;" from the dts, the build fails since it cannot find a boot partition.

I see this in the build log:

devicetree error: /chosen: undefined node label 'boot_partition'

Do I have to define both partitions in the dts as well as in partition manager?

Thanks!

Parents
  • Hi,

    When you build a multi-image application, the partitions in devicetree should be ignored.
    However, in the case of MCUboot, the MCUboot child image is built before Partition Manager runs, and MCUboot is using boot_partition in the file bootloader/mcuboot/boot/zephyr/dts.overlay.

    If interested, you can add printing to the Partition Manager script, nrf/scripts/partition_manager.py, to see when it runs during the build process (for testing/debugging purposes). As an example, I added the following right before PartitionError:

    print("------------------")
    print("Partition Manager")
    print("------------------")

    After adding this and building, I can see that the Partition Manager script only runs after the MCUboot child image is done building (which you can see from === child image mcuboot - end ===).

    Best regards,
    Marte

Reply
  • Hi,

    When you build a multi-image application, the partitions in devicetree should be ignored.
    However, in the case of MCUboot, the MCUboot child image is built before Partition Manager runs, and MCUboot is using boot_partition in the file bootloader/mcuboot/boot/zephyr/dts.overlay.

    If interested, you can add printing to the Partition Manager script, nrf/scripts/partition_manager.py, to see when it runs during the build process (for testing/debugging purposes). As an example, I added the following right before PartitionError:

    print("------------------")
    print("Partition Manager")
    print("------------------")

    After adding this and building, I can see that the Partition Manager script only runs after the MCUboot child image is done building (which you can see from === child image mcuboot - end ===).

    Best regards,
    Marte

Children
Related