2
\$\begingroup\$

I have created my own PCB design using the ESP8266EX chip. I received my first prototypes and am in the process of testing them.

I am using Raspberry Pi and espotool.py to communicate and program the ESP8266EX chip. The connections are made according to this article here. I have tested this with ESP-01 module and it is working fine.

First I did not have any communication with ESP because of some mistake on the board that I have now corrected. Then the esptool.py failed in "Connecting..." part.

Now it seems that esptool.py can communicate with the chip (it can detect chip, frequency, MAC address etc.), but it is still having some error which I don't understand. The output of the esptool.py is as follows:

pi@RF:~/active_projects/IoT-jar $ ./reset_pcb.py
pi@RF:~/active_projects/IoT-jar $ ./program_pcb.py 
pi@RF:~/active_projects/IoT-jar $ sudo python3 
/home/pi/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py --port 
/dev/ttyS0 --before default_reset --after hard_reset flash_id
esptool.py v2.8
Serial port /dev/ttyS0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: e8:db:84:da:21:fd
Uploading stub...
Running stub...
Stub running...

A fatal error occurred: Timed out waiting for packet header

I would like to know what does this timeout of packet header mean and what packet is this? Is this related to QSPI maybe? I have measured the UART TX line with scope and I saw that there is data sent on that line so that should not be the problem.

The design is working on 2.8V which again should be fine because I have tested the ESP-01 module on 2.8V.

EDIT: I've added a picture of my schematics design so maybe this will help in troubleshooting the issue.

ESP schematics design

I have now also tried various baud rates (9600,19200, 58600) and with argument --no-stub, but it is still giving the same results.

\$\endgroup\$
9
  • \$\begingroup\$ Insufficient capacitance on the power rail? \$\endgroup\$
    – Kartman
    Commented Jul 3, 2021 at 14:52
  • \$\begingroup\$ I have 2x1uF ceramic caps on the VDDD, VDDA, VDDA lines and 10uF and 0.1uF caps on VDD3P3 lines. This is based on the reference design. I can try adding more ofcourse. \$\endgroup\$
    – rongard
    Commented Jul 3, 2021 at 15:33
  • \$\begingroup\$ Are you sure you have the correct port? How exactly are you connecting the ESP to your host computer? \$\endgroup\$ Commented Jul 4, 2021 at 11:24
  • \$\begingroup\$ I'm using RPi for programming and I'm connecting as according to the instructions (link shared above). The same connection works when I use ESP-01 module. I think if it was a wrong port then it would not be able to read any information from ESP, but as you can see above it can correctly identify the chip, operating frequency, MAC address etc. If you meant how I physically connect to the ESP then this is made using this JTAG cable. \$\endgroup\$
    – rongard
    Commented Jul 6, 2021 at 7:00
  • \$\begingroup\$ If there is any problem with QSPI memory then would that affect the ESP in such a way? I mean if I use "chip_id" or "read_mac" commands with esptool.py then these commands should work fine (because they read info only from ESP) even if the memory is not working. I ask because I am getting the same results with those commands so that would tell me that the problem must be related to the ESP itself. \$\endgroup\$
    – rongard
    Commented Jul 6, 2021 at 9:22

1 Answer 1

3
\$\begingroup\$

I found out the problem. The issue was that I had made a mistake in the design and had routed flash memory signals wrong - I had mixed up the CMD and CLK traces coming from the ESP8266EX chip.

So for anyone who is encountering the same problem - you might get this "Timeout waiting for packet header" fault even if your ESP chip is working fine, but cannot communicate with flash memory.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ rongard - Hi, Thanks for coming back with an answer to your question. In order to mark the topic as solved, please consider "accepting" your answer. Then your question is shown as having an accepted answer in various lists and in search results, we helps future readers, and we don't get nagged for it being a question with an unaccepted answer. Thanks. \$\endgroup\$
    – SamGibson
    Commented Jul 23, 2021 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.