Skip to content

espflash write-bin not compatible with Secure Download mode #726

Open
@ivmarkov

Description

Once Secure Download mode is enabled on the chip, no matter what I do I can't force the chip into writing a binary image with espflash.

Some commands I tried:

espflash write-bin -b no-reset-no-sync --chip esp32s3 0x10000 factory.bin
espflash write-bin -b no-reset-no-sync --chip esp32s3 0x10000 factory.bin
espflash write-bin -b no-sync --chip esp32s3 0x10000 factory.bin
espflash write-bin -b no-reset --chip esp32s3 0x10000 factory.bin
espflash write-bin -b usb-reset --chip esp32s3 0x10000 factory.bin

These fail either with:

Error: espflash::connection_failed

  × Error while connecting to device
  ╰─▶ Failed to connect to the device
  help: Ensure that the device is connected and the reset and boot pins are not being held down

or with:

Error: espflash::timeout

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

This ^^^ failure mode is interesting, because it seems espflash is capable of setting the chip in download mode after all (with some reset sequences), but then (I'm speculating) it tries to read (some?) register, which might not be supported in secure DL mode.

=========

esptool

In contrast, esptool (a) is capable to detect that the chip is in Security Download mode (try esptools tool get_security_info) and (b) capable of writing to the flash (albeit with the default baud rate):

esptools tool write_flash 0x10000 factory.bin --force

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status

      Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions