"Failed to connect to ESP32: No serial data received"
esptool reset the chip and asked it to sync, and nothing useful came back. In nearly every case the chip did not start in download mode, or the bytes never made it across the cable.
Connecting...................................... A fatal error occurred: Failed to connect to ESP32: No serial data received. For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
Older esptool versions print the same failure as Failed to connect to ESP32: Timed out waiting for packet header. A variant, Download mode successfully detected, but getting no sync reply: The serial TX path seems to be down, means the chip did enter download mode but the computer's data does not reach it.
Check, in this order
- The cable carries data. Many USB cables only charge. If the computer shows no new serial port when you plug the board in, change the cable.
- The right port, and nothing else using it: a serial monitor left open, another IDE, a 3D printer host. See the port is busy.
- The driver for the board's USB-serial chip (CP210x, CH340/CH9102 or FTDI), on Windows and macOS.
- Download mode by hand: hold BOOT, press EN, release BOOT, then upload. If that works, the board's auto-reset is the problem; Espressif recommends a 1 µF to 10 µF capacitor between EN and GND on boards that reset unreliably.
- Something on the boot or flash pins: a sensor or LED on
GPIO0,GPIO2,GPIO12orGPIO15(ESP32), or anything on the flash pinsGPIO6toGPIO11. Disconnect everything and try again. - Power: the 3.3 V supply needs 200 to 300 mA at peaks. The 3.3 V pin of a USB-serial adapter or an Arduino board is not enough.
- A lower speed:
--baud 115200, or even-b 9600to rule out the baud rate.
Download mode, and the pin that selects it
esptool can only flash a chip that has started in its ROM's download mode. The chip decides at reset, from a strapping pin:
- ESP32, ESP32-S2, ESP32-S3:
GPIO0low at reset. On the ESP32,GPIO2must also be low or left floating. - ESP32-C3, C6, H2:
GPIO9low at reset. On the ESP32-C3,GPIO8must be high at the same time.
Development boards do this for you: esptool pulses the serial chip's DTR and RTS lines, which a two-transistor circuit turns into GPIO0 and EN. Boards with the chip's built-in USB (USB-Serial/JTAG on the C3, S3, C6 and others) do it over USB without that circuit. To do it by hand: hold BOOT, press and release EN (or RST), then release BOOT, and start the upload.
Try it from the browser
To rule out the computer's setup (drivers, Python, the IDE's settings), try the free ESP32 web flasher in Chrome or Edge: it uses the same ROM protocol over WebSerial and needs nothing installed. If it cannot connect either, the problem is the board, the cable or the boot mode.
And once a device is flashed and installed somewhere, you should not need a cable again: Pinscope updates the firmware over the internet, with a rollback if the new build does not come back. OTA over the internet.
Related errors: Wrong boot mode detected · Invalid head of packet · Could not open port, the port is busy · Brownout detector was triggered. All ESP32 errors: the list. Messages from esptool's source (loader.py, 4.12 and 5.5); fixes from Espressif's esptool Troubleshooting guide and Boot Mode Selection.
More
- Remote access to an ESP32 without TLS: what it measured and what it costs
- Reaching an ESP32 web server from outside its network
- Updating ESP32 firmware over the internet, with rollback
- Guru Meditation Error: decoding the backtrace, and crashes from the field
- Remote logging: ESP_LOG without a serial cable
- Heap and stack monitoring in the field
- An ESP32 behind CGNAT, 4G or Starlink
- TLS memory usage on the ESP32, and how to reduce it
- Sharing an ESP32 sensor page with anyone, without port forwarding
- ArduinoOTA over the internet, with a rollback
- ESP32 remote access compared: port forwarding, ngrok, Cloudflare Tunnel, Tailscale
- esp_http_server slow? The 250 ms delay and the fix
- Before the first ESP32 ships: a field support checklist
- ESP32 exception decoder: a Guru Meditation backtrace to lines, in the browser