Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: waiting for packet content #491

Closed
DreamingRaven opened this issue Jul 7, 2017 · 59 comments
Closed

Fatal error: waiting for packet content #491

DreamingRaven opened this issue Jul 7, 2017 · 59 comments

Comments

@DreamingRaven
Copy link

DreamingRaven commented Jul 7, 2017

The Setup

OS: Windows 8.1
Using: Arduino IDE (Compilation and Uploading)
Sketch: Example "WiFiClient"
Board: "ESP32 Dev Module" (ESP-WROOM-32, ESP32D0WDQ6))
Flash Frequency: "80MHz"
Upload Speed: "115200"
Core Debug: "None"
Port: "COM5" (although will change)
Board Status in IDE: image

ESP32 Module Soldered and Wired on:
20170707_170537

USB to TTL Wiring:
Black-Ground
Red-3.3V
Yellow -TXD pin on adapter (USB-2-TTL), RXD pin on ESP32
Blue -RXD pin on adapter, TXD pin on ESP32
20170707_171402

The Error

Sequence of Events: Compile>Upload Start>Wait for "Connecting">Put ESP32 into Bootloader Manually>Wait>Error
image
"A fatal error occured: timed out waiting for packet content"

Attempted and Failed Solutions

In each attempted solution, settings were reverted back to those in "The Setup" section, and were not changed unless specified in numbered bullet point.

  1. Set Upload Speed to 921600.
  2. Set Flash Frequency to 40MHz.
  3. Using a Different USB to TTL adapter.
  4. Using a Different Sketch.
    Edit:
  5. 3.3v to EN pin.
  6. Using esptool directly.
  7. Uncompressed upload.
  8. Holding down 1O0 during power on to keep ESP in boot-loader.
  9. Changing flash modes QIO DIO etc.
  10. "Strapping" IO12 to ground.
  11. 1k resistor between 3V3 and IO12.
  12. 330uf 25V capacitor between 3V3 and GND.

Query

I cannot find the specific documentation on this error message, so that I could properly debug the problem. Since it gets past the packet header stage, I assume everything prior is working. Should I be doing something differently? What could be causing this problem?

Success

For whatever reason, the first ESP was not working, maybe due to poor soldering/ heat damage, or a plethora of other reasons, but upon getting a second ESP (different breakout board from different manufacturer) it worked almost immediately. Now I just need to ensure it doesn't brownout and the sketches work properly, and everything should be solved.

@copercini
Copy link
Contributor

copercini commented Jul 7, 2017

It's your first upload?
try set Upload Speed to 115200 for the first time

When it appears "Connecting......._____...." try press and hold the IO0 button for 2 or 3 seconds (just necessary on the first upload)

Also: Nice board setup and issue report!

@DreamingRaven
Copy link
Author

DreamingRaven commented Jul 7, 2017

Yeah its my first time with ESP32 and flashing it like this, although in the past ive used ESP8266 Feather, but that was so streamlined for stuff like this. Now i have the horror of finding EN, since i soldered the labels between the breakout and vero board XD
Edit:
Thank you for the compliments!
Also I just realised what you meant, yes its the first flash of this particular ESP32

@copercini
Copy link
Contributor

I checked your adapter board on google and it have an internal VCC to EN connection, so no worry about it

@DreamingRaven
Copy link
Author

Il try the EN pin anyway in a sec.

@DreamingRaven
Copy link
Author

DreamingRaven commented Jul 7, 2017

My quick test with 3.3v on EN did not work, but I need to double check i have the right pin since i cant see the labels.

@DreamingRaven
Copy link
Author

DreamingRaven commented Jul 7, 2017

Just checked, and yeah it was the right pin. Im going to make sure this new connection is providing a voltage diff, before I continue.
Edit: it is, 2.6/2.7v across gnd & EN
Also on repeating the test I got the following,
image At the moment I reset the board and held down IO0, to manually put it into bootload as I have several times before. Probably a one off, but documenting it anyway.
Even later Edit: Yeah definitely a one off.

@DreamingRaven
Copy link
Author

Also was looking through espressif/esptool and found espressif/esptool#213 still looking through the issues over there for anything similar, havent found one that is after compression stage.

@DreamingRaven
Copy link
Author

DreamingRaven commented Jul 7, 2017

I think the next best possible approach is to create the Binaries and use esptool directly, and hopefully this will be more verbose than the Arduino IDE. Now to read about that usage.

@lonerzzz
Copy link
Contributor

