Skip to content

Failed to connect to ESP32: Timed out waiting for packet header

Short answer: the flasher reached the serial port but the ESP32 never entered download (bootloader) mode, so it sent nothing back. On most boards you fix it by holding the BOOT button while flashing starts (release it once you see progress), and by using a USB data cable, not a charge-only one. Boards without auto-reset: hold BOOT, tap RESET, then release BOOT.

The full message is:

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

What it means

esptool opened the serial port and tried to sync with the ESP32's ROM bootloader, but received no valid response before the timeout. It's almost always a download-mode, cable, driver, or power problem — not a dead board.

Fixes, in order

  1. Put the board in download mode. Hold BOOT (some boards label it FLASH or IO0), then start flashing; release BOOT once progress appears. Boards without auto-reset (many ESP32-S2/-S3 native-USB boards): hold BOOT, tap RESET/EN while holding, then release BOOT. Details: Wrong boot mode / download mode.
  2. Use a USB data cable. Charge-only cables have no data lines, so the board won't sync (and the port may not appear). Swap the cable and plug directly into the computer, not through a hub.
  3. Install the USB-serial driver if your OS never shows the port — CP2102, CH340, or CH9102 depending on the board.
  4. Remove anything on IO0 / 3V3. A wired peripheral can hold the chip out of download mode — disconnect it. On the command line, esptool suggests testing with -b 9600 to rule out a baud-rate issue.
  5. Check power. A weak USB port or long cable can brown the board out mid-sync — use a short cable or a powered hub.

If it keeps happening on a bare module, a 10 µF capacitor between EN and GND stabilises the auto-reset (a well-known ESP32 fix; 1–100 µF also reported to work).

Sources

Checked 2026-07.

Released under the MIT License.