Several have asked about this basic situation but I have found no definitive answer.
I erased a dongle with a Segger J-link, and compiled the zephyr samples using CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n in the prj.conf file.
This tells KConfig there is no nrf bootloader, so the application gets placed at 0x00 and runs properly.
But now I need MCUboot so I added CONFIG_BOOTLOADER_MCUBOOT=y to the prj.conf file.
It appears the system ignores the fact I told it there is no nrf bootloader, because I get "region `FLASH' overflowed by 7556 bytes" because the build system thinks the NRF Bootloader is in the first 0x1000 bytes of flash given the partitions.yml file:
EMPTY_0:
address: 0xff000
end_address: 0x100000
placement:
after:
- mcuboot_secondary
region: flash_primary
size: 0x1000
app:
address: 0xd200
end_address: 0x86000
region: flash_primary
size: 0x78e00
mcuboot:
address: 0x1000
end_address: 0xd000
placement:
before:
- mcuboot_primary
region: flash_primary
size: 0xc000
mcuboot_pad:
address: 0xd000
end_address: 0xd200
placement:
align:
start: 0x1000
before:
- mcuboot_primary_app
region: flash_primary
size: 0x200
mcuboot_primary:
address: 0xd000
end_address: 0x86000
orig_span: &id001
- app
- mcuboot_pad
region: flash_primary
sharers: 0x1
size: 0x79000
span: *id001
mcuboot_primary_app:
address: 0xd200
end_address: 0x86000
orig_span: &id002
- app
region: flash_primary
size: 0x78e00
span: *id002
mcuboot_secondary:
address: 0x86000
end_address: 0xff000
placement:
after:
- mcuboot_primary
align:
start: 0x1000
align_next: 0x1000
region: flash_primary
share_size:
- mcuboot_primary
size: 0x79000
nrf5_mbr:
address: 0x0
end_address: 0x1000
placement:
after:
- start
region: flash_primary
size: 0x1000
sram_primary:
address: 0x20000000
end_address: 0x20040000
region: sram_primary
size: 0x40000
Even variations on this overlay don't seem to help:
/delete-node/ &boot_partition;
/delete-node/ &slot0_partition;
/delete-node/ &slot1_partition;
/delete-node/ &scratch_partition;
/delete-node/ &storage_partition;
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* The size of this partition ensures that MCUBoot can be built
* with an RTT console, CDC ACM support, and w/o optimizations.
*/
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x000000000 0x0000c000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000c000 0x000067000>;
};
slot1_partition: partition@73000 {
label = "image-1";
reg = <0x00073000 0x000067000>;
};
scratch_partition: partition@da000 {
label = "image-scratch";
reg = <0x000da000 0x0001e000>;
};
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};
Can you come up with a solution to getting a simple peripheral example WITH MCUboot enabled to build an run on a dongle with the NRF Bootloader erased?