Learn how to fix the Fatal Error Occurred: “Failed to connect to ESP32: Timed out waiting for packet header” error when trying to upload new code to your ESP32 board once for all.
Why are you getting this error?
Some ESP32 development boards (read Best ESP32 boards) don’t go into flashing/uploading mode automatically when uploading a new code.
This means that when you try to upload a new sketch to your ESP32, the Arduino IDE fails to connect to your board, and you get the following error message:
Holding the BOOT/FLASH button
One of the ways to solve this is holding-down the “BOOT/FLASH” button in your ESP32 board while uploading a new sketch at the same time. But having to worry about this every time you want to upload new code can be tedious, specially when you’re testing and debugging your code. There is a way to fix this once for all – no need to hold down the “BOOT/FLASH” button anymore.
How to fix the Error?
To make your ESP32 board go into flashing/uploading mode automatically, you can connect a 10 uF electrolytic capacitor between the EN pin and GND.
You may want to test this setup first on a breadboard to make sure it works for your ESP32 development board.
Note: electrolytic capacitors have polarity. The white/grey stripe indicates the negative lead.
If it works, then you can solder the 10 uF electrolytic capacitor to the board. Since the EN and GND pins are far apart from each other, you can simply connect the capacitor between the EN and the GND of the ESP32 chip as shown in the schematic diagram below:
Recommended: ESP32 Pinout Reference: Which GPIO pins should you use?
The following figure shows how my ESP32 looks like after soldering the capacitor. It doesn’t occupy much space, and fortunately you won’t get more trouble connecting to the ESP32 when uploading new code.
Before trying to upload a new code, you should check the connections with a multimeter in continuity mode – check that you haven’t inadvertently solder anything to the next pin.
If everything is soldered properly, you won’t need to press the BOOT button when uploading new code. You also won’t get the Fatal Error Occurred: “Failed to connect to ESP32: Timed out waiting for packet header”.
Wrapping Up
We hope you’ve found this trick useful and it solved your problem. Thanks to Ben Hall for the suggestion.
- For more ESP32 troubleshooting tips, consult the ESP32 troubleshooting guide.
- To learn more about ESP32 enroll in the Learn ESP32 with Arduino IDE course.
- More projects about ESP32: 20+ ESP32 Projects and Tutorials
I wonder what would occur if I used a 100uf Capacitor instead of the 10uf one as recommended in the post above? Would it hurt the ESP board?
Did you try the 100uF Capacitor?
For me it worked only with 100uF capacitor. I tried with many capacitors ranging from 10-470 uF. There wasn’t en pin in my ESP32s board so i soldered the third one on the chip and the first one.
Before doing any soldering make sure that you are using the correct GND pin. On my ESP32 Wroom Devkit V2 , the pin next to the 5V pin is incorrectly labelled as GND whereas it should have been CMD, and using it by mistake gave this error message
Thank you!! I was using the GND pin next to the 5V pin and it did not work. Because of you tip, I tried a different GND pin and Boom! It worked!
I have had the same issue when using the board. The CMD pin was incorrectly labelled as GND when in fact it is an flexible pin that can be a GPIO or an interface pin.
Thanks. Didn’t notice it until i read you comment. Saw all the pinouts were different…
Thanks. For me, it worked after both tricks (10uF enough). Thanks, appreciate very much you share.
I suffered for half a day! Thank you!
ty so much i was already losing my mind
I tried it with a 100 uf capacitor and it didn’t work. I put 2 of them in series for 50 uf and it worked.
I use 47uF and works! Thank you very much. Jaromír Marusinec
I have an ESP32 with this problem. I have added the capacitor as described in the article. Now the upload start automatically, but the software does not start. I I press the reset I obtain the following message
rst:0x1 (POWERON_RESET),boot:0x0 (DOWNLOAD_BOOT(UART0/UART1/SDIO_FEI_FEO_V2))
waiting for download
the only way to start the program is to switch off and the switch on again the esp32.
Any Idea?
I have resolved the problem in my previous post by adding a resistor of one 1kohm between the pin EN and the 3v.
Now the upload runs automatically and the reset maintain its function.
Thank you for sharing that solution.
Regards,
Sara
I would recommend using OTA to program the ESP32.
Elegant OTA allows me to save my file from Arduino as a binary, then upload it quickly without the need to press any button by going to /upload
Even better I don’t need a usb connection or to be the same location of the device.
https://github.com/ayushsharma82/ElegantOTA
https://github.com/ayushsharma82/AsyncElegantOTA
Hi.
Thanks for sharing that.
Regards,
Sara
You will need anyway to upload minimal server sketch via serial connection, and this is the problem he is having ….. So not really a solution to the initial problem.
Pues esta ha sido también para mi la solución, nada de botones pulsados ni condensadores, resistencia de 1K entre EV y 3,3v y funcionando. (modelo Freenove esp32-wrover)
I would like to add that in some cases, with some esp32 I must add a 47 uF capacitor + resistence of 1Kohm for resolving the problem.
Muito Obrigado pelo excelente post, me ajudou e muito e tenho certeza que vai ajudar muitas outras pessoas. “Compartilhar conhecimento só enriqueci o nosso saber”
Obrigada 🙂
¡gracias!
por la informacion que deberia venir con la placa
Thanks 🙂
Hello, thanks for the info.
I have the same problem, but the device I’m using is ESP-32 CAM, so the pinouts are different from the original ESP-32. Do you have a solution for this? Thanks again in advance.
Hi Budi.
To upload code to the ESP32-CAM you need an FTDI programmer. Please make sure that you have RX and TX pins wired correctly.
Also, very important: GPIO0 needs to be connected to GND, otherwise the ESP32 will not be in flashing mode: https://i2.wp.com/randomnerdtutorials.com/wp-content/uploads/2019/03/ESP32-CAM-wiring-FTDI1.png
I hope this helps.
Regards,
Sara
I had the same problem with esp32 Cam but the solutions was connect the adapter usb-ttl in 3.3v with esp32 Cam and supply the esp using external power supply, the esp with 5v.
Resolvi ligando o ESP 32 CAM no adaptador usb-ttl em 3.3v ( ligado no 3.3 e no gnd do esp) e alimentando com alimentação externa os pinos de 5v e gnd do esp.
Parabéns pela solução Sara.
hey.. how did you fix this problem? I have no idea about external power supply ? can you send me a mail please ? seda.ytc at gmail.com
You can use the shield eps32cam mb (module board)
Comes with reset button, micro usb, easy power with micro usb..
Less effort then ftdi..
But an extra cost..
I have a Lolin D32 board which was giving this error. It has only one button(Reset). I put the capacitor like suggested above but the error was persistent. As a last ditch effort I used a jumper on GPIO0 to GND during compile and upload(I use Arduino IDE). Now the code is uploaded without a problem. I remove this jumper and the board functions as programmed.
Hi.
Thank you for sharing your solution. It will certainly be useful for other readers that use the Lolin D32 board.
Regards,
SAra
Works great!! Thanks!!
GPIO0 to GND works for the ESP WeMos LOLIN32 1.0.0.0 board. Thanks!
Thank you for the article. I have exactly the same board as in your pictures. It was enough to use 2.5 uF and no resistor was needed. However I didn’t like the metal can of the capacitor so close to the antenna. An alternative location is negative to the pin of the AMS1117 that is closest to the USB connector, positive to the middle pin of the transistor closest to D2. And of course if project allows, the capacitor can be applied on the underlying project PCB.
Many thanks, it worked!
Is this for esp8266 or is it just in case of this error in esp32? Well, I noticed that the sketch loads faster.
Another thank you, this solved my problem as well. Great stuff Rui and Sara, keep it comming 🙂
Hi! How remove error (A fatal error occurred: Timed out waiting for packet header) to ESP32-CAM Esp32s module ?
Hi Vitali.
That means that your ESP32-CAM is not in flashing mode.
See our troubleshooting guide and follow all the exact steps to put the EPS32 in flashing mode: https://randomnerdtutorials.com/esp32-cam-troubleshooting-guide/ its in bullet 1.
I hope this helps.
Regards,
Sara
Hi,
I’m getting error “Connecting…….._____….._____….._____….._____….._____….._____…..____An error occurred while uploading the sketch”
its a Webcam ESP32s.
I’ve been able to connect to “factory setting AP” and test the camera and wifi ok but doesn’t matter what I try I can get it to upload a new sketch. I have two and one works as expected but the other is a no go.
Would try to add a 10 uF electrolytic capacitor but the pinout on the Webcam ESP32 is different from the image shown above. Do you have the EN pin placement for Webcam ESP 32?
Any ideas?
Hi Gary.
That error means that your ESP32-CAM is not in flashing mode when uploading code.
Make sure you follow the exact same steps we describe in our troubleshooting guide, bullet 1: https://randomnerdtutorials.com/esp32-cam-troubleshooting-guide/
I hope this helps.
Regards,
Sara
Hi Sarah thanks for the reply but I had followed all the troubleshooting elements of the guidelines. I have one esp32 webcam that works so i know my setup is correct.
My real question was: were is EN pin on the esp32 webcam so I could try the capacitor fix. The esp32 in that example was not a webcam version.
Thanks! Works for me!!
Thanks for posting the solution. I had been using the ESP32 on my Windows 10 desktop with no issues uploading. Wanted to move over to my MAC Laptop. First issue was the lack of USB driver on the MAC. Found info on that, but then it kept failing to connect – timing out. I assumed it was still an issue with the USB Port / Driver, till I saw your comment about holding down the Boot button throughout the upload process. Worked perfectly. Thank you.
Hi Steve.
I’m glad this solved your problem.
Have fun programming your ESP32 board 🙂
Regards,
Sara
Hey Sara Santos!
I pulled up EN to 3v3 with a 10K ohm resistor and a switch to ground it while uploading.
I Pulled up IO0 to 3.3V using a 10K ohm resistor and A button switch to pull it down to GND while uploading the code.
The Tx and Rx are also correctly connected to the FTDI programmer(PS. I’m using the same 3.3V- 5V programmer that I use for Esp8266).
And still I am receiving this error. I have even tried attaching capacitor between the EN pin and the gnd. Still the code is just not flashing.
It flashed once and I was able to blink a LED, but after that the device is just not flashing the code.!
Please suggest a solution 🙂
“”Connecting…….._____….._____….._____….._____….._____….._____…..____An error occurred while uploading the sketch
_
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header””
Hi.
Are you using an ESP32-CAM?
In that case, you should follow our ESP32-CAM troubleshooting guide, bullet 1: https://randomnerdtutorials.com/esp32-cam-troubleshooting-guide/
I hope this helps.
Regards,
Sara
Vielen Dank für die Info – nun funktioniert es!
Great!
Regards.
Sara
I am trying to connect with Custom ESP32 Board, Here I have used USB to UART converter for programming the ESP32. While programing first time it showed the timed out and waiting for packet header After I used 10uF capacitor across EN and Ground pin first time it’s programmed fine, Next time I tried to program its showes the same error.
I don’t know how to resolve this.
Usa un condensatore elettrolitico da 6.8 uF 25v
Worked fine, thanks!
Thanks for this tip.
I have a Heltec LoRa ESP32 with OLED. It has a RST pin, but not EN. Will this trick work for me on the RST pin?
Hi Rick.
Yes, It think it should work.
I recommend testing the circuit on a breadboard first to make sure it works, and only then solder the capacitor to your board.
Regards,
Sara
Hi, Sara.
Thanks for really quick reply!
I just tried it. The cap slows the connection operation a few seconds, but once it connects it still gives the timeout error. My esp32 has a lot of serial activity going on – GPS, OLED, LoRa, SD Card – which I think challenges the USB flashing.
On another note, I’m using Windows 10, which has the irritating habit of frequently causing the serial port to lose my esptool script, forcing me to restart the PC. Ever see that issue?
Thanks!
Hi Rick.
The timeout error means that the ESP is not in flashing mode (to receive the code).
Usually, the solution is to press the BOOT button when you start seeing the dots appearing on the serial monitor.
In the board you’re using, I think it is the PRG button you need to press when you see the dots.
Pressing the PRG button solves the problem?
Unfortunately, I don’t have a board like that to experiment.
I usually don’t have problems with the serial port. But sometimes if your ESP32 needs a lot of current to operate (like you have), your usb port might not provide enough power and some “strange” things can happen like disconnecting from your computer and having to restart.
Regards,
Sara
Hi, Sara.
I found the flashing worked when I temporarily removed one of the peripheral device that was drawing power through the ESP32_LoRa chip. After flashing I reconnected it, and everything is working great. Thanks, again!
Hi Rick i have same board as yours and i need help how to flash or flashing it
p.s I am not good at English
pls send me toutorial if it’s not difficult
I have resolved the problem.
In my case, there is a jumper (on the FTDI programmer) which sets the output to be 3.3V or 5V.
It should go along with the power supply pin you use on the ESP32 (3.3V or 5V pin).
Hope this helps.
That’s right!
Thanks for sharing 😀
I found my problem was with the USB port on my laptop. If I use a USB 3.0 cable (USB-A -> USB 3) in the USB 2.0 port, I get the exact error messages above. When I moved the cable to the USB 3.0 port it worked just fine. I didn’t realize my laptop had a single 2.0 port which is the one I naturally use due to it’s location. As I understand, it should have worked with the USB 2.0 port, but it does not on my laptop either due to the cable or the port. Hope this helps someone.
Thanks for sharing Greg.
This can be the issue of many of our readers.
Regards,
Sara
Thanks Dude ! I finally resolved this problem after trying a week
I just bought an esp32 , and I am a beginner .
when I upload the blink , this failed message comes, please help me
A fatal error occurred: failed to connect to ESP32: timee out waiting for packet header
Hi.
I recommend following the suggestion in this article.
Also, you may need to reduce the upload rate in your Arduino IDE in Tools > Upoload Speed.
I hope this helps.
Regards,
Sara
disconnect any Device From ESP8266 …Compile —- Upload
it’s work Form Me .
yooo! thanks dude for sharing this,it worked for my esp32sim800l module
For me with the 10uF the ESP32 did not start the program after the download.
With a 1uF the ESP32 starts the program automatically after the download.
Checking the board, it looks like the CP2102 (USB to Serial) is not an original one, as it has no label on it.
On another ESP32 (Which is working normaly) the CP2102 has a label printed on top.
Another solution!! I found that setting my upload speed to 57600 fixed this issue!!!
It works for me. Thank you.
Hi:
I am using a LOLIN D1 Mini. After several successful uploadings I suddenly got this error; however this board does not have an EN Pin and it only has a RST .
Do you have any suggestion to correct the problem?
Thanks in advance, Gerardo
Hi Gerardo.
EN and RST is the same.
I don’t know if this trick works for the ESP8266. This article was written for the ESP32.
Regards,
Sara
Thank you Sara, regards.
Hi. Very Nice tutorial. After connect a 10 uF electrolytic capacitor it work just fine for me. Thanks!
Great!
I note that Expressif recommends to load the En line with a 100nF cap if you have programming “connecting” problems
https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection
I had the same problem on a NodeMCU-32s.
The nice part is that the En line is right next to the 3.3V line and at AC all power pins are the same so connecting a cap to the 3.3V line or Gnd will provide the same filtering (assuming this cap provides noise filtering or slew limiting). I used a 0805 100nF MLCC which just fit between the 0.1″ spaced pins 1 and 2 (En and 3.3V) on the top of the NodeMCU. Now it programmes perfectly.
A large cap caused me problems with reset after programming but this smaller cap works fine.
Hi Stephen.
Thanks for sharing that.
Regards,
Sara
thank’s so much for the sharing .
Connecting…….._____….._____….._____….._____….._____….._____….._____
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
Soldered the capacitor to EN and GND.
Tried this thing as well: https://randomnerdtutorials.com/esp32-cam-troubleshooting-guide/
not working.
I’m using ESP32 CAM AI-Thinker
5V, tested ever single connections with volt meter. Everything works fine.
Tried all possible ways.
Watched like 3 hours of youtube.
Doesn’t fix the problem. Any suggestions? I would really appretiate that.
Hi.
Where did you connect the 5V power source?
Make sure that you connect your power source to the 5V pin not VCC pin.
That error means that the ESP32-CAM is not in flashing mode.
Make sure that your GPIO 0 is connected to GND.
Read this post carefully and make sure that you follow ALL the steps.: https://randomnerdtutorials.com/program-upload-code-esp32-cam/
regards,
Sara
Never mind. It was ESP-01 and https://www.youtube.com/watch?v=u78W3GKtcrw this video solved the problem.
Sorry wrong post, I replaced the capacitor with lower capacitance and it solved.
First of all – thank you for sharing this solution.
I recently bought two ESP32-boards from OLIMEX and had problems uploading. It was very strange, since it worked the first time, but never again ??? After googling around for quite some time, I found your solution.
DanKoloff from Olimex gave me some tips too, but it was a capacitor at EN that helped. From curiosity I tested different caps, diffent resistors and the two Olimex-boards plus a AZ-delivery ESP32-Dev which I had bought the week before.
You can find the table of my tests at
https://github.com/OLIMEX/ESP32-POE/issues/11
Regards, Karl
Hi Karl.
I’m glad you solved your problem and thanks for sharing that table. It may be useful for many of our readers.
Regards,
Sara
Hi Sara,
I was not really satisfied with this solution. Also I noticed, that the RST-button did not always work. Shortly I heard of power-monitoring ICs for the gereation of a clean reset.
So I ordered a few TPS3809K33 (SMD) and a few MCP102-300 (for breadboard tests). The ESP32-PoE from Olimex has a RST-button from EN to GND. Since the MCP102 has an open collector output, you can connect it directly to ESP_EN (pin4 on EXTERN1). But if you use the TPS3809 (it has a push-pull output), I suggest a resistor in between the output of the IC and EN. I use 4k7 since it only draws current while RST is pressed.
For me this is the best solution, since it is not dependent on the time constant and now even the RST-button works flawlessly. Now I can upload code and use the RST-button.
Regards, Karl
Hey guys,
I admit I’ve never encountered this problem before. The board I’ve been using so far seems to be free of this malfunction… But since I unpacked 3 other identical boards (that I bought at the same place), I’m now facing the problem.
For those who are interested, here are the boards I use:
https://www.aliexpress.com/item/33057018346.html
I guess I can compile my projects with the DoIt ESP32 DevKit v1 model. Anyway, that’s what I’ve been doing since the beginning, and it works. If you think it’s not the most appropriate model for compiling, don’t hesitate to let me know!
I’ve tried by all means to solve the problem with software, but without success. And I stumbled upon a post on the forum with the reference to this article… A providential chance!
The solution is simple and efficient. Nevertheless, I have a small question: why 10 µF? How did you choose this value? In an empirical way, or is there a logical explanation for that?
In any case, a big thank you… I can finally stop pulling my hair out on this thing that was driving me crazy.
All the best,
Steph
Hi Steph,
I did a few tests with OLIMEX-boards. see:
You can find the table of my tests at
https://github.com/OLIMEX/ESP32-POE/issues/11
But as I wrote later this can give problems with the RST-button. So, as I wrote in my last post I now use a MCP102-300 (for breadboard tests) and will late use TPS3809K33 (SMD) on the EN-pin.
All the best,
Karl
Indeed, as far as I’m concerned, my boards are very widespread, and they are very similar to Rui and Sara’s favorite boards… so it’s easier to find a solution.
On the other hand, thanks for the info about the MCP102, it’s good to know!
Thanks Karl!
Does this work on ESP32-CAM ?
Read this for the ESP32-CAM: https://randomnerdtutorials.com/esp32-cam-troubleshooting-guide/
Very handy little trick. I was suffering with this error for a while, but thanks to you i can use my boards just fine 🙂
Great!
Hey Dear,
In my case, I tried 33uF.
It really works, Thanks a lot.
I own a TTGO LoRa Esp32 v2 and I am struggling to upload the new code (.bin). I treat it with really care, I was uploading and testing some codes and suddenly, it stop allowing me to upload new programs.
I have tried many different things and combinations of all of them:
usb ports
usb wires
2 linux
windows
arduino ide
platformio
pressing the RST button (it doesn’t have boot)
changing the baud rate (upload speed)
changing the flash freq
changing the board type (TTGO Lora32 v1, v2, Heltec…)
And I get always this:
python /home/user/.arduino15/packages/esp32/tools/esptool_py/2.6.1/esptool.py –chip esp32 –port /dev/ttyUSB0 –baud 115200 –before default_reset –after hard_reset write_flash -z –flash_mode dio –flash_freq 80m –flash_size detect 0xe000 /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.4/tools/partitions/boot_app0.bin 0x1000 /home/user/.arduino15/packages/esp32/hardware/esp32/1.0.4/tools/sdk/bin/bootloader_dio_80m.bin 0x10000 /tmp/arduino_build_119083/WiFiScan.ino.bin 0x8000 /tmp/arduino_build_119083/WiFiScan.ino.partitions.bin
esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting…….._____….._____….._____….._____….._____….._____…..____An error occurred while uploading the sketch
Failed to connect to ESP32: Timed out waiting for packet header
The weird thing is that I achieved loading sample programs like OLEDHelloWorld and it is working (showing that program in the OLED), but I cannot boot/upload any other program since that happened (yesterday).
Any idea?
I faced the same problem, after adding 10uF capacitor it still could not work.
Finally, I found that problem caused by myself, I connected TX0 RX0 pin to RS485 transceiever. After moved the transceiver to UART2 the problem gone.
I am using a DOIT ESP32 WROOM-32D board and facing same issue. Adding a 10uF capacitor solves the sketch loading problem but the board needs to be manually reset every time.
Hi.
The reset is needed so that the ESP32 starts running the code.
Regards,
Sara
Hi Sara
On the RPi /Node red side everything seems fine, with mqtt nodes showing connected.
Then, to download the code, I tried a several ESPs, using a capacitor etc and nothing worked. Finally I found that I had an ESP 12F, tried this, and amazingly it uploaded. However, when I went to do the test as you suggested (before building the DHT circuit) the message I get I failed to get an MQTT connection.
My router says that I have an IP address for the ESP12F,
If you have any suggestions why I can’t connected to the MQTT on RPI – that would be much appreciated. I put the correct address of my RPi in the code and included the 1883 port in the address. So frustrating when you get so close.
Hello,
I have the AI Thinker module of ESP32-CAM. My problem is similar but at a later stage. When I upload the sketch, it can connect and start writing, however at the end it fails with the same error as above. Here is the output:
esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting…….._
Chip is ESP32D0WDQ5 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: f0:08:d1:76:94:38
Uploading stub…
Running stub…
Stub running…
Changing baud rate to 460800
Changed.
Configuring flash size…
Warning: Could not auto-detect Flash size (FlashID=0x0, SizeID=0x0), defaulting to 4MB
Compressed 8192 bytes to 47…
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4217.0 kbit/s)…
A fatal error occurred: Timed out waiting for packet header
A fatal error occurred: Timed out waiting for packet header
Hi.
Take a look at the ESP32-CAM troubleshooting guide: https://randomnerdtutorials.com/esp32-cam-troubleshooting-guide/
Regards,
Sara
Good day,
Can this trick be done by only using the bread board and not soldering.
Rgds.
Yes.
I just added a 10uF cap to a little breadboard I have the ESP board on, and it worked for me as well! Thank you
Great!
Hi, I put 10 uF electr. (smd) cap.
It was not working.
Then i put an 1k resistor (THT) between rst and 3v3
It was not working.
Then take the resistor and now it is working 😀 😀 (cap. is still soldered)
I really do not understand yet, but maybe this can help sy else too.
Hi all,
For those who find ESP WROOM 32 not flashing, no need for capacitor or to press BOOT key.. just change the board to “ESP32 Dev Module”. It works like a charm
Currently I’m testing a nodeMCU ESP32 with 38 pins and on 1µF capacitor (metal-film) works fine to solve the flash-problem. I can imagine that for this particular problem a metal-film capatictor is more suitable than an electrolytic capacitor. Anyway it’s much more fun that pressing the EN-button every time. Thank you for this hint and of course for all your helpful tutorials.
Thanks you very much. It is working now.
After lots of experimentation with different RC timings on EN, different bulk capacitance and PS filtering, I eventually discovered that this is a regression in esptoolpy 2.6 and 2.8. Using version 2.1, my ESP32 will flash perfectly every time at up to 430kbps. I’ve reported this to esptool (https://github.com/espressif/esptool/issues/570) and hopefully they’ll be able to figure it out. For folks using Platform IO, you can add the following to your platformio.ini to cause it to use esptoolpy 2.1:
platform_packages = [email protected].0
excellent thought. It worked.
i also have the same problem but i am using esp32 ttgo t call and i tried it but still can’t?
This is my solution for the board Lolin32 Lite
Arduino IDE
Board : “ESP32 Dev Module”
Upload Speed: “115200”
Cpu frequency: “240Mhz”
Flash Frequency:”80Mhz”
Before:
“A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header”
Then Do this: Remove any connector from the board or at least from 3.3 pin
After:
“Hash of data verified.
Leaving…
Hard resetting via RTS pin…”
It’s working!
Ciao 🙂
Hello All,
I am unable to upload the blink example to ESP32. i am using ESP32 devkit v1. I tried to hold boot button and momentarily pressed EN button for the upload. It always fail with following error message. I tried with different capacitor value but still failing. In monitor mode when i pressed boot button and EN. It shows waiting for download in terminal. I closed the terminal and then tried to upload again but so far i have not able to upload the code once. Any help would be appreciated. I tried with different USB cable but still not working. i tried with Arduino IDE also using IDF framework (terminal build) but nothing works. i wanted to try any other suggestion before i would like to buy new ESP32 dev kit again.
Flash logs from Terminal
Executing action: flash
Running ninja in directory c:\users\mohan\esp\esp-idf\examples\get-started\blink\build
Executing “ninja flash”…
[1/4] Performing build step for ‘bootloader’
ninja: no work to do.
[1/2] cmd.exe /C “cd /D C:\Users\Mohan\esp\esp-idf\components\esptool_py…” -P C:/Users/Mohan/esp/esp-idf/components/esptool_py/run_esptool.cmake”
esptool.py –chip esp32 -p COM4 -b 115200 –before=default_reset –after=hard_reset write_flash –flash_mode dio –flash_freq 40m –flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 blink.bin
esptool.py v3.0
Serial port COM4
Connecting…….._____….._____….._____….._____….._____….._____….._____
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
CMake Error at run_cmd.cmake:14 (message):
esptool.py failed
Call Stack (most recent call first):
run_esptool.cmake:21 (include)
serial monitor (only boot button)
rst:0x10 (RTCWDT_RTC_RESET),boot:0x1 (DOWNLOAD_BOOT(UART0/UART1/SDIO_FEI_REO_V2))
waiting for download
ets Jun 8 2016 00:22:57
(boot and EN button)
rst:0x1 (POWERON_RESET),boot:0x1 (DOWNLOAD_BOOT(UART0/UART1/SDIO_FEI_REO_V2))
waiting for download
Hi.
Don’t press the RST button.
Just press the BOOT button.
Regards,
Sara
Hi Sara,
Thanks for the response. I tried just using boot button but it did not work. I also used 10 microfarad capacitor connecting EN & GND as mentioned but that also did not work for me. I changed the micro USB cable as well this time for testing. Also i tested with IDF framework, PlatformIO and Arduino IDE and all 3 upload fails. May be i will buy a new Dev Kit and test it. Thanks again for your response.
Hi Mohan, there is a regression in the current version of esptool.py that caused this to fail regularly for me; an older version (2.1) works perfectly. One of the maintainers is looking into the problem.
I am using platformio with vscode; here’s an example of my platformio.ini that works; you can also try slowing down the upload_speed:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
[env]
upload_speed = 460800
upload_port = COM4
upload_protocol = esptool
platform_packages = [email protected].0
Hi David,
Thank you for your response. i tried as you have suggested but it seems to fail again. Here is the output
Verbose mode can be enabled via
-v, --verbose
optionCONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (2.1.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
– framework-arduinoespressif32 3.10004.201016 (1.0.4)
– tool-esptoolpy 1.20100.0 (2.1.0)
– tool-mkspiffs 2.230.0 (2.30)
– tool-openocd-esp32 2.1000.20201202 (10.0)
– toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 26 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
RAM: [ ] 4.7% (used 15436 bytes from 327680 bytes)
Flash: [== ] 16.5% (used 216621 bytes from 1310720 bytes)
Configuring upload protocol…
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port…
Use manually specified: COM4
Uploading .pio\build\esp32dev\firmware.bin
esptool.py v2.1
Connecting….
Chip is ESP32D0WDQ6 (revision (unknown 0xa))
C:\Users\Mohan.platformio\packages\[email protected]\esptool.py:2236: DeprecationWarning: inspect.getargspec() is deprecated since Python
3.0, use inspect.signature() or inspect.getfullargspec()
Uploading stub…
operation_args,,,_ = inspect.getargspec(operation_func)
Running stub…
Stub running…
Configuring flash size…
Warning: Could not auto-detect Flash size (FlashID=0xffff*** [upload] Error 2
ff, SizeID=0xff), defaulting to 4MB
Compressed 15872 bytes to 10319…
A fatal error occurred: Timed out waiting for packet content
========================================================== [FAILED] Took 29.13 seconds ==========================================================
The terminal process “C:\Users\Mohan.platformio\penv\Scripts\pio.exe ‘run’, ‘–target’, ‘upload'” terminated with exit code: 1.
Is your ESP32 connected to COM4? In my example I used COM4, but you should change that to whatever serial port your ESP32 is connected to. Also, if it doesn’t work at such a high speed, try slower upload speeds such as 115200 or even 57600.
Hello David, Sara,
I tested with new ESP32 development board and it is working fine. I think the first board that i had may have hardware fault. It always printed warning that it cannot detect flash size. anyways thank you for the reponses. Have a great day!!
Many thanks for this good hint! It works fine with a small 10uF ceramic capacitor.
The trick with the 10 uf capacitor works like charm. As it says at the beginning pay attention… “connect a 10 uF electrolytic capacitor between the EN pin and GND”. The pin location of EN and GND are different for every board model, depending on the manufacturer. So make you connect the right pins.
Hi Radu,
Which capacitor voltage you connected to your board? There is many voltage, 25v or 50v…I tried to put a comment here but the administrator didn’t approve…Please, help me.
Thank you
Was getting intermittent “Invalid head of packet error 0x2E”
was driving me nuts, found this solution, and 100% fix. (10uf fitted)
on ESP32 TTGO
Thank You 🙂
As Ezio Somà says above, on some boards a pull up resistor added to the EN pin is a partial fix. The boards I’ve been using are WeMos ESP32 Mini clones and, after scoping the reset issue, they appear to use FET instead on NPN transistors to drive the EN and GPIO0 pins. They do have a cap (and ~10k pullup) on EN but the EN signal only rises to around 1.6v when GPIO0 is set low – this is close to/on the threshold for high/low level. Because of this, sometimes the ESP32 doesn’t come out of reset until GPIO0 is set high again (i.e it doesn’t see GPIO0 low so just boots normally – not into flash mode). Adding another pullup (4K7 to 1K) to EN helps get the EN signal slightly above the 1.6V threshold – however, it’s fighting against the FET so doesn’t always work but it does improve the reset reliability considerably (the boards I have, when warm, wouldn’t reset to flash mode reliably 9 times out of 10 previously, now its the other way around).
Also of important note is that, unlike the reference design which uses NPN transistors, the FET actively drives GPIO0 (and EN) high during run time (the pin should float after reset) so you can’t use GPIO0 on these boards for any other function!
Bonjour,
Je n’ai pas de pas de EN broche, j’ai une carte
Fengyuanhong TTGO T-Beam ESP32 WiFi sans Fil Bluetooth Module ESP 32 GPS NEO-M8N IPEX Lora 32 Titulaire de la Batterie, 868MHz: Amazon.fr: Cuisine & Maison
Et quand je retiens le bouton “BOOT /FLASH” cela ne fonctionne pas.
Merci de votre réponse
is the capacitor Voltage affect the result ? i use the 16V electrolyctic capacitor 10uF for my ESP32, is it okay ?
You should use a ceramic capacitor rated for at least 6.3V or a solid tantalum capacitor rated for at least 10V (pay attention to the polarity with a tantalum). Do not use an aluminum electrolytic.
Capacitor voltage ratings are minimums; you can always use a capacitor with a higher voltage rating. As a rule of thumb, the voltage rating should be 2x what is actually present; you can go a little less with ceramic capacitors. For example, if you are powering an ESP32 with 3.3 volts, you can use a 6.3 volt or higher ceramic capacitor, but with a tantalum or electrolytic capacitor, the voltage rating should be greater than 3.3 x 2 = 6.6V (for example 10V or 16V are popular ratings).
The purpose of the capacitor is to help make sure the ESP32 voltage stays above its minimum limit when it makes a sudden demand for power. If the traces supplying power to it are too inductive (too long or too thin) or the voltage regulator is slow to react to sudden changes in current, the voltage will drop at the ESP32 and can cause it to reset. Placing a low-ESR capacitor very near the power input to the ESP32 provides a small reservoir of power that can help meet sudden increased power demands (e.g. turning on a WiFi transmitter).
The reason not to use an aluminum electrolytic capacitor is its relatively high ESR (series resistance). The high ESR will result in a greater voltage drop when the ESP32 suddenly pulls a lot of current. They also tend to have lower ripple-current ratings.
Good luck!
Oops, I didn’t read carefully enough (that you are using the 10uF capacitor on EN to stretch the reset pulse).
Before increasing the EN pulse duration, you might want to try placing a bulk capacitor between 3v3 (pin 2) and ground (pin 1) as described above. I use a 22uF bulk capacitor (anything between 22uF and 100uF is probably a good choice). The reference design of a 10K pull-up and a 1uF on EN then works well.
My concern is that stretching the reset pulse may masking underlying power problems; it will fix your problem at reset but there may be other problems in operation when the ESP32 makes sudden power demands. If you have an oscilloscope, it would be good to watch the power fluctuations at the input to the ESP32 module.
Boa tarde,
Qual foi a voltagem que utilizaram no capacitador? Vou comprar um e não queria comprar um errado.
Obrigada.
Olá.
Neste projeto utilizamos um condensador eletrolítico de 10 uF.
Cumprimentos,
Sara
O que utilizamos é de 25V.
Mas outras voltagens também devem funcionar.
Boa tarde,
Obrigada pela resposta mas comigo não funcionou, nem com os botões EN/Boot funciona…Vocês tem alguma ideia do que posso fazer?
Obrigada.
Fazendo o procedimento indicado, a placa deve funcionar.
A não ser que tenha um modelo muito diferente que necessite de outro tipo de “truque”.
Se nada funcionar, talvez seja melhor comprar outra placa. Pode ser um placa dessa placa em específico.
Would be nice to add a theory of operation, or how/whey this should resolve the problem. Maybe also include the correct process for flashing an ESP32 outside of a development board, the best solution for a development board, and why some boards fail.
I believe to flash an ESP32, pin IO0 needs to be LOW (0v) when the chip boots. To boot/reset the device, you bring EN/RST pin LOW. In normal operation both of these pins should be pulled HIGH (3.3v). I’m not sure why a capacitor is aiding in this operation, I think it could actually hinder it. Espressif has a PDF on their example development board: https://dl.espressif.com/dl/schematics/ESP32-Core-Board-V2_sch.pdf It’s possible the ESP32 sees the EN pin as low as the capacitor charges by way of the pull up resister. That would explain the strangely high value that is being suggested of 10 or 100 uf.
I have a USB programmer that has different serial pins on it (Rx, Tx, RTS, CTS, RI, DSR, OCD, DTR, RST). Different pins are brought to 0v at different times. I played around with the programmer and an ESP8366 for some time trying to determine the best pins to connect to the ESP8266 pins. I ended up with RTS connected to reset, and DTR connected to Program/Boot/Flash/GPIO0. Same pins work for ESP32. And same pins as mentioned in the above PDF.
On a board I was using, I had to eliminate the capacitors I had added for debouncing in order to get the ESP32 to flash. Seem for boards that are not flashing automatically, there’s problems with the EN or IO0 pins that are not allowing the flash reset sequence. Maybe too strong of pull up resistors to 3v3 are being used? You can test the pins resistance to 3v3 rail with a multimeter to find what they are. Should be around 10k-30K.
I’m seeing a odd looking part right by the en button, and I’m wondering if it might be the capacitor to enable flashing without pressing the buttons? You can find the part sitting angled on the board in this board sold on Amazon…
amazon.com/dp/B086MGH7JV/ref=cm_sw_r_cp_apa_glt_fabc_0HKVGH7NWNVNFBTH1095
Hi.
I’m not sure, but it seems to be the capacitor for flashing.
Regards,
Sara
Hi,
I am working on esp32-wroom-32u. I tried 10uF and 100uF capacitors. It’s not working either. I keep getting the same error. Do you have a suggestion?
thanks
Hi Huseyin,
I had the same problem with my NodeMCU ESP32 (with AI-Thinker ESP32-S module), and I found out that both our ESP32 has the same pinout layout. Have a look at the links (for others, please find your appropriate datasheet to find the correct pin):
espressif.com/sites/default/files/documentation/esp32-solo-1_datasheet_en.pdf
espressif.com/sites/default/files/documentation/esp32-wroom-32d_esp32-wroom-32u_datasheet_en.pdf
I also had tried all solutions in the post and comment section but nothing works for me. Then I tried directly connecting GPIO0 to GND but only to successfully upload the code, but then showing the error “waiting to download” (I can’t remember exactly).
Finally I tried putting a 1k Ohm resistor between GPIO0 and GND, then ta-da, IT WORKS PERFECTLY!!!
It may not work for some ESP32 dev boards, but in general, you have to pay attention to these strapping pins: https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection#boot-mode-message
Good luck
Hi everyone,
I am new to esp32 and I spent several hours trying to solve this. I finally did, thanks for your help !
It seems that every esp32 devices are different so here is my configuration and solution.
I use a NodeMCU Joy-It equipped with the esp32-wroom-32, with esp-idf.
– Bought here : conrad.fr/p/carte-de-developpement-joy-it-node-mcu-esp32-modul-sbc-nodemcu-esp32-1-pcs-1656367
– Doc here : joy-it.net/en/products/SBC-NodeMCU-ESP32
A) In menuconfig (idf.py menuconfig) —> Serial flasher config :
[ ] Disable download stub
Flash SPI mode (QIO) —>
Flash SPI speed (40 MHz) —>
Flash size (4 MB) —>
[*] Detect flash size when flashing bootloader
Before flashing (Reset to bootloader) —>
After flashing (Reset after flashing) —>
‘idf.py monitor’ baud rate (115200 bps) —>
B) Add a 47µF between pins “EN” and “GND”.
C) Before executing “idf.py -p /dev/ttyUSB0 flash”, I have to do this sequence :
1) Press and hold “Boot”
2) Press and release “En”
3) Release “Boot”
After flashing I finally was able to see those logs :
Wrote 163472 bytes (86248 compressed) at 0x00010000 in 2.2 seconds (effective 598.2 kbit/s)…
Hash of data verified.
Compressed 3072 bytes to 103…
Writing at 0x00008000… (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 547.3 kbit/s)…
Hash of data verified.
Leaving…
Hard resetting via RTS pin…
Done
Before all this I obtained following errors :
1) A fatal error occurred: Failed to connect to ESP32: Invalid head of packet (0xZZ)” with 0xZZ random hex value
2) A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
Hope this will help someone 😉
Much simpler solution. Put a jumper between IO0 and GND. They are adjacent on the board. Remove it when done
I had this happen with an ESPDUINO-32 & Wemos D1 R32 ESP32 Board while trying to flash from a Dell D410. The Dell is quite old, a 32bit machine.
What I did was move over to another PC, a newer Zotac compact computer. It was able to flash without problem.
From a Raspberry Pi it worked if I pressed the reset button as soon as I saw the timeout indication (dots-dash-dots) during flashing. But this fix did not work on the D410.
In my case the solution was only go to the Silabs page and install the original drivers.
Windows 10 drivers didn’t work properly.
https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers
Give it a try before soldering any capacitor.
I have tried absolutely everything for the “ESP32-WROOM-32D” but no solution given in this forum has helped me. It does not load the code. Will anyone have a solution that works? Thanks.
Hi.
When you say “it does not load the code”, what do you mean?
What happens exaclty? Can you provide more details?
Regards,
Sara
Hi,
Do you have a recommended board that does automatically go into flashing mode so we don’t need to solder anything? I noticed you did have a page of recommended boards, but it doesn’t say whether they automatically go into flashing mode or not. Thanks
Hi Thomas.
I don’t think there’s a way to know if that will happen or not.
Some ESP32 boards that I’ve bought go automatically into flashing mode and others don’t. Even from the same suppliers.
I usually buy my boards from banggood or ebay (seller alice1101983).
Regards,
Sara
None of the ESP32 boards I have used require this capacitor.
One thing that worked for me, repeatedly is putting ferrite beads at each end of the cable. Resetting the ESP32 is one thing, but even with the capacitor, using a poor quality USB cable will certainly continue to fail.
Without soldering a capacitor, try ferrite bead clips on your cable first (you can find plenty of examples on the internet).
Works a charm.
I have a custom board where I am using an ESP32 Wroom module. I am not able to flash code via serial communication. I am using FTDI232 USB to UART for serial communication. I am able to get serial messages in my serial monitor which mean there is no issue in serial wires.
I have jumped my EN and GPIO0 line from my board to breadboard where I am changing the EN & GPIO 0 wires to GND instead of switch. This is just to be sure that I am pulling down the signals while booting and there is no noise or sudden voltage fluctuation while toggling the signals.
For extra precaution I have also pulled up or pulled low following strapping pins:
1) EN: has 10K pull up with 10uF cap between EN & GND
2) GPIO 0: has 0.1uF between GPIO 0 and GND. I use jumper cables from my board to breadboard where I manually pull it down to GND.
3) GPIO 2: Floating. I checked signal via scope it stays low.
4) GPIO 4: 10K pull down resistor and 0.1uF cap between GPIO4 and GND
5) GPIO 12: 10K pull down resistor
6) GPIO 5: 10K pull up resistor to 3.3V
7) GPIO 15: 56K pull up resistor to 3.3V
While uploading the code I pull down first GPIO 0 line and then EN line to GND and later when I see _’Connecting…….._____’ message on my Arduino IDE terminal I pull up the EN line and keep pressing the GPIO0 line until the Arduino IDE display error message: ‘A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header’
What I understand is that I can put ESP32 in program mode if my GPIO 0 is zero after reset and if my GPIO 0 is high after reset then it goes into normal mode. In my case, I can enter in and out of both modes and my serial communication prints that message but I can’t flash new code because of packet header issue/ time out of the session.
I know I can enter my ESP32 into program mode as I see following message on my serial monitor. Whenever my GPIO 0 is low and then when I toggle the EN signal from 1 (high) to 0 (low) and then back to 1(high). It shows following message which is good
‘rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download’
Hi.
There must be something wrong with your setup, but it is very difficult to find out what might be.
Have you taken a look at the following documentation? I think it might help:
– https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection
Regards,
Sara
(reposting as reply to correct post.)
I just tested with the same adapter I have.
Solder a pin to the DTR and RTS pins if needed. Make sure you are using the 3.3v jumper position. I have my Arduino IDE set to ESP32 Dev Module, and the COM port which my adapter created. If you make these connections, no need to push any buttons, it programs automatically.
Connect:
ESP32 GPIO0 -> FTDI232 DTR
ESP32 EN -> FTDI232 RTS
ESP32 TX -> FTDI232 RX
ESP32 RX -> FTDI232 TX
ESP32 3.3v -> FTDI232 VCC
10K pull-up to 3.3v on ESP32 EN
10K pull-up to 3.3v on ESP32 GPIO0
Yes, I did look at it. Do you know if I do hard wiring to strapping pins in the configuration above then it should work. Are all the pins configuration looks correct to you?
I just tested with the same adapter I have.
Solder a pin to the DTR and RTS pins if needed. Make sure you are using the 3.3v jumper position. I have my Arduino IDE set to ESP32 Dev Module, and the COM port which my adapter created. If you make these connections, no need to push any buttons, it programs automatically.
Connect:
ESP32 GPIO0 -> FTDI232 DTR
ESP32 EN -> FTDI232 RTS
ESP32 TX -> FTDI232 RX
ESP32 RX -> FTDI232 TX
ESP32 3.3v -> FTDI232 VCC
10K pull-up to 3.3v on ESP32 EN
10K pull-up to 3.3v on ESP32 GPIO0
It works with the connection you mentioned but I wonder what was preventing it when I was doing the reset and GPIO0 manually.
WOrks on some boards.
3 out of 10 of my boards can be programmed and reprogrammed
another 3 programmed exactly once
none responded to the 10uF cap – tried 1->100uF to no avail
A very shoddy programming interface and a flakey solution
I found this on Google and will try it out soon. I have a esp32 that worked great and suddenly it lost wifi and now it does not want to connect to wifi anymore and when connected to the computer it says it’s on com 9 and when trying to flash it again it just doesn’t work.
So hopefully this will fix it.
If not I have to find out what is going on. It was on a breadboard working stable so no jittery connection from some stuff laying around on my desk.
This is exactly what happened to me! I had a web server all set up with the camera I was waiting and developed a really good stable 3.3 Volt circuit to power the thing I got that all squared away I went to test out everything again after having run the thing for over a month straight with no problems and it does not work now. I let it sit for a couple of months while I was doing other problems it was in an antistatic bag up on the shelf by itself and now it doesn’t work. I get all kinds of loading errors and it won’t connect to the Wi-Fi it won’t do anything it’s absolutely completely broken after again having run 4 a month or two without any issues whatsoever.
Salut à tous.J’aimerais savoir le voltage du condensateur électrolytique de 10 uF utilisé pour pallier au problème ” a fatal error occured: failed to connect to Esp32:Timed our waiting for packet header”.
Merci pour toute aide que ce soit.
10uf-25v Solved in ESP-12K Ai Thinker (8)
Tanks for all.
I dont know what’s wrong with this device . But after many failed attempts i finally placed a 100uf capacitor between the ground and the flat terminal just next to EN .It worked nicely . furthermore , i removed the capacitor and it still works. what to say ! I hate it , but also i love this:)
Hello,
I have designed a custom PCB which has USB to UART bridge (CP2012) and ESP32 Wroom. I am not able to detect COM port on my computer. It might be a different issue compared to EN & IO RC timing issue and more of CP2012 issue but I still want to ask if anyone sees anything wrong in my circuit as CP2012 and ESP32 are closely related to the issue. I using schematic design which is very similar to ESP32 Dev kit like in this link (https://dl.espressif.com/dl/schematics/esp32_devkitc_v4-sch.pdf).
I can program my ESP32 via COTS USB to UART bridge which also has same CP2012 IC so I have installed correct driver. My computer will recognize a COM port when I connect using this USB to UART board.
(https://www.digikey.com/en/products/detail/silicon-labs/CP2102N-MINIEK/6605110)
You can find snapshots of my schematics in the link below. You can also see snapshots from my oscilloscope on DTR, RTS, EN & IO0 line.
https://drive.google.com/drive/folders/1h_0bGXonWzkNox2GsR56baM84m8-anmp?usp=sharing
I have attached additional decoupling caps on my EN line of ESP32 and VREGIN line on CP2012 on a breadboard.
Seems like your VBUS is connect with resistor. Is that right?
Do you voltage divider on pin 8 of CP2012. VBUS comes from USB and since CP2012 is bus powdered that’s why there is potential divider to drop the voltage around 3.3v in order for CP2012 to work but all that is on pin 8. VREGIN which is pin7 of CP2012 gets the VBUS without any resistor. I have attached decoupling capacitor (10uf & 0.1 uf) on breadboard on pin7 of CP2012.
Read through the data sheet of the chip and make sure all pin requirements are met. That pin (8) should be direct to USB power (5v) from what I see.
I am following datasheet. It is pg8 where the USB bus power configuration is shown.
Datasheet:https://www.silabs.com/documents/public/data-sheets/cp2102n-datasheet.pdf
I was lookin at the non-n data sheet I guess. My bad. shrugs good luck!
Congratulations, Sara and Rui. What a wonderful work you do !!!!. It’s a pleasure reading your tutorials. All them.
With this one I solved my booting problem.
My equipment: NODEMCU ESP32S (38 pins), 4MB flash. Arduino IDE 1.8.15, esptool.py v2.6, Windows 7.
I did 3 tests (3 caps): 47 uF, 10 uF, and 1 uF.
the best is with 1uF cap. PERFECT. Directly load sketch and auto run without buttons (nor EN/RESET neither BOOT/100 needed).
with 10 uF: right direct loading, but then needed button EN/RESET to start running,
the worst: 47 uF, right direct loading, but then needed button EN/RESET pushed for 6 seconds (less or more doesn’t work) to start running
So, for me 1uF is perfect.
Thanks for stay there.
jmvillar
This did not solve the problem for me holding the reset did not solve the problem for me it still does this every single time. There is so much buggy to these boards it’s amazing that they even have released any of them. This reminds me of the early days of Linux it’s an absolute cluster bleep
Hello, first thank you for the idea but it didn’t work for me !!
i have tried many things,
finally when i supply my esp by 2.5V, i can flash the esp normally, but 2.5V is not recommended .
my Bad , any idea about this problem ?
Hi, using a capacitor worked for me, but was wondering what’s actually happening behind the scenes? How did the capacitor fix this issue?
Hello. I’m getting this issue while i try to use an Arduino Uno and an ESP32 at the same time (need to use both to send data from Arduino to ESP32) on the same computer. If i disconnect the Arduino and load the code on the esp32 first, it wont give me that error but thats not what i want, i need to load the code on the Arduino first and then on the esp32 so i can send the data from arduino to esp32. Any tip?
Not sure if it matters but I’m running Manjaro Linux as my OS and i’m using the voltage divider with 2 resistors (1k and 2k ohms) to avoid damaging my esp32 since Arduino works on 5v and the Esp32 works on 3.3v.
Thank you very much for this fix.
My ESP32 (doit.am Devkit v1) is usable now by connecting a 100uF capacitor as you described. I use the micropython firmware
I used to have the following error:
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4540
ho 0 tail 12 room 4
load:0x40078000,len:12344
ho 0 tail 12 room 4
load:0x40080400,len:4124
entry 0x40080680
Thank you very much, the 10 uF cap works very nicely. The only small issue was the blue connected to GPIO 2 LED started to blink intermittently, so I digitalWrited to LOW, problem solved.
I´ve found another issue. Some boards i worked with since month are
suddenly unable to upload automatically. ESP32 WROOM , ESP Mini D1 ..
Only holding the boot button worked.
I took a new one which i never used with my pc. That works correct.
I see that it has got another COM Adress.
So i go into the windows device manager and deinstall all old COM ports.
After plugin an old board it gets a new COM port and works correct again.
Thank you for sharing. I never was very good at finding those little buttons.
Here is description problem about entering to program mode.
https://docs.espressif.com/projects/esptool/en/latest/esp32/advanced-topics/boot-mode-selection.html
Text from espressif site :
(Some third party ESP32 development boards use an automatic reset circuit for EN & GPIO0 pins, but don’t add a capacitor on the EN pin. This results in unreliable automatic reset, especially on Windows. Adding a 1uF (or higher) value capacitor between EN pin and GND may make automatic reset more reliable.)
Hi,
I have a ESP32 wroom processor in a Macchina A0 OBD dongle. I have the latest Arduino IDE loaded on two laptops both are up to date. one ide installation automatically connects to the ESP32 and loads sketches, the other ide installation requires me to ground the EN pin.
any ideas in what could be the difference?
Hi.
Are you using the same or different ESP32 boards?
Regards,
Sara
why is no-one not concern about electrolytic capacitor discharge voltage. Could this not harm the computer 5v USB?
@abdool there is no reason adding a small amount of bulk capacitance to the ESP32 power lines would harm the computer; certainly not due to discharge. Perhaps you are thinking of inductors which can generate high voltages when power is removed abruptly? Capacitors don’t do that. At worst, the capacitor might cause increased inrush current when the device is first powered up, but USB ports are typically well protected against overcurrent and won’t source more current than they are rated for.
Perhaps a better question is the choice of an electrolytic for this purpose. A 10uF or larger ceramic SMT capacitor (rated for 6v3 or higher) would probably be easier to mount and more importantly would have MUCH lower ESR. Electrolytics are generally not appropriate for bypassing high frequency loads.
Gracias Dios indio de los ESP32 <3
Hi,
for yd-esp32-s3 board:
I tried to add capacitors and resistances, but finally I changed one of transistors (that connected to Boot) to the new one.
Old transistor is good (h21 = 238), but doen’t work.
I wish it can be usefull
Try using a powered USB hub for your ESP connection. It works for me without a capacitor. I suggest it may be a voltage issue. Let me know if it works for you…