Skip to content

Commit 2143c09

Browse files
committed
Doc - mention esptool.FatalError & syntax corrections
1 parent 0ecb6f0 commit 2143c09

File tree

2 files changed

+112
-16
lines changed

2 files changed

+112
-16
lines changed

doc/faq/a01-espcomm_sync-failed.rst renamed to doc/faq/a01-upload-failed.rst

Lines changed: 109 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:orphan:
22

3-
I am getting "espcomm\_sync failed" error when trying to upload my ESP. How to resolve this issue?
4-
--------------------------------------------------------------------------------------------------
3+
Why I am getting errors when trying to upload to my ESP?
4+
--------------------------------------------------------
55

66
- `Introduction <#introduction>`__
77
- `Initial Checks <#initial-checks>`__
@@ -15,14 +15,24 @@ I am getting "espcomm\_sync failed" error when trying to upload my ESP. How to r
1515
Introduction
1616
~~~~~~~~~~~~
1717

18-
This message indicates issue with uploading ESP module over a serial
18+
Messages like
19+
20+
* ``espcomm_sync failed``
21+
22+
* ``esptool.FatalError: Failed to connect to ESP8266: Invalid head of packet (0xF0)``
23+
24+
* ``esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header``
25+
26+
indicate issue with with uploading ESP module over a serial
1927
connection. There are couple of possible causes, that depend on the type
2028
of module, if you use separate USB to serial converter, what parameters
2129
are selected for upload, etc. As result there is no single answer on the
2230
root cause. To find it out you may need to complete couple of
2331
troubleshooting steps.
2432

25-
Note: If you are just starting with ESP, to reduce potential issues
33+
.. note::
34+
35+
If you are just starting with ESP, to reduce potential issues
2636
with uploading, select ESP board with integrated USB to serial
2737
converter. This will considerably reduce number of user depended
2838
factors or configuration settings that influence upload process.
@@ -167,7 +177,93 @@ loading <../boards.rst#minimal-hardware-setup-for-bootloading-only>`__
167177
during: upload* and try uploading again. For successful upload this
168178
log should look similar to example shown below:
169179

170-
``C:\Users\Krzysztof\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.8/esptool.exe -vv -cd ck -cb 115200 -cp COM3 -ca 0x00000 -cf C:\Users\KRZYSZ~1\AppData\Local\Temp\build7e44b372385012e74d64fb272d24b802.tmp/Blink.ino.bin esptool v0.4.8 - (c) 2014 Ch. Klippel <[email protected]> setting board to ck setting baudrate from 115200 to 115200 setting port from COM1 to COM3 setting address from 0x00000000 to 0x00000000 espcomm_upload_file espcomm_upload_mem setting serial port timeouts to 1000 ms opening bootloader resetting board trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload read 0, requested 1 trying to connect flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 2 bytes of data espcomm_send_command: receiving 2 bytes of data espcomm_send_command: receiving 2 bytes of data espcomm_send_command: receiving 2 bytes of data espcomm_send_command: receiving 2 bytes of data espcomm_send_command: receiving 2 bytes of data espcomm_send_command: receiving 2 bytes of data espcomm_send_command: receiving 2 bytes of data Uploading 226368 bytes from to flash at 0x00000000 erasing flash size: 037440 address: 000000 first_sector_index: 0 total_sector_count: 56 head_sector_count: 16 adjusted_sector_count: 40 erase_size: 028000 espcomm_send_command: sending command header espcomm_send_command: sending command payload setting serial port timeouts to 15000 ms setting serial port timeouts to 1000 ms espcomm_send_command: receiving 2 bytes of data writing flash .............................................................................................................................................................................................................................. starting app without reboot espcomm_send_command: sending command header espcomm_send_command: sending command payload espcomm_send_command: receiving 2 bytes of data closing bootloader flush start setting serial port timeouts to 1 ms setting serial port timeouts to 1000 ms flush complete``
180+
For example, uploading using esptool.py and esptool
181+
182+
.. code-block:: console
183+
184+
$ esptool.py --after no_reset --chip esp8266 --baud 460800 write_flash 0x0 d1-mini-firmware.bin
185+
esptool.py v4.5.1
186+
Found 1 serial ports
187+
Serial port /dev/ttyUSB0
188+
Connecting....
189+
Chip is ESP8266EX
190+
Features: WiFi
191+
Crystal is 26MHz
192+
MAC: 11:22:33:44:55:66
193+
Uploading stub...
194+
Running stub...
195+
Stub running...
196+
Changing baud rate to 460800
197+
Changed.
198+
Configuring flash size...
199+
Flash will be erased from 0x00000000 to 0x0004efff...
200+
Compressed 321440 bytes to 221714...
201+
Wrote 321440 bytes (221714 compressed) at 0x00000000 in 5.0 seconds (effective 511.4 kbit/s)...
202+
Hash of data verified.
203+
204+
Leaving...
205+
Staying in bootloader.
206+
207+
208+
.. code-block:: console
209+
210+
> C:\Users\Krzysztof\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.8/esptool.exe -vv -cd ck -cb 115200 -cp COM3 -ca 0x00000 -cf C:\Users\KRZYSZ~1\AppData\Local\Temp\build7e44b372385012e74d64fb272d24b802.tmp/Blink.ino.bin
211+
esptool v0.4.8 - (c) 2014 Ch. Klippel <[email protected]>
212+
setting board to ck
213+
setting baudrate from 115200 to 115200
214+
setting port from COM1 to COM3
215+
setting address from 0x00000000 to 0x00000000
216+
espcomm_upload_file
217+
espcomm_upload_mem
218+
setting serial port timeouts to 1000 ms
219+
opening bootloader
220+
resetting board
221+
trying to connect
222+
flush start
223+
setting serial port timeouts to 1 ms
224+
setting serial port timeouts to 1000 ms
225+
flush complete
226+
espcomm_send_command: sending command header
227+
espcomm_send_command: sending command payload
228+
read 0, requested 1
229+
trying to connect
230+
flush start
231+
setting serial port timeouts to 1 ms
232+
setting serial port timeouts to 1000 ms
233+
flush complete
234+
espcomm_send_command: sending command header
235+
espcomm_send_command: sending command payload
236+
espcomm_send_command: receiving 2 bytes of data
237+
espcomm_send_command: receiving 2 bytes of data
238+
espcomm_send_command: receiving 2 bytes of data
239+
espcomm_send_command: receiving 2 bytes of data
240+
espcomm_send_command: receiving 2 bytes of data
241+
espcomm_send_command: receiving 2 bytes of data
242+
espcomm_send_command: receiving 2 bytes of data
243+
espcomm_send_command: receiving 2 bytes of data
244+
Uploading 226368 bytes from to flash at 0x00000000
245+
erasing flash
246+
size: 037440 address: 000000
247+
first_sector_index: 0
248+
total_sector_count: 56
249+
head_sector_count: 16
250+
adjusted_sector_count: 40
251+
erase_size: 028000
252+
espcomm_send_command: sending command header
253+
espcomm_send_command: sending command payload
254+
setting serial port timeouts to 15000 ms
255+
setting serial port timeouts to 1000 ms
256+
espcomm_send_command: receiving 2 bytes of data
257+
writing flash ..............................................................................................................................................................................................................................
258+
starting app without reboot
259+
espcomm_send_command: sending command header
260+
espcomm_send_command: sending command payload
261+
espcomm_send_command: receiving 2 bytes of data
262+
closing bootloader
263+
flush start
264+
setting serial port timeouts to 1 ms
265+
setting serial port timeouts to 1000 ms
266+
flush complete
171267
172268
Upload log may be longer depending on number of connection attempts made
173269
by esptool. Analyze it for any anomalies to configuration you have
@@ -177,7 +273,7 @@ rate, etc. Resolve all noted differences.
177273
Reset Methods
178274
~~~~~~~~~~~~~
179275

180-
If you got to this point and still see ``espcomm_sync failed``, then now
276+
If you got to this point and still see uploading error, then now
181277
you need to bring in the heavy guns.
182278

183279
Connect scope or logic analyzer to GPIO0, RST and RXD pins of the ESP to
@@ -238,13 +334,13 @@ Each retry is reported in upload log as follows:
238334

239335
resetting board
240336
trying to connect
241-
flush start
242-
setting serial port timeouts to 1 ms
243-
setting serial port timeouts to 1000 ms
244-
flush complete
245-
espcomm_send_command: sending command header
246-
espcomm_send_command: sending command payload
247-
read 0, requested 1
337+
flush start
338+
setting serial port timeouts to 1 ms
339+
setting serial port timeouts to 1000 ms
340+
flush complete
341+
espcomm_send_command: sending command header
342+
espcomm_send_command: sending command payload
343+
read 0, requested 1
248344

249345
Presented circuit has one important limitation when it comes to work
250346
with Arduino IDE. After opening Serial Monitor (Ctrl-Shift-M), both RTS

doc/faq/readme.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Please feel free to contribute if you believe that some frequent issues
1313
are not covered below.
1414

1515

16-
I am getting "espcomm\_sync failed" error when trying to upload my ESP. How to resolve this issue?
17-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
I am getting "espcomm\_sync failed", "esptool.FatalError", etc. How to resolve this issue?
17+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1818

1919
This message indicates issue with uploading ESP module over a serial
2020
connection. There are couple of possible causes, that depend on the type
2121
of your module, if you use separate USB to serial converter.
2222

23-
`Read more <a01-espcomm_sync-failed.rst>`__.
23+
`Read more <a01-upload-failed.rst>`__.
2424

2525
Why esptool is not listed in "Programmer" menu? How do I upload ESP without it?
2626
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)