-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Labels
bugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugplatform: NXPNXPNXPpriority: lowLow impact/importance bugLow impact/importance bug
Description
Describe the bug
With default flash SPI partitions layout, flashing an application seems to erase mcuboot on mimxrt1050_evk.
Tested with Zephyr v3.7.0 and Zephyr main (39917ae).
To Reproduce
- Flash mcuboot
cd bootloader/mcuboot/boot/zephyr/
echo "CONFIG_BOOT_SIGNATURE_TYPE_NONE=y" >> prj.conf
west build -b mimxrt1050_evk@hyperflash
west flash --runner=jlink --erase==> mcuboot starts as expected:
*** Booting MCUboot v2.1.0-rc1-36-gfb2cf0ec3da3 ***
*** Using Zephyr OS build v3.7.0 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
W: Failed reading image headers; Image=0
E: Unable to find bootable image
- Flash application
cd zephyr/samples/basic/blinky/
echo "CONFIG_BOOTLOADER_MCUBOOT=y" >> prj.conf
echo "CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE=y" >> prj.conf
west build -b mimxrt1050_evk@hyperflash
west flash --runner=jlink==> nothing is printed on serial like application programming erased mcuboot.
Expected behavior
mcuboot and application start:
*** Booting MCUboot v2.1.0-rc1-36-gfb2cf0ec3da3 ***
*** Using Zephyr OS build v3.7.0 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Image index: 0, Swap type: none
I: Bootloader chainload address offset: 0x100000
I: Jumping to the first image slot
*** Booting Zephyr OS build v3.7.0 ***
LED state: OFF
LED state: ON
Additional context
I made some tests and with the following flash SPI partition change, mcuboot and application start as expected:
zephyr/boards/nxp/mimxrt1050_evk/mimxrt1050_evk_mimxrt1052_hyperflash.overlay
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 DT_SIZE_M(1)>;
};
/* The MCUBoot swap-move algorithm uses the last 14 sectors
* of the primary slot0 for swap status and move.
*/
slot0_partition: partition@100000 {
label = "image-0";
reg = <0x00100000 DT_SIZE_M(3)>;
};
slot1_partition: partition@400000 {
label = "image-1";
reg = <0x00400000 DT_SIZE_M(3)>;
};
storage_partition: partition@700000 {
label = "storage";
reg = <0x00700000 DT_SIZE_M(57)>;
};
};
I hope this is helpful.
EDIT: fix storage_partition partition size
Metadata
Metadata
Assignees
Labels
bugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugplatform: NXPNXPNXPpriority: lowLow impact/importance bugLow impact/importance bug