Skip to content

ESP32 header reading broken #2536

@TheGarkine

Description

@TheGarkine

I was building mcuboot (master) for ESP32(c3) and used it to load my zephyr images which were working with v2.1.0. I got the following log:

[esp32c3] [INF] *** Booting MCUboot build v2.2.0-208-g76036133 ***
[esp32c3] [INF] [boot] chip revision: v0.4
[esp32c3] [INF] [boot.esp32c3] SPI Speed : 80MHz
[esp32c3] [INF] [boot.esp32c3] SPI Mode : DIO
[esp32c3] [INF] [boot.esp32c3] SPI Flash Size : 4MB
[esp32c3] [INF] [boot] Enabling RNG early entropy source...
[esp32c3] [INF] Primary image: magic=good, swap_type=0x1, copy_done=0x3, image_ok=0x3
[esp32c3] [INF] Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
[esp32c3] [INF] Boot source: primary slot
[esp32c3] [INF] Image index: 0, Swap type: none
[esp32c3] [INF] Disabling RNG early entropy source...
[esp32c3] [INF] br_image_off = 0x20000
[esp32c3] [INF] ih_hdr_size = 0x0
[esp32c3] [INF] Loading image 0 - slot 0 from flash, area id: 1
[esp32c3] [ERR] Load header magic verification failed. Aborting

After a lot of investigation, I found out that these changes break the booting of ESP32c3 (and probably others).

Removing the call to boot_state_clear(&boot_data); fixes this.

Sadly I am new to mcuboot, and do not know what the intended way to fix this would be. In U-Boot we had a config-parameter like a "BOOTLOADER_NO_RETURN" flag that omits the cleanup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions