I would like to do a FOTA using bluetooth and external flash memory on nrf52840 board. I am also using sdk 2.9.1
The issue i am currently facing is I get the below when i run my program
*** Booting MCUboot v2.1.0-dev-12e5ee106034 *** *** Using nRF Connect SDK v2.9.1-60d0d6c8d42d *** *** Using Zephyr OS v3.7.99-ca954a6216c9 *** I: Starting bootloader W: Cannot upgrade: not a compatible amount of sectors D: slot0 sectors: 242, slot1 sectors: 256, usable slot0 sectors: 240 I: Bootloader chainload address offset: 0xc000
I have already looked at this link OTA device firmware update with external flash memory but i still get the same error even after implementing the recommendations in my mcuboot.conf file.
Below is my pm_static.yml file where I have created a partition for mcuboot_secondary slot of size 1MB
storage1_partition:
address: 0x00000000 # 0 KB
size: 0x00004000 # 16 KB
end_address: 0x00004000
region: external_flash
device: DT_CHOSEN(nordic_pm_ext_flash)
placement:
before: [tfm_storage, end]
storage2_partition:
address: 0x00004000 # 16 KB
size: 0x00004000 # 16 KB
end_address: 0x00008000
region: external_flash
device: DT_CHOSEN(nordic_pm_ext_flash)
placement:
before: [tfm_storage, end]
storage3_partition:
address: 0x00008000 # 32 KB
size: 0x00004000 # 16 KB
end_address: 0x0000C000
region: external_flash
device: DT_CHOSEN(nordic_pm_ext_flash)
placement:
before: [tfm_storage, end]
littlefs_partition:
address: 0x0000C000 # 48 KB
size: 0x00080000 # 512 KB
end_address: 0x0008C000
region: external_flash
device: DT_CHOSEN(nordic_pm_ext_flash)
placement:
before: [tfm_storage, end]
mcuboot_secondary:
address: 0x0008C000 # 560 KB
size: 0x00100000 # 1 MB
end_address: 0x0018C000
region: external_flash
device: DT_CHOSEN(nordic_pm_ext_flash)
placement:
before: [tfm_storage, end]
resources_partition:
address: 0x0018C000 # 1.5 MB + 32 KB = 1.56 MB
size: 0x00400000 # 4 MB
end_address: 0x0058C000
region: external_flash
device: DT_CHOSEN(nordic_pm_ext_flash)
placement:
before: [tfm_storage, end]below is my mcuboot.conf file where I set
CONFIG_MCUBOOT_LOG_LEVEL_DBG=y
#CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_MCUBOOT_DOWNGRADE_PREVENTION=y
# Enable QSPI and secondary external slot
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_FLASH=y
CONFIG_MULTITHREADING=y
CONFIG_BOOT_MAX_IMG_SECTORS=256
/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};SB_CONFIG_BOOTLOADER_MCUBOOT=y SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y SB_CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x0000C000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000C000 0x00077000>;
};
slot1_partition: partition@83000 {
label = "image-1";
reg = <0x00083000 0x00075000>;
};
/*
* The flash starting at 0x000f8000 and ending at
* 0x000fffff is reserved for use by the application.
*/
/*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};