Partition Manager Error w/ Direct XIP and MCUboot enabled

Hello,

I am looking to utilize direct xip w/ MCUboot and am observing an error from the partition manager relating to placement of the mcuboot_secondary_pad. I am able to reproduce this error w/ the zephyr hello_world sample by adding the following configurations:

prj.conf

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT=y

child_image/mcuboot.conf

CONFIG_BOOT_DIRECT_XIP=y

Running $ west build -b nrf5340dk_nrf5340_cpuapp --pristine

yields the following error:


Partition manager failed: Error when inspecting mcuboot_secondary_pad, invalid address 0x84000, expected 0x84001,
Failed to partition region flash_primary, size of region: 1048576
Partition Configuration:
mcuboot:
placement:
before:
- mcuboot_primary
size: 49152
mcuboot_pad:
placement:
align:
start: 16384
before:
- mcuboot_primary_app
size: 512
mcuboot_secondary_app:
placement:
after:
- mcuboot_secondary_pad
size: 491009
mcuboot_secondary_pad:
placement:
after:
- mcuboot_primary
align:
start: 16384
size: 512

If I comment out the alignment directive in the mcuboot_secondary_pad partition from $NCS_DIR/bootloader/mcuboot/boot/zephyr/pm.yml I am able to build successfully.

Parents Reply
  • Hello,

    Thanks for the response. I looked at this direct_xip sample and saw the only thing I was missing was having CONFIG_PM_PARTITION_SIZE_MCUBOOT=0x10000 in child_image/mcuboot.conf. Once I updated this kconfig, the hello_world sample built for me w/ direct_xip enabled. However, I still believe there is likely a bug in the partition manager script as dropping the mcuboot partition size down from 64 kB to 48 kB shouldn't cause the partition manager to attempt to locate the mcuboot_secondary_pad partition on an unaligned address of 0x84001.

    Thanks,
    Evan

Children
No Data
Related