I have the following pm_static.yml defined for my project (nrf52840 on a custom board, NCS v1.7-branch):
mcuboot: address: 0x0 size: 0xB000 region: flash_primary mcuboot_primary: address: 0xB000 size: 0x40000 span: [mcuboot_pad, app] region: flash_primary mcuboot_pad: address: 0xB000 # MCUboot images have a 32 byte header size: 0x20 region: flash_primary app: address: 0xB020 size: 0x39fe0 region: flash_primary mcuboot_secondary: address: 0x4B000 size: 0x40000 region: flash_primary bulk_storage: address: 0x8B000 size: 0x6D000 region: flash_primary settings_storage: address: 0xf8000 size: 0x8000 region: flash_primary
west build -t partition_manager_report shows this is working as expected. west flash writes the amount of bytes I expect for my combined application and bootloader.
However, the bootloader fails to boot my application image.
The logs from mcuboot show it attempting to jump to the image:
[00:00:00.345,581] <inf> mcuboot: Starting bootloader [00:00:00.346,343] <inf> mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 [00:00:00.346,954] <inf> mcuboot: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 [00:00:00.347,503] <inf> mcuboot: Boot source: none [00:00:00.347,961] <inf> mcuboot: Swap type: none [00:00:00.393,981] <inf> mcuboot: Bootloader chainload address offset: 0xb000 [00:00:00.394,378] <inf> mcuboot: Jumping to the first image slot
They also seem to show a jump offset that doesn't account for the image header, though I'm not sure if that's to be expected.
My app works correctly with mcuboot disabled.
What am I missing?