Skip to content

Stub flasher fails to start on FTDI FT231X / macOS in 5.3.0+ ("Invalid head of packet" / "no response") — 5.3.dev3 works (ESPTOOL-1365) #1179

Description

@andreyvoronko

Operating System

macOS (Darwin 25.5, x86_64)

Esptool Version

5.3.0+

Python Version

Python 3.14

Full Esptool Command Line that Was Run

esptool --chip esp32 -p /dev/cu.usbserial-DP04XHM7 -b 3000000 flash-id

Esptool Output

esptool v5.3.1
Serial port /dev/cu.usbserial-DP04XHM7:
Connecting....
Connected to ESP32 on /dev/cu.usbserial-DP04XHM7:
Chip type:          ESP32-PICO-V3-02 (revision v3.1)
Features:           Wi-Fi, BT, Dual Core + LP Core, 240MHz, Embedded Flash, Embedded PSRAM, Vref calibration in eFuse, Coding Scheme None
Crystal frequency:  40MHz
MAC:                14:2b:2f:ae:2b:04

Uploading stub flasher...
Running stub flasher...

A fatal error occurred: Failed to start stub flasher. There was no response.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html

What is the Expected Behaviour?

Description

On macOS with an FTDI FT231XQ USB-UART bridge, released esptool versions fail
right after "Running stub flasher..." - the stub never answers its greeting.
The error message differs between releases, but the failing stage is the same
(stub start handshake, before the baud change happens):

  • v5.3.0: A fatal error occurred: Invalid head of packet (0xNN): Possible serial noise or corruption.
  • v5.3.1 (current latest): A fatal error occurred: Failed to start stub flasher. There was no response.
  • v5.3.dev3: works - stub starts, baud switches to 3000000, command completes (control run below)

Connecting and uploading the stub always succeed. --no-stub at 115200 works fine
on the released versions.

Control run

Same host, same port, same cable, same board, run within the same minute -
esptool==5.3.dev3 works 100% reliably, repeatedly:

$ esptool.py --chip esp32 -p /dev/cu.usbserial-DP04XHM7 -b 3000000 flash-id
[...]
Stub flasher running.
Changing baud rate to 3000000...
Changed.

Flash Memory Information:

Manufacturer: 20
Device: 4017
Detected flash size: 8MB
Flash voltage set by eFuse: 3.3V

Hard resetting via RTS pin...

Note the stub answers at the initial 115200 baud here - so the regression in the
released versions breaks the stub-start handshake itself, not the switch to 3 Mbaud.

Additional context

The symptom class resembles #1106 (ESPTOOL-1109), which was fixed in 2025 by
draining stale serial data before sync - but this reproduces on releases that
already contain that fix, and on an FTDI bridge rather than CP2102. Something in
the 5.3.dev3 -> 5.3.0 release changes broke the stub-start handshake for this
bridge/OS combination.

More Information

No response

Other Steps to Reproduce

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions