Reputation: 127
I tried to flash an ESP32 but I didn't succeed, I tried with esptool.py and Arduino IDE. I tried to press the boot button and reset but it didn't work. Here is the error:
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
Upvotes: 11
Views: 63555
Reputation: 1
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
To solve this problem, disconnect TX0 and RX0 when uploading
Upvotes: -1
Reputation: 541
I'm on windows.
The only thing that worked for me was plugging the device to my MacOSX M1. It then successfully programs. Then I move it back to windows and it works there too now.
Installing the driver, doing a pulldown of GPIO2 to GND/3.3v didn't work for me. It appears that something inside the MCU is getting into a pad state.
Upvotes: 0
Reputation: 1
Download and install the latest CP2102 driver. This sloved the issue permenetly for me.
Upvotes: 0
Reputation: 8021
Changing by upload speed from 921600bps to 115200bps fixed it. No need to press any buttons.
Upvotes: 0
Reputation: 1
in my case buttons are new but not shorting properly as multimeter showed ..opened both scratched resoldered and all working
Upvotes: 0
Reputation: 91
If using the Arduino IDE, try lowering the upload speed (Tools/Upload Speed). Lowering mine from 921600 to 460800 did the trick.
First ensure that you are in download mode:
My development machine, a 2013 iMac is connected via USB to the USB-c port on my ESP32 Dev Module. Apparently the iMac's USB or ESP32 board's USB cannot keep up at the 921600 upload speed.
Upvotes: 9
Reputation: 31
This technique definitely working
Goto Tools > programmer, Select ISP and Upload Your Code.
if you can't see any programmer, then download 1.8.12 version.
https://www.arduino.cc/en/software/OldSoftwareReleases
Upvotes: 1
Reputation: 1
Install expressif.exe and port drivers,connect the port and flash the esp32 ,upload the code using ardiuno,solve the error
Upvotes: 0
Reputation: 4533
DISCLAIMER! May not be correct answer but may help to save time for someone.
Quick answer if you do not want read my experience: Disconnect all wires from pins and try uploading again! It may help.
I came across with the same error and could not figure it out. I first thought that something is wrong with the code, because it happened after I edited working code while figuring out where to connect what pin 😀. I also wasn't able to upload simple HelloWorld after it happened with connected wires. But then I disconnected all my wires from the board and the upload works fine.
I can not figure out the WHY factor but I think it must had been the input/data pin I was using, in my case D13. I have the DevKit with fewer pins. Maybe someone can comment why connected pins may make the error come up?
Upvotes: 9
Reputation: 127
Just download the drivers x)
CP210x: CP210x USB to UART Bridge VCP Drivers
FTDI: FTDI Virtual COM Port Drivers
Upvotes: 0
Reputation: 29
Try to do this one after the other
MY CASES(30 pin version):
Case 1: I dont know why. I was connecting the pin to a female header it doesnt work and sometimes it just work like that. look pic number 1.
Case 2: when Im holding esp32 on my hand sometimes it wont work then i put it on my table and another time it doing well.
Case 3: pressing boot button when uploading it helped sometimes, and the other time it just work like it should.
Case 4: when it connected to pcb its simply just wont work, but when disconnected boom it work like nothing ever happen. look pic number 2.
Maybe just maybe something with capacitive or something like that (just assuming because number Case 1). hope that will help you out.
Upvotes: 2
Reputation: 104
On some AliExpress-like ESP32s you have to press the boot button in order to upload your sketch.
If you are watching the Arduino IDE console ouput and Connecting ...
appears, you have to press the boot button for approximately 2 seconds until the console output changes.
Upvotes: 2
Reputation: 9
With Arduino IDE Make sure the Com port is selected under Tools menu. My experience with ESP32 is Com 5. If it is not available as an option, try changing USB ports and/or re-select Tools - Board - ESP32 dev module.
Watch the "Compiling Sketch" window. Press the "Boot" button as soon as you get the red message "Serial port Com 5" You can release the button as soon as it starts to upload. If this doesn't work,try plugging into another USB port.
The Reset button only resets the uploaded sketch to re-initialise and has nothing to do with the uploading.
Upvotes: 0
Reputation: 5081
To make your ESP32 board go into flashing/uploading mode automatically, you can connect a 10 μF electrolytic capacitor between the EN
pin and GND
. When I had the same problem, when I followed this advice, the problem was solved.
Upvotes: 3