ESP8266 repeatedly reboots after flash [RESOLVED]

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
tentacles1349
Posts: 6
Joined: Fri Sep 18, 2020 2:03 am

ESP8266 repeatedly reboots after flash [RESOLVED]

Post by tentacles1349 » Fri Sep 18, 2020 2:42 am

ESP8266 repeatedly reboots after flash:
This seems to be a common issue but I've tried all the suggestions I could find with no solution
I've gone through a few posts about how to fix this issue but no luck.

Flash goes ok and then I can access the REPL, but the device will restart every few seconds showing:

Code: Select all

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 30768, room 16 
tail 0
chksum 0xc4
load 0x3ffe8000, len 1024, room 8 
tail 8
chksum 0xd8
load 0x3ffe8400, len 1080, room 0 
tail 8
chksum 0xc4
csum 0xc4
I've tried the following methods to connect to REPL with the same result:
Linux:
  • screen /dev/ttyUSB0 -f 115200
  • thonny
Windows:
  • putty with control flow disabled
  • ESPlorer
Tried 3 devices:
  • 2 NodeMCUs with the ESP8266MOD chip
  • 1 D1 Mini with the ESP8266MOD chip
Tried multiple different esp8266 firmwares from v1.8.7 to v1.13

Method of Flashing:

Code: Select all

$ esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 48:3f:da:56:7d:a9
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 8.0s
Hard resetting via RTS pin...

Code: Select all

$ esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash --flash_size=detect -fm dio 0  esp8266-20200911-v1.13.bin
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 48:3f:da:56:7d:a9
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0240
Compressed 638928 bytes to 419659...
Wrote 638928 bytes (419659 compressed) at 0x00000000 in 37.0 seconds (effective 138.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin..
.

Thanks for any additional suggestions
Last edited by tentacles1349 on Fri Sep 18, 2020 7:04 pm, edited 1 time in total.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESP8266 repeatedly reboots after flash

Post by Roberthh » Fri Sep 18, 2020 5:56 am

Try the other flash modes while flashing, especially the option -fm dout.

tentacles1349
Posts: 6
Joined: Fri Sep 18, 2020 2:03 am

Re: ESP8266 repeatedly reboots after flash

Post by tentacles1349 » Fri Sep 18, 2020 5:54 pm

Roberthh wrote:
Fri Sep 18, 2020 5:56 am
Try the other flash modes while flashing, especially the option -fm dout.
with -fm dout & -fm qio I get similar results

Another poster (apologies I do not have the link to the post) suggested to disable the default AP configuration using the following command:

Code: Select all

import network; network.WLAN(network.AP_IF).active(False)
I was able to get the all three chips stable this way and can issue commands via REPL without reboots or errors, unless I re-enable the AP.

Some suggested this is due to the EN pin going too low when the AP starts up or is queried for connections, they suggested a 100uf cap across EN and Ground. I tried this but that did not fix the repeated reboots when I enable the AP.

This is the case for all three chips from different sources, the fact they all have the ESP8266MOD chip might point to hardware design flaw? This issue seems fairly prevalent based on my research.

As a comparison I got a few ESP-WROOM-32 chips and they work with no issues on my setup

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: ESP8266 repeatedly reboots after flash

Post by Roberthh » Fri Sep 18, 2020 6:27 pm

You could also try to use a different/better cable, if it is a power issue. The Capacitor at the EN pins helps. But most board have that anyhow, albeit a smaller value, like 100 nF + a pull-up resistor. Under stable power conditions that should be sufficient.

tentacles1349
Posts: 6
Joined: Fri Sep 18, 2020 2:03 am

Re: ESP8266 repeatedly reboots after flash

Post by tentacles1349 » Fri Sep 18, 2020 6:57 pm

Roberthh wrote:
Fri Sep 18, 2020 6:27 pm
You could also try to use a different/better cable, if it is a power issue. The Capacitor at the EN pins helps. But most board have that anyhow, albeit a smaller value, like 100 nF + a pull-up resistor. Under stable power conditions that should be sufficient.
Tired a few different cables and some stand alone power supplies but got the same results.

But... if I configure as a station I can connect to my network and everything is stable, no more reboots!
e.g. boot.py

Code: Select all

import network
sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
sta_if.connect("<**>", "<**>")
print(sta_if.isconnected())
So it seems setting of AP being enabled was causing the issue, as long as the AP is off I have stable chips, I am satisfied with this solution for now.

Thanks for being so responsive :)

Lars OK
Posts: 1
Joined: Wed Nov 11, 2020 12:55 am

Re: ESP8266 repeatedly reboots after flash

Post by Lars OK » Wed Nov 11, 2020 1:07 am

Hello

I just want to report, that I experience the exact same problems as described in this thread.
I have problems on d1 mini and d1 mini pro. I have also tried different versions of the firmware.

Doesnt this suggest there is some kind of underlying/general problem?

The workaround tentacles1349 found out, works for me as well - thanks :)

Br Lars

bonasta
Posts: 2
Joined: Sun Nov 29, 2020 10:31 pm

Re: ESP8266 repeatedly reboots after flash [RESOLVED]

Post by bonasta » Sun Nov 29, 2020 10:54 pm

using the Heltec wifi Kit 8 i had this problem

I think i fixed it by doing a separate erase flash then programming.

When programming I held the reset button down until esptool started showing dots.

I'm not sure if holding the button is necessary but i have read that it is.

There is a later problem that doing a network connect caused the reset loop to re-start

This problem is mentioned in another post.

Post Reply