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!