@DreamingRaven Are there any updates to this issue? Is there still some information you need or can we close this?

@DreamingRaven
Copy link
Author

No luck as yet, still getting the same error as previously, and ive been slowly trying esptool.py directly where I can.

@DreamingRaven
Copy link
Author

20170816_224117
I've also been using an oscilloscope and multimeter to verify that the power is not the problem. Which it does not appear to be.

@DreamingRaven
Copy link
Author

I have been slowly attempting different things, I'm just praying it is not a manufacturing defect because that would be a pain to diagnose. Otherwise the chip seems to be communicating fine, stub uploads and runs, its just after compression, it times out "waiting for packet content". :/
image

@DreamingRaven
Copy link
Author

image
Suppressing compression using esptool leads to the same result above.

@DreamingRaven
Copy link
Author

Ok so now i'm just gonna go through the gotchas in https://nodemcu.readthedocs.io/en/master/en/flash/ and eliminate anything that fits. Can anyone see anything im doing wrong so far?

@me-no-dev
Copy link
Member

Make sure GPIO12 is pulled LOW. I have the feeling yours is not and its trying to boot the flash at 1.8V

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

@me-no-dev What makes you say that? What is the significance of IO12? Looking through the data sheet, i see no significant mentions of IO12, it just seems to be a normal IO pin, but im a newcomer to this specific chip, I dont know its ins and outs yet. Il check in a second the Vdif across IO12, its a pain to find the pins due to labels being between module and vero board :/

@igrr
Copy link
Member

igrr commented Aug 17, 2017 via email

@DreamingRaven
Copy link
Author

