Skip to content

espflash is not compatible with Secure Download mode #740

@ivmarkov

Description

@ivmarkov

Once Secure Download mode had been enabled on the MCU (by burning the relevant eFUSE bits), espflash is unable to flash a binary (or ELF) image anymore.

Note that this is not related to the stub loader, because I'm passing the --no-stub flag:

ivan@ivan-laptop:~$ espflash flash --no-stub --chip esp32s3 --flash-size 16mb ./my-firmware 
[2025-02-03T12:35:14Z INFO ] Serial port: '/dev/ttyUSB0'
[2025-02-03T12:35:14Z INFO ] Connecting...
Error: espflash::timeout

  × Error while connecting to device
  ╰─▶ Timeout while running ReadReg command

I've also tried various combinations of --before (and --after) reset sequences, but none of those did work.

Note that esptool is capable of flashing even when the chip is in a Secure Download mode.
The command to do so is something like:

esptools tool --chip esp32s3 --no-stub write_flash 0x10000 ./my-firmware.bin --flash_size 16mb --force 

... where the --force parameter does all the magic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions