Skip to content

Commit dd1a7e9

Browse files
krzychbigrr
authored andcommitted
ESP.restart() doesn't work, typo fixes (#2216)
New FAQ item: ESP.restart() doesn't work Write up review / typo fixes
1 parent 31a72ce commit dd1a7e9

File tree

4 files changed

+60
-49
lines changed

4 files changed

+60
-49
lines changed

doc/faq/a01-espcomm_sync-failed.md

+29-25
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Example boards with USB to serial converter build in, that will make your initia
2828

2929
![Example boards with integrated USB to serial converter](pictures/a01-example-boards-with-usb.png)
3030

31-
If you are using a Generic ESP8266 module, separate USB to serial converter and connect them by yourself, please make sure you have the following tree things right:
31+
If you are using a Generic ESP8266 module, separate USB to serial converter and connect them by yourself, please make sure you have the following three things right:
3232
1. Module is provided with enough power,
3333
2. GPIO0, GPIO15 and CH_PD are connected using pull up / pull down resistors,
3434
3. Module is put into boot loader mode.
@@ -58,9 +58,9 @@ In order to troubleshoot "espcomm_sync failed" error, please proceed step by ste
5858

5959
![Board selection](pictures/a01-board-selection.png)
6060

61-
Basing on selected board type Arduino IDE will apply specific "reset method" to enter the board into boot-loading mode. Reset methods are board specific. Some boards do not have the h/w in place to support reset by Arduino IDE. If this is the case, you need to enter such board into boot loading mode manually.
61+
Basing on selected board type, Arduino IDE will apply specific "reset method" to enter the board into boot loading mode. Reset methods are board specific. Some boards do not have the h/w in place to support reset by Arduino IDE. If this is the case, you need to enter such board into boot loading mode manually.
6262

63-
4. Upload may be also failing due to too high speed. If you have long or poor quality USB cable, try reducing selection under Upload Speed.
63+
4. Upload may be also failing due to too high speed. If you have long or poor quality USB cable, try reducing selection under *Upload Speed*.
6464

6565
![Serial speed selection](pictures/a01-serial-speed-selection.png)
6666

@@ -77,19 +77,19 @@ In order to troubleshoot "espcomm_sync failed" error, please proceed step by ste
7777
ets Jan 8 2013,rst cause:2, boot mode:(1,7)
7878
```
7979

80-
If you see similar message but different values then decode them using [Boot Messages and Modes](../boards.md#boot-messages-and-modes). The key information is contained in first digit of the boot mode message as shown below.
80+
If you see similar message but different values then decode them using [Boot Messages and Modes](../boards.md#boot-messages-and-modes). The key information is contained in first digit / three right-most bits of the boot mode message as shown below.
8181

8282
![Decoding of boot mode](pictures/a01-boot-mode-decoding.png)
8383

8484
For instance message ``` boot mode (3,3) ``` indicates that pins GPIO2 and GPIO0 are set HIGH and GPIO15 is set LOW. This is configuration for [normal operation](../boards.md#minimal-hardware-setup-for-running-only) of module (to execute application from flash), not for [boot loading](../boards.md#minimal-hardware-setup-for-bootloading-only) (flash programming).
8585

8686
> Note: Without having this step right you will not be able to upload your module over a serial port.
8787
88-
2. You have confirmed that module is in boot loading mode but upload still fails. If you are using external USB to serial converter then check of operates correctly by looping it back. This is quite simple check. Just connect TX and RX of your converter together like on picture below. Then open Serial Monitor and type some characters. If everything is fine, then you should see what you type immediately printed back on the monitor. For ESP integrated with USB to serial converter this check may involve breaking some PCB traces. I would not do it unless being desperate. Instead try step below.
88+
2. You have confirmed that module is in boot loading mode but upload still fails. If you are using external USB to serial converter, then check if it operates correctly by looping it back. This is quite simple check. Just connect TX and RX of your converter together like on picture below. Then open Serial Monitor and type some characters. If everything is fine, then you should see what you type immediately printed back on the monitor. For an ESP with USB to serial converter on board, this check may involve breaking some PCB traces. I would not do it unless being desperate. Instead try steps below.
8989

9090
![USB to serial converter loop back](pictures/a01-usb-to-serial-loop-back.png)
9191

92-
3. Next step to try, if not done already, is checking detailed debug messages. Go to File > Preferences, enable *Show verbose output during: upload* and try uploading again. For successful upload this log should look similar to example shown below:
92+
3. Next step to try, if not done already, is checking detailed debug messages. Go to *File > Preferences*, enable *Show verbose output during: upload* and try uploading again. For successful upload this log should look similar to example shown below:
9393

9494
```
9595
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
@@ -152,7 +152,7 @@ In order to troubleshoot "espcomm_sync failed" error, please proceed step by ste
152152
flush complete
153153
```
154154

155-
This log may be longer depending on number of connection attempts made by esptool. Analyze it for any anomalies to configuration you have selected in Arduino IDE, like different serial port, reset method, baud rate, etc. Resolve all noted differences.
155+
Upload log may be longer depending on number of connection attempts made by esptool. Analyze it for any anomalies to configuration you have selected in Arduino IDE, like different serial port, reset method, baud rate, etc. Resolve all noted differences.
156156

157157

158158
### Reset Methods
@@ -161,24 +161,26 @@ If you got to this point and still see ``` espcomm_sync failed ```, then now you
161161

162162
Connect scope or logic analyzer to GPIO0, RST and RXD pins of the ESP to check what's happening.
163163

164-
Then compare your measurements with what is shown on wave-forms collected for circuits below. They document two standard methods of resetting ESP8266 for upload, that you can select in Arduino IDE - [ck](#ck) and [nodemcu](#nodemcu).
164+
Then compare your measurements with wave-forms collected for circuits below. They document two standard methods of resetting ESP8266 for upload, that you can select in Arduino IDE - [ck](#ck) and [nodemcu](#nodemcu).
165165

166166

167167
#### Ck
168168

169-
Circuit below has been prepared to collect wave-forms for ck reset method ([get fzz source](pictures/a01-circuit-ck-reset.fzz)). It is simpler than for [nodemcu](#nodemcu) reset and therefore often used to wire up generic ESP modules on a breadboard. Check it against your wiring when comparing your measurements against wave-forms below .
169+
Circuit below has been prepared to collect wave-forms for ck reset method ([get fzz source](pictures/a01-circuit-ck-reset.fzz)). It is simpler than for [nodemcu](#nodemcu) reset and therefore often used to wire up generic ESP modules on a breadboard. Check it against your wiring when comparing your measurements against wave-forms below.
170170

171171
![Sample circuit to check ck method](pictures/a01-circuit-ck-reset.png)
172172

173-
Wave-forms below show voltage signals on GPIO0 and RST pins of the ESP board when uploading the firmware. Close up of ck reset method signal sequence at the beginning of upload is shown below.
173+
The following wave-forms below show voltage signals on GPIO0 and RST pins of the ESP board when uploading the firmware.
174+
175+
Close up of ck reset method signal sequence at the beginning of upload is shown below.
174176

175177
![Reset Method: ck, close up at the beginning of upload](pictures/a01-reset-ck-closeup.png)
176178

177-
Next picture shows complete upload of blink.ino example at 921600 baud. This is quite high speed so the upload takes only about 8s.
179+
Next picture shows complete upload of [Blink.ino](https://github.com/esp8266/Arduino/blob/master/libraries/esp8266/examples/Blink/Blink.ino) example at 921600 baud. This is quite high speed, so the upload takes only about 8s.
178180

179181
![Reset Method: ck, complete upload](pictures/a01-reset-ck-complete.png)
180182

181-
Please note that when esptool is not able to initialize upload at the first time, then it retries reset procedure. Case of one such retry is shown on waveform below.
183+
Please note that when esptool is not able to initialize upload at the first time, then it retries reset procedure. Case of one such retry is shown on wave-form below.
182184

183185
![Reset Method: ck, complete upload](pictures/a01-reset-ck-complete-1-retry.png)
184186

@@ -196,7 +198,7 @@ trying to connect
196198
read 0, requested 1
197199
```
198200

199-
Presented circuit has one important limitation when it comes to work with Arduino IDE. After opening Serial Monitor (Ctrl-Shift-M), both RTS and DTR lines are permanently pulled down. As RTS line is connected to REST input of ESP, the module is hold in reset state / not able to run. Therefore after uploading module, you need to disconnect both lines or use different serial terminal program that is not pulling down RTS and DTR lines. Otherwise the module will get stuck waiting for releasing the REST signal.
201+
Presented circuit has one important limitation when it comes to work with Arduino IDE. After opening Serial Monitor (Ctrl-Shift-M), both RTS and DTR lines are permanently pulled down. As RTS line is connected to REST input of ESP, the module is hold in reset state / not able to run. Therefore after uploading module, you need to disconnect both lines or use different serial terminal program that is not pulling down RTS and DTR lines. Otherwise the module will get stuck waiting for releasing the REST signal and you will see nothing on the Serial Monitor.
200202

201203
As for different serial terminal program you can check Arduino IDE add-on [Serial Monitor for ESP8266]((https://github.com/esp8266/Arduino/issues/1360)) developed by user [@mytrain](https://github.com/mytrain) and discussed in [#1360](https://github.com/esp8266/Arduino/issues/1360).
202204

@@ -215,33 +217,33 @@ Close up of voltage signals on GPIO0 and RST pins at the beginning of firmware u
215217

216218
![Reset Method: nodemcu, close up at the beginning of upload](pictures/a01-reset-nodemcu-closeup.png)
217219

218-
Please note that the reset sequence takes about 10x shorter comparing to [ck](@ck) reset (about 25ms vs. 250ms).
220+
Please note that the reset sequence is about 10x shorter comparing to [ck](@ck) reset (about 25ms vs. 250ms).
219221

220-
Next picture covers complete upload of blink.ino example at 921600 baud. Except for difference of the reset signal sequence, the complete upload looks similar to that of [ck](@ck).
222+
Next picture covers complete upload of [Blink.ino](https://github.com/esp8266/Arduino/blob/master/libraries/esp8266/examples/Blink/Blink.ino) example at 921600 baud. Except for difference of the reset signal sequence, the complete upload looks similar to that of [ck](@ck).
221223

222224
![Reset Method: nodemcu, complete upload](pictures/a01-reset-nodemcu-complete.png)
223225

224-
A sample wave-form below shows another upload of blink.ino example at 921600 baud but with two reset retries.
226+
A sample wave-form below shows another upload of [Blink.ino](https://github.com/esp8266/Arduino/blob/master/libraries/esp8266/examples/Blink/Blink.ino) example at 921600 baud, but with two reset retries.
225227

226228
![Reset Method: nodemcu, reset retries](pictures/a01-reset-nodemcu-complete-2-retries.png)
227229

228-
If you are interested how noodemcu reset method is implemented, so it does not pull to ground RTS and DTR lines once you open Serial Monitor in Arduino IDE, then check circuit below.
230+
If you are interested how noodemcu reset method is implemented, then check circuit below. As indicated it does not pull to ground RTS and DTR lines once you open Serial Monitor in Arduino IDE.
229231

230232
![Implementation of noodemcu reset](pictures/a01-nodemcu-reset-implementation.png)
231233

232-
It consists of two transistors and resistors that you can locate on NodeMCU board on right. On left you can see complete circuit and the truth table how RTS and DTR signals of the serial interface are translated to REST and GPIO0 on the ESP. For more details please refer to [nodemcu](https://github.com/nodemcu/nodemcu-devkit) repository on GitHub.
234+
It consists of two transistors and resistors that you can locate on NodeMCU board on right. On left you can see complete circuit and the truth table how RTS and DTR signals of the serial interface are translated to RST and GPIO0 on the ESP. For more details please refer to [nodemcu](https://github.com/nodemcu/nodemcu-devkit) repository on GitHub.
233235

234236

235237
### I'm Stuck
236238

237239
Hopefully at this point you were able to resolve ``` espcomm_sync failed ``` issue and now enjoy quick and reliable uploads of your ESP modules.
238240

239-
If this is still not the case then review once more all discussed steps in the checklist below.
241+
If this is still not the case, then review once more all discussed steps in the checklist below.
240242

241243
**Initial Checks**
242244
* [ ] Is your module connected to serial port and visible in IDE?
243245
* [ ] Is connected device responding to IDE? What is exact message in debug window?
244-
* [ ] Have you selected correct ESP module type in "Board" menu? What is the selection?
246+
* [ ] Have you selected correct ESP module type in *Board* menu? What is the selection?
245247
* [ ] Have you tried to reduce upload speed? What speeds have you tried?
246248

247249
**Advanced Checks**
@@ -264,17 +266,19 @@ If you are stuck at certain step, then post this list on [ESP8266 Community Foru
264266

265267
### Conclusion
266268

267-
With variety of available ESP8266 modules and boards as well as possible connection methods troubleshooting of upload issues may take several steps.
269+
With variety of available ESP8266 modules and boards, as well as possible connection methods, troubleshooting of upload issues may take several steps.
268270

269-
If you are beginner use boards with integrated power supply and USB to serial converter. Check carefully message in debug window and act accordingly. Select your exact module type in IDE and try to adjust upload speed. Check is board is indeed entering boot loading mode. Double check your USB to serial converter. Analyze detailed upload log for inconsistencies with IDE settings.
271+
If you are a beginner, then use boards with integrated power supply and USB to serial converter. Check carefully message in debug window and act accordingly. Select your exact module type in IDE and try to adjust upload speed. Check if board is indeed entering boot loading mode. Check operation of your USB to serial converter with loop back. Analyze detailed upload log for inconsistencies with IDE settings.
270272

271-
Double check your confection diagram and wave-form for consistency with selected reset method.
273+
Verify your connection diagram and wave-form for consistency with selected reset method.
272274

273-
If you get stuck ask [community](http://www.esp8266.com/) for support providing summary of all completed checks.
275+
If you get stuck, then ask [community](http://www.esp8266.com/) for support providing summary of all completed checks.
274276

275277

276278
![Test stand used during checking of ck reset method](pictures/a01-test-stand.jpg)
277279

278-
Test stand used for checking of ck reset method is shown above. No any ESP module has been harmed during preparation of this FAQ item.
280+
Test stand used for checking of ck reset method is shown above.
281+
282+
No any ESP module has been harmed during preparation of this FAQ item.
279283

280284
[FAQ list :back:](readme.md)

0 commit comments

Comments
 (0)