ESP32 upload fails with “Invalid head of packet (0xC1)” despite BOOT button and driver installation

Hi! I’m having trouble uploading code to my ESP32 and I would appreciate some help diagnosing it before buying more components.

Board: ESP32 development board
Operating system: Windows
IDE: Arduino IDE
Detected port: COM3
USB driver: CP210x driver installed

The error is:

Failed to connect to ESP32: Invalid head of packet (0xC1)

What I have already tried:

  • Confirmed that the ESP32 is detected on COM3.
  • Installed the CP210x Windows driver.
  • Held the BOOT button while starting the upload.
  • Tried the BOOT and EN buttons.
  • Reduced the upload speed.
  • Tried another USB cable.
  • Disconnected the external circuit and attempted the upload using only USB.

At one point I was able to upload code successfully and received:

Hard resetting via RTS pin...

However, the connection/upload problem appeared again, so it seems to be intermittent.

The board powers on and its red LED lights up. This ESP32 will eventually be used for a Bluetooth Low Energy project that activates a small vibration motor, but I’m currently trying to program and test the ESP32 separately.

Could this be caused by boot mode, serial communication, the USB cable, the USB-to-serial chip, power instability, or a damaged board?

What diagnostic test should I perform next before replacing the ESP32?

Thank you!

do you have any peripherals attached to the strapping pins? (see the datasheet of your MCU for which those pins are)

if yes, it could be that the strapping pins are pulled to the wrong state during boot.

You posted on the Nano ESP32, but I notice you call your board an ESP32. They are very different. If it is a Nano ESP32, I would check the hardware docs for any special instructions on uploading. Sorry, I don't remember any more.