A fatal error occurred: Failed to connect to ESP32 - Voltlog

  Рет қаралды 66,588

VoltLog

VoltLog

Күн бұрын

Пікірлер: 72
@TornadoCrafter
@TornadoCrafter 3 жыл бұрын
Awesome! You have brought and end to my upload, timeout, *swearing*, upload, timeout, *swearing*, upload, success routine!
@voltlog
@voltlog 3 жыл бұрын
Yes! This makes the upload more reliable and can save you the *swearing* :-)
@DougSisco1
@DougSisco1 3 жыл бұрын
Thank you, thank you!! I have experienced this only recently with a new board and your fix worked perfectly! Who would have guessed that there is a race condition between the reset and enable lines??
@userou-ig1ze
@userou-ig1ze 3 жыл бұрын
thanks, the oscilloscope picture is really helpful!! As far as I see, this is clearly a design flaw in the chip design in the first place :-( I totally sympathize with how time consuming it can be to figure out a semi-randomly occurring problem, and usually, until we humans figure it out, it takes ages (even though the solution may only take 2s). It's so frustrating! So kudos to you there for debugging, figuring out and sharing!
@voltlog
@voltlog 3 жыл бұрын
The chip is okay, this is mostly a design flaw in the toolchain/driver or how the OS handles signaling of the RTS DTR serial lines. These lines are then used in the auto-reset circuitry and because they don't switch at the correct timing we have a problem.
@userou-ig1ze
@userou-ig1ze 3 жыл бұрын
@@voltlog ok. But if they had known about the imprecise timing they could've just put a capacitor there in the first place, right? Or is there a downside of having it, that I'm blissfully unaware of? :)
@voltlogpersonal8036
@voltlogpersonal8036 3 жыл бұрын
@@userou-ig1ze I think they started recommending a capacitor after discovering the issue.
@userou-ig1ze
@userou-ig1ze 3 жыл бұрын
@@voltlogpersonal8036 I hope it's fixed in the new s3 and c3 devkit boards!!
@BeyondDuctTapeFixItRight
@BeyondDuctTapeFixItRight 3 жыл бұрын
This joy compelled me to search for a solution. A fatal error occurred: Timed out waiting for packet content Upload error: Failed uploading: uploading error: exit status 2 Your clip is very well done and your content is compelling. So much so, that I feel confident your discovery and solution will help me.
@Roobotics
@Roobotics 3 жыл бұрын
2 Thoughts on this: 1. I'm sort of thinking from that initial scope capture shown, that the real issue is there is any real capacitance on the EN line. That RC constant is causing the EN to not have a clean edge or easily deterministic start point, a proper reset supervisor wouldn't have an output like that (but RC circuits are cheaper) primarily reading the datasheet I see that: "During the chip’s system reset release (power-on-reset, RTC watchdog reset and brownout reset), the latches of the strapping pins sample the voltage level as strapping bits of ”0” or ”1”, and hold these bits until the chip is powered down or shut down." So if that EN signal went high faster (it's RC constant were removed and given a more square pulse) before that glitch occurred, then it would have already been stored as a strapped value. the pins are required to stay in the correct state for 1mS after EN "CHIP_PU" goes high to be considered properly latched. 2. The datasheet states GPIO0 has a weak pull-up resistor (WPU) and that the default drive strength of that is ~75uA, another thing worth trying, is installing a pull-down resistor on GPIO. Using a value of 5k should make it ~0.4v during that WPU event. Which puts it well under the required Voltage-Low threshold of ~0.8v @ 3.3v.
@lilamedo1320
@lilamedo1320 2 жыл бұрын
I was having problem with ESP32 DEVKIT (chinese clone) flashing, it didn't matter if I pressed EN button. When I added 5k resistor from GPIO0 to GND (link you suggested) the problem went away.
@domingomolinero9553
@domingomolinero9553 3 жыл бұрын
Thank you, a simple solution for a annoying problem, explained with technical measurements, not just "the aunt of my niece's boyfriends grandmother added a cap and it worked"
@DavidGranz
@DavidGranz 3 жыл бұрын
I recently ran into this problem... I've tracked it down to an issue with the way esptool.py hits the DTR and RTS pins to trigger the reset. Turns out the python serial library doesn't have a way to set both those pins at exactly the same time, thus producing the glitch you see. The solution is to change the esptool code to change those pins at the same time. I have some hacked code that works, but haven't had the time to publish it anywhere yet.
@DavidGranz
@DavidGranz 3 жыл бұрын
search in esptool.py for 'setDTR' and 'setRTS'... you will see they are set using separate calls. I fixed it on the linux version by using ioctl to set both at the same time.
@voltlog
@voltlog 3 жыл бұрын
I have seen this discussed on Github and it's true it's the root cause of the problem but given that the solution to fix it at that level is to change files inside the toolchain personally I don't like it. What happens if you switch to a different computer that doesn't contain the fix? What happens when you update the toolchain? I'm sure that a SW developer is likely to prefer this kind of fix but I am a HW developer and I prefer the HW fix 😁 Unless, this is a fixed at a higher level by Espressif and it's packed in all future releases.
@DavidGranz
@DavidGranz 3 жыл бұрын
@@voltlog I agree a hardware fix is better on new boards.... however that doesn't work if you have an existing board (like the Olimex Dev board) and you are not capable of fixing the hardware, or if you have 100s of existing boards that used the 'standard' dual transistor reset circuit. Unfortunately it appears there is no perfect solution right now :(
@AttilaAsztalos
@AttilaAsztalos 3 жыл бұрын
@@voltlog In my most humble personal opinion (which I nonetheless hold very strongly) fixes and workarounds are two very different things, a distinction which to me seems lost on a disturbing proportion of modern engineers. I would never use the latter if the former is possible - and in this case the sole means to do that would be correcting the software. YMMV...
@wagnerthomas6780
@wagnerthomas6780 3 жыл бұрын
@@AttilaAsztalos Yeah and the cap workaround didn't worked with my esp8266, the problem is defenetly with esptool.py altough in my case reverting back to an older version fixed it.
@gerritmarskamp8030
@gerritmarskamp8030 3 жыл бұрын
Hello, we experienced almost the same about a year ago. We used an Olimex development board, the Esp32 devkit lipo. Also sometimes this error would show up. After studying the esp32-wroom data sheet, (page 20 of that sheet) provided by Expressif, we discovered that there should be a 10 k resistor connected from 3v3 to pin 3 EN and a capacitor of approximately 1 uF to ground. We designed our own board in the end with 10 k and 100nF and this worked fine every time
@sdgelectronics
@sdgelectronics 3 жыл бұрын
Isn't this already integrated into the module? I can't remember off hand, but I had a feeling you only need to add this yourself if you layout the bare ESP32 chip
@gerritmarskamp8030
@gerritmarskamp8030 3 жыл бұрын
@@sdgelectronics You could be right about that. As far as i can remember, the Olimex board itself, used a 1k resistor and no cap. I have to compare their pdf diagram from that time to their recent one, as i noticed that they use a much higher value for that resistor recently. I did not take a look under the metal hood of the Wroom module itself Maybe by using these values on our own board, we are still in the clear and was the 1k on the original Olimex board far too low
@voltlog
@voltlog 3 жыл бұрын
I use a 10K pull-up and a 0.1uF decoupling on the RESET (EN) line of every circuit I design, that is my standard. I had this on the board shown in the video but unfortunately it's not enough capacitance to create that delay ("the fix"). You really need at least 1uF for it to be reliable.
@dany_2945
@dany_2945 3 жыл бұрын
happend to me, it was a pain to figure it out since is the first esp32 board i used, mine worked if i pushed the "boot" button while uploading the code
@pulporock
@pulporock 3 жыл бұрын
The amount of times I have pressed that En button during flash is beyond frustrating. Usually just use a different computer. I'm finding windows o/s way worse than Ubuntu.
@jensgoerke3819
@jensgoerke3819 3 жыл бұрын
Back in the 90s I used a chain of inverters to delay an impulse - a capacitor within that chain would have been an improvement, but the system was slow enough to work anyway.
@voltlog
@voltlog 3 жыл бұрын
Luckily in this case we simply don't care if the EN is delayed a few more tens of miliseconds.
@viniciusfriasaleite8016
@viniciusfriasaleite8016 2 жыл бұрын
I designed an ESP32 board and now I'm troubleshooting it. I hope that will solve! Thank you!
@nomonroe
@nomonroe 2 жыл бұрын
could u troubleshooted it well? would u mind to share it with me?
@TheDefpom
@TheDefpom 3 жыл бұрын
On the ESP32 Devkit v1.0 I install a 2.2uF electrolytic on the EN pin to make it easy to program it, no need to press buttons.
@brucewoods9377
@brucewoods9377 3 жыл бұрын
I think you just solved my problem with another sketch. It fails on one laptop. (An old HP, my grandsons), but not on my old Toshiba nor the really old tower.
@garthberry
@garthberry 3 жыл бұрын
I had a problem with exactly the same programmer symptoms on a custom board. It turned out that the bypass capacitor I had put on the EN (Reset) pin was too big, I swapped the 1uF capacitor out for a 100nF capacitor and I haven't seen the issue on any boards since.
@AttilaAsztalos
@AttilaAsztalos 3 жыл бұрын
An USB log (using Snoopy Pro or similar) would be interesting to see, when the "glitch" does happen. It might just be bad programming on the toolset side which sets the EN pin before resetting the IO and depending on the USB packet timing the IO reset might only arrive a packet later; this would be visible in a trace.
@DavidGranz
@DavidGranz 3 жыл бұрын
Attila, you are correct. It's a problem within esptool.py. See my other comment for details. Of course it can be also fixed by adjusting the hardware reset circuit to account for this glitch.
@TheJoeFletch
@TheJoeFletch 2 жыл бұрын
I am getting the following message. "A fatal error occurred: Could not connect to an Espressif device on any of the 1 available serial ports." I have the VoltLink revE board. Should I try adding the capacitor like you did in this video?
@voltlog
@voltlog 2 жыл бұрын
No, please don't do any modifications to the Voltlink. Search for the problem I things like software, wiring, correct serial port selection, target device as the Voltlink is likely working fine.
@TheJoeFletch
@TheJoeFletch 2 жыл бұрын
@@voltlog I read more about it after I posted this message and I see that RevE has the capacitor. Yes, I agree that the VoltLink is working fine. I can connect to ESP8266 chips. I just cannot connect to ESP32 chips. I have checked wiring many many times. I am just missing something. I have the following pins connected. -3V to 3V -RX to TX -TX to RX -Ground to Ground -IO0 to IO0 From what I understand, the VoltLink will take care of the rest to get the ESP32 into bootloader mode. Do I need to connect the EN pin to make sure that this is working properly? Where does the EN pin get connected to the ESP32?
@voltlog
@voltlog 2 жыл бұрын
@@TheJoeFletch EN pin absolutely must be connected for the auto reset to work. It is usually labeled as EN on ESP32 boards.
@TheJoeFletch
@TheJoeFletch 2 жыл бұрын
@@voltlog if I only have access to an ESP32's ground, RX, TX, 3v and GPIO0 pins, then I don't need to connect GPIO0 to the the VoltLink, just hold ESP32 GPIO0 to ground. Does that sound right?
@voltlog
@voltlog 2 жыл бұрын
@@TheJoeFletch if you want to use the Voltlink the way it was designed to automatically reset the esp32 and put it in the correct boot mode for flashing you need to connect both IO0 and EN
@garywilliams1747
@garywilliams1747 3 жыл бұрын
Mate, you are a absolute gun. Thank you for your time and effort in solving this.
@chrisrowse4598
@chrisrowse4598 3 жыл бұрын
Thanks fro taking the time to research and explain this. Quite obvious once you see the error.
@robbieaussievic
@robbieaussievic 3 жыл бұрын
..... Excellent detective work Mycroft, ( Sherlock's smarter brother ) Intermittent failures are the most difficult to solve across multiple fields. Substitution is my favourite diagnosis tool.
@AndrewJones-tj6et
@AndrewJones-tj6et 3 жыл бұрын
Yes I had that problem with some TTGO ESP32/LoRa boards. They have on board CP2104 USB to UART IC and adding 2uF across the RST/EN to ground got it working reliably. They seem to only have 100nF to ground with a 10k pull-up to 3V3. I've also used similar Heltec boards which work fine.
@voltlog
@voltlog 3 жыл бұрын
I have that combo with 100nF and 10K pull-up on the board shown in the video. This is my standard circuit for reset lines and I use this on pretty much anything I build but in this particular case it didn't do the trick. I think you need at least 470nF for this method to be effective.
@jinaykothari4511
@jinaykothari4511 2 жыл бұрын
Hey is there any other solution for this coz I don’t know how to add capacitor in my NodeMCU board. Please respond me. Love from India
@emmanuelukachukwu5931
@emmanuelukachukwu5931 Жыл бұрын
In my ESP32 S3 can I add it and remove it after uploading the codes
@KiemPlant
@KiemPlant 9 ай бұрын
I figured out that for me it only was able to flash if I removed it from the headers I put it in (luckily I didn't solder it directly to the board). As soon as I put it back in my circuit, it fails. Maybe it has something to do with using the same pin that has the led connected to it as a data output pin. Edit: Yeah that's actually it... "D2: must be LOW during boot and also connected to the on-board LED"
@joacolopezf3340
@joacolopezf3340 Жыл бұрын
hello, im workimg on esp32 wemos d1 r32 and i have the same issue, but specialy this board doesnt hace EN pin, so i dont know how to solve the problem. Can u help me?
@markhannibal5434
@markhannibal5434 3 жыл бұрын
Ha I thought it was normal having to push the boot to program it! Well done you helped me out with this fix - Thankyou. Liked and Subscribed.
@jaykumarmehar4283
@jaykumarmehar4283 2 жыл бұрын
Anything less than 10uF will work?and what about the voltage?
@voltlog
@voltlog 2 жыл бұрын
6.3V minimum
@detyvitanova749
@detyvitanova749 2 жыл бұрын
I connected mine to a 2.0 USB port instead of the 3.0 I had it connected to and it worked.
@jwd.t
@jwd.t 2 жыл бұрын
Hey, nice video. I'd like to ask something. I was having the same issue on an old windows pc (via a USB2 port) then found this video. I have no capacitor at hand so, the first thing I did is to try the ESP32 on another USB port of the same PC which is USB3.0. And Voila ! It worked. Next I tried with that old USB2 port and interestingly the ESP worked this time also. So, I wonder is there any kind of auto correction or syncing system maybe either in ESP32 or the ESPtool for which the system worked the second time?
@doctorfimosis9987
@doctorfimosis9987 2 жыл бұрын
my english not so good, to fix that problem i have to put 10k capacitor to gnd and en? I am right?
@thibo2107
@thibo2107 2 жыл бұрын
I have the same error and i have already added the capacitor but it doesn't fix the error
@rudesindojavieracunasanche8425
@rudesindojavieracunasanche8425 2 жыл бұрын
Just press BOOT button while you see uploading dots until the error occurs
@srilaprabhupadakripa_official
@srilaprabhupadakripa_official 2 жыл бұрын
Thanks sir, really it did help and that too @ cruicial time. I tried using 47uF but then it misses the pulse. 1uF is the perfect fix
@sreejithp2939
@sreejithp2939 9 ай бұрын
problem didn't solved, i just added 47uf 25v capacitor, same error occured
@adikamalikfajar6976
@adikamalikfajar6976 2 ай бұрын
omg its works for me thanks man❤❤❤
@shawntaylor9509
@shawntaylor9509 3 жыл бұрын
Worked for me! Thanks!
@shawntaylor9509
@shawntaylor9509 3 жыл бұрын
Ok, now I have A fatal error occurred: Timed out waiting for packet content
@javafix5167
@javafix5167 3 жыл бұрын
gpi 00 + GND, Я так прошиваю с такой ошибкой esp32 uno.
@MrBobWareham
@MrBobWareham 3 жыл бұрын
Thank you
@smartcomposting
@smartcomposting 3 жыл бұрын
it"s so painfull my friend
@antonmilosevic
@antonmilosevic 3 жыл бұрын
Hate this type of stuff.. there was s similar type of stuff with flashing an arduino with another arduino
@gjergjkastro9404
@gjergjkastro9404 3 жыл бұрын
It happened to me with esp8266
@electronic7979
@electronic7979 3 жыл бұрын
👍
@emmanuelukachukwu5931
@emmanuelukachukwu5931 Жыл бұрын
In my ESP32 S3 can I add it and remove it after uploading the codes
@hasanalfarah5525
@hasanalfarah5525 Жыл бұрын
Thank you
@hasanalfarah5525
@hasanalfarah5525 Жыл бұрын
Thank you
How to fix errors while uploading the program on the ESP8266 NodeMCU
20:33
Electronics Simplified
Рет қаралды 85 М.
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
miniaturizar ESP32 - REDUCIR TAMAÑO para PROYECTOS. -  UTSOURCE
28:25
Fixing a hardware ESP32 Upload problem
4:16
XTronical
Рет қаралды 89 М.
I Automated My PCB Testing and Saved 15X Time
13:18
VoltLog
Рет қаралды 5 М.
[RESOLVIDO] - Failed to connect to ESP32: No serial data received.
3:03
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН