What the messages mean
- "Failed to connect to Espressif device": esptool can't talk to the chip in download mode at all.
- "Wrong boot mode detected": communication works (the ROM boot log is seen), but the chip is not being reset into download mode automatically.
Fix, in order
- Right port, not busy. Close the serial monitor and any other program holding the port. On Linux, check permissions for the serial device.
- Cable and driver. Use a known data-capable USB cable (many are charge-only) and install the driver for the board's USB-serial chip if your OS needs one.
- Power. A weak supply can prevent a clean boot into download mode. Try another port, a powered hub or a shorter cable.
- Manual download mode. Hold BOOT (GPIO0), press and release EN/RESET, then release BOOT and start the upload. If this works, the board's auto-reset circuit or its timing is the problem.
- Lower baud rate. Try a much slower upload speed to rule out signal problems (e.g.
esptool -b 9600 ..., or a lower Upload Speed in the Arduino IDE). - Strapping pins. Check that external circuits don't pull GPIO0/2/12/15 to the wrong level at reset (see the item on pins to avoid).
Native USB chips (ESP32-S3, ESP32-C3, ...)
Boards that use the chip's built-in USB Serial/JTAG instead of a separate USB-serial chip behave differently:
- The port disappears while the chip is in deep sleep; the serial monitor disconnects. Wake it or put it into download mode to flash.
- If the firmware reconfigures the USB pins or disables the USB peripheral, the device vanishes from the host until you enter download mode manually (hold BOOT, reset).
- If no terminal is connected, console output can stall briefly when the USB buffer fills. Don't rely on the USB console for timing-critical logs.