Skip to content

espflash does not wait between writing a sync command and reading the response #116

@stevecheckoway

Description

@stevecheckoway

I have an ESP32 connected to my computer running macOS 11.6.2. When I connect it, /dev/tty.usbserial-0001 and /dev/cu.usbserial-0001 appear. Using esptool.py, I can connect.

$ esptool.py flash_id
esptool.py v3.3-dev
Found 8 serial ports
Serial port /dev/cu.usbserial-0001
Connecting.................
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting.....
Detecting chip type... ESP32
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: [...]
Uploading stub...
Running stub...
Stub running...
Manufacturer: 54
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...

Using espflash version 1.2.0, I cannot.

$ espflash board-info
Serial port: /dev/tty.usbserial-0001
Connecting...

Unable to connect, retrying with extra delay...
Unable to connect, retrying with default delay...
Unable to connect, retrying with extra delay...
Unable to connect, retrying with default delay...
Unable to connect, retrying with extra delay...
Unable to connect, retrying with default delay...
Unable to connect, retrying with extra delay...
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

The issue is not tty vs. cu as $ esptool.py -p /dev/tty.usbserial-0001 flash_id works correctly and $espflash board-info /dev/cu.usbserial-0001 fails.

The connection failure appears to be happening in Flasher::sync(). I'm happy to provide additional information or assistance in debugging.

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