I must be looking at the wrong data sheet. (http://akizukidenshi.com/download/ds/espressifsystems/esp_wroom_32_datasheet_en.pdf)
There is no section 2.4 on this one:
image
Let me just find the latest one.

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

Yeah just got August 10 2017 datasheet (https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf),
I assume GPIO12 is MTDI
image

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

Yeah looks like it is high,
image
Excuse the imprecision of the oscilloscope (at 1.32v), but multi meter confirms it at ~1.8 but then drops to 0.8 (I assume because of the dodgy prong conection).

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

Let me just confirm that this is the correct pin. As I am assuming I followed the right trace. I need to find the labels for the breakout board (https://www.amazon.co.uk/gp/product/B06Y1LMJCD/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1) which are a royal pain to find any information about. I am very reluctant to desolder the entire thing off to find the labels on the back

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

No i had the wrong one the first time, although it is the last pin, the trace actually takes it to the second to last pin, rather than the last pin which i had connected.

What i believe currently is IO12, so that others can also see, and correct me if I am mistaken (in red):
image

Edit: after some confusion, the pin is actually on the opposite side (bottom of left hand solder contacts).

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

I must admit however I am strugling to understand the pinout diagrams in the latest data sheet, as it looks nothing like my current module:
image

Compared to the older data sheet:
image

The problem with the older data sheet is that it puts the TxD and RxD on the other side of the board to which this chinese breakout board has labeled as TxD and RxD.

I found a picture of the back of the module when I bought it !!! :
image

The breakout board could be mis-labeled!

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

Also my apologies to everyone, i'm posting relentlessly so that in the future both I and others can see the mistakes I made, and my (erratic) thought process.
What I can tell so far is that, unless the traces sneakily go to the other side, RxD and TxD should not be on the same side as 3.3v. Since the board has a high probability of being mis labeled, I will try ignoring what labels on the board I can see, and use only the modules labels + trace following to find the (hopefully) correct pins.
On a side not, Ground was accidentally connected wrong (somehow still powering the board), but it makes no difference to the "timed out waiting for packet content" error.
If RxD and TxD are labelled wrong however it could explain why the upload fails, but what it doesn't explain is why the upload gets so far? According to the modules labels above, what I have been using up untill now is not TxD and RxD but instead TxD and IO21. Oh jesus the labels were so wrong according to the modules labels, how has the ESP32 even worked up untill this point???? Il take 10 minutes to lament and then I will rewire everything to attempt to fix it.

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

Ok after trace following and relying soley on the modules labels, I have found that this breakout board was not mis labelled, but instead 3.3v and gnd are connected to pins on the opposite side.
Where pink is connected to 3.3v, black is grnd and blue, green are TxD and RxD respectiveley.
colourcoded
The traces do not show any connection to the top right, but I assume on the back the traces would go from 3.3v to that pin. So, I am no further with the exception that I have found IO12, but it appears to be pulled low by an adjacent gnd (white)

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

@me-no-dev I have "strapped" IO12 to ground (it also appears to be on board level, connected to ground through the white line, but this cant possibly be the case due to a later concern with pulling MTDI low), but there was no change in error message:

image

There was one odd thing that occurred however, while I manually strapped IO12 the serial port was recieving the following from the ESP32:

image

Edit:
After further investigation, you are not meant to be strapping MTDI (IO12) to ground as it will cause the chip to drop below operating voltage and reset. espressif/esp-idf#113

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

I don't know where to go now. What is causing this error, timeout; packet content? I'm really excited to make stuff with the ESP32 but its been weeks with minimal progress made trying to solve this issue and its incredibly frustrating.

@me-no-dev
Copy link
Member

I have had the same exact issue a couple of days back and it came to be the bootstrapping of pin12 (MTDI) and I mean like 100% the same exact problem. Can you confirm that GPIO12 is low at boot/into-download modes?

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 17, 2017

Yeah il double check tomorrow, its getting pretty late here.

Edit: i'm back, testing now!

@me-no-dev
Copy link
Member

Above you show GPIO tied to GND and that is not the right configuration!!! Needs to be tied to VCC

@me-no-dev
Copy link
Member

use 1K resistor between IO12 and VCC

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 27, 2017

To confirm what I am testing, you are saying:
text4629

I'l test this shortly.
I will also (after testing) add a 330uf 25v capacitor between 3.3V and GND to make sure its not a stability issue from the UART bridge.

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 27, 2017

First test, made no change, let me just check that everything is correctly implemented.
And give it another try.

@DreamingRaven
Copy link
Author

Ok so I got a second ESP32 and soldered it (less fancy than last). I used the example ESP32 sketch GetChipID, with no alterations. Compiled and attempted upload. Low and behold, the exact same error message.
20170829_123612

text4619

image

@DreamingRaven
Copy link
Author

What could this mean, in terms of source of the problem.

  • Soldering Connection Issue; Less likely to occur in both boards soldered seperateley and differently.

  • Chip Manufacturing Issue; Less likely due to the problem being highly improbable to occur twice, on two separate chips and batches.

  • Wrong Connections; Same probability since, both chips are wired to the same (above) circuit diagram.

  • Faulty UART bridge; Unlikely, since two separate and different boards were used, of different designs and manufacturers.

  • Sketch Issue; very low probability, as many different example sketches have been tested so far, with many different configurations.

  • Tool Issue; Highly likely, as bugs are frequent in most programs, and exhaustive testing likely has not occurred, as unreasonable/ impossible.

Have I missed anything?

@DreamingRaven
Copy link
Author

I think, it may be best to scrap using arduino and esptool.py all together, and use something else, as the two most likely causes are wrong connections or a tool issue. Since I heuristically assume that between these two a tool based bug, is the most probable (debian, windows 8.1, arduino, esptool.py).

@me-no-dev
Copy link
Member

There surely is nothing wrong with Arduino and esptool.py ;) Arduino is on top of IDF and IDF and esptool are the official tools to work on esp32. Something totally hardware is going on

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 29, 2017

I'm just not sure what more I can try hardware wise. I have read through so much documentation, and followed so many guides, I don't know what other options I have left.
EDIT: ^Iz doofus
EDIT2: well it was a hardware issue, you were right. But this still doesn't solve why the first ESP doesn't work, but at-least something works.

@DreamingRaven
Copy link
Author

:O
IT WORKED!

@DreamingRaven
Copy link
Author

image
HOLY WHUT

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 29, 2017

I just took out the resistor, and it works. _
text4619

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 29, 2017

let me just repeat with a different more advanced sketch, to make sure this is not just some weird fluke.
Edit: Its not some weird fluke, the esp_ wifi sketch is uploading normally too. WOOO

@JustAmaze
Copy link

well done ! Did you boot up your module and see it run properly with wifi sketch?

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 29, 2017

Sorry for the delay, I went away and made some creme brulees. I did but im getting "brownout detector was triggered" in serial console. Which to my understanding means, the resistance in the jumper cables/ breadboard, is too high (or the UART bridge doesn't supply enough). Now to go solve that, but i'm happy that I've finally managed to upload!!!!!!

@DreamingRaven
Copy link
Author

DreamingRaven commented Aug 29, 2017

Maybe il power it from something a little more expandable, so I can put in some quality of life features, like power LED, and battery power etc etc. Kill two birds with one stone. Maybe I should flash it with an OTA sketch first, just in case. But il need to check that ESP32 can update OTA, I may be mis-remembering / watched something outdated that said it couldn't, just need to confirm that. Although I don't see why it wouldn't be able to.

@elucas2uy
Copy link

elucas2uy commented Sep 28, 2017

Hi DreamingRaven, I´m seeing the same behavior here... exactly the same one... 2x esp32 with the same problem, after "backs and forwards" the first one back to life (no much explanation how it happened), and after that no problem at all... the second one still not working.
There should be some kind of explanation.

What I cant see (and is some kind of strange to me) is that when the problem is present, Testing resistance between 3v3 and GND in too low (much lower than the usual one in the working boards)...
**After some hours disconnected this resistance start "going" to the normal one ! **..... and reconnecting it to power it works fine for some seconds, and after that the problem start again.

Also, when the problem is present and the ESP energized (strong 3,3v soldered and stable), the EN (that is poll UP with a 10K resistor) shows almost no voltage.

Apparently, at this state something is happening inside the module or the chip itself (I did not uncover the module to take measures at the chip pins)

I don´t care about the this ESP32 itself, but I definitely care about know what is the logic around this (or how to avoid the problem in the future)....
So my questions:

  1. Did you figure it out how did you solve it ? ...as you said, You previously try the exactly same configuration that finally worked... wasn´t it?
  2. Do you remember if you change something else when it start working (the second ESP 1st time, and the first ESP 2nd time). What was it?

As you previously said: "I'm just not sure what more I can try hardware wise. I have read through so much documentation, and followed so many guides, I don't know what other options I have left."
Tks

@elucas2uy
Copy link

elucas2uy commented Sep 28, 2017

The issue is similar to: espressif/esp-idf/issues/113

@elucas2uy
Copy link

Additionally, @me-no-dev wrote ...
first: "Make sure GPIO12 is pulled LOW. I have the feeling yours is not and its trying to boot the flash at 1.8V" and "Can you confirm that GPIO12 is low at boot/into-download modes?"

later: "Above you show GPIO tied to GND and that is not the right configuration!!! Needs to be tied to VCC" and "use 1K resistor between IO12 and VCC".

Just to clarify, the first one (ie GPIO12 pulled LOW) is the correct one, right?

Tks

@elucas2uy
Copy link

Hi again,
Following the @igrr comment on #espressif/esp-idf#958

If you have flash read err, 1000 error continuously after reset, please check that you don't have any external signals connected to SPI flash pins of the ESP32 (pins 6-11). If you don't have anything connected to these pins, it means that your SPI flash chip may have been damaged.

I have found some flux not cleaned in both boards and ESPs. After cleaning them correctly both start working fine!
Hope this could help somebody else with this same or similar issue..

Note: I do not understand why the module have this behavior but surely is something related to unexpected conductivity between some pins (I could not conclude which of them).

@DreamingRaven
Copy link
Author

DreamingRaven commented Oct 31, 2017

Hey @elucas2uy , sorry for the late response, I think It may actually have been the breakout board I was using, because well.. I don't seem to replicate the failure with my other boards (several now), despite the same configuration. Glad it worked for you in the end. Also happy Halloween!

@DreamingRaven
Copy link
Author

@elucas2uy, If you need me or if anyone else needs me to list my pin voltages for a working configuration I will. Its just a pain in the rear now that its integrated into other stuff. Although I may do it for my own reference and post it anyway.

@LouDnl
Copy link

LouDnl commented Jul 26, 2019

I have the MH-ET LIVE (http://mh.nodebb.com/topic/2/mh-et-live-esp32-devkit).
It is impossible to program it through USB, haven't figured out why yet.
But your post made me hook up an FT232R to the boards pins as you describe and low and behold I can program it. Thanks a lot!!

Now to figure out why the USB program doesnt work.

I just took out the resistor, and it works. _
text4619

@DreamingRaven
Copy link
Author

Nice one! I hope it all goes well! If I remember correctly I had issue with my program when I flashed it as well, although I'm afraid I cant remember how I overcame it as it was two years ago now, wow time flies. Good luck!

@Daemach
Copy link

Daemach commented Jul 26, 2019 via email

@LouDnl
Copy link

LouDnl commented Aug 5, 2019

@DreamingRaven Yeah it took me a while to figure out what was wrong, but it works now.
@Daemach I tried with a capacitor from EN to ground, haven't tried a resistor from EN to 3.3v. Might give that a go.

@darkbull
Copy link

Connect to GPIO12 to GND save my problem. More info can found: https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants