Skip to content

mcuboot+application don't start on mimxrt1050_evk #80284

@blemouzy

Description

@blemouzy

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

  1. 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
  1. 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 bugplatform: NXPNXPpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions