[Solved] NodeMCU boot loop after fresh install

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
CraigUK
Posts: 12
Joined: Fri Jan 11, 2019 11:28 am

[Solved] NodeMCU boot loop after fresh install

Post by CraigUK » Tue Feb 12, 2019 9:21 pm

Hi All,

I have a new NodeMCU which has a problem after flashing micropython 1.10 onto it.
The repl appears and responds for a short time (<1s) but then is unresponsive, i.e. nothing I type is echoed back to the terminal.
After about 8s then mcu is reset by the hardware wdt and the process begins again.

I've tried erasing the flash, and then verifiying the the flash_write went well.
I've also tried using various USB cables and power supplies but I get the same behaviour.
Thinking it was a bad unit I also tried another one from a previous batch but it behaves the same.
I've also tried using 1.9.4 (which I'm sure I used before on the older board) but still the same.

Any ideas?
Last edited by CraigUK on Sat Feb 16, 2019 8:27 am, edited 1 time in total.

User avatar
CraigUK
Posts: 12
Joined: Fri Jan 11, 2019 11:28 am

Re: NodeMCU boot loop after fresh install

Post by CraigUK » Wed Feb 13, 2019 10:41 pm

I hoped it was something simple or a known issue but I suppose not.

User avatar
philwilkinson40
Posts: 59
Joined: Tue Nov 14, 2017 3:11 am
Location: Perth, Australia

Re: NodeMCU boot loop after fresh install

Post by philwilkinson40 » Thu Feb 14, 2019 12:44 pm

try

Code: Select all

esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect -fm dio 0 esp8266-20190125-v1.10.bin
note the additional -fm dio option on esptool
this is mentioned in the getting started tutorial
I just tried this on my Node MCU and it flashed and started fine.

User avatar
CraigUK
Posts: 12
Joined: Fri Jan 11, 2019 11:28 am

Re: NodeMCU boot loop after fresh install

Post by CraigUK » Thu Feb 14, 2019 4:08 pm

Thanks for the tip Phil.

I flashed with the -fm dio option, also with 115200 baud.

Am I right to assume that since the flash write is verified then the problem is not with the flashing?

User avatar
philwilkinson40
Posts: 59
Joined: Tue Nov 14, 2017 3:11 am
Location: Perth, Australia

Re: NodeMCU boot loop after fresh install

Post by philwilkinson40 » Fri Feb 15, 2019 4:30 am

Not sure, it appears it is the boot that will not work if the dual I/O option is not selected during flash.
Did it work in the end?

User avatar
CraigUK
Posts: 12
Joined: Fri Jan 11, 2019 11:28 am

Re: NodeMCU boot loop after fresh install

Post by CraigUK » Fri Feb 15, 2019 10:03 pm

Hi Phil,

Here's my esptool command and output:

Code: Select all

C:\Users\craig>esptool.py -p COM3 -b 115200 write_flash -fm dio --verify --flash_size detect  0 "Downloads\esp8266-20190125-v1.10.bin"
esptool.py v2.6
Serial port COM3
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 60:01:94:27:ab:cd
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0240
Compressed 615388 bytes to 399928...
Wrote 615388 bytes (399928 compressed) at 0x00000000 in 37.5 seconds (effective131.2 kbit/s)...
Hash of data verified.

Leaving...
Verifying just-written flash...
(This option is deprecated, flash contents are now always read back after flashing.)
Flash params set to 0x0240
Verifying 0x963dc (615388) bytes @ 0x00000000 in flash against Downloads\esp8266-20190125-v1.10.bin...
-- verify OK (digest matched)
Hard resetting via RTS pin...
After that I connect to the COM port with putty and see this output:

Code: Select all

MicroPython v1.10-8-g8b7039d7d on 2019-01-26; ESP module with ESP8266
Type "help()" for more information.
>>>
Which looks good, but then a short while later there is a reset:

Code: Select all

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

wdt reset
load 0x40100000, len 31020, room 16
tail 12
chksum 0xd2
ho 0 tail 12 room 4
load 0x3ffe8000, len 1100, room 12
tail 0
chksum 0x9a
load 0x3ffe8450, len 824, room 8
tail 0
chksum 0xbd
csum 0xbd

OSError: [Errno 2] ENOENT

MicroPython v1.10-8-g8b7039d7d on 2019-01-26; ESP module with ESP8266
Type "help()" for more information.
>>>
(For brevity I skipped the non-printable characters).

Which version of esptool and bin file are you using?

User avatar
CraigUK
Posts: 12
Joined: Fri Jan 11, 2019 11:28 am

Re: NodeMCU boot loop after fresh install

Post by CraigUK » Sat Feb 16, 2019 8:26 am

This morning I tried another board from the same batch. It comes with lua installed so before flashing micropython onto it I tested it with lua: same behavior.
The board continuously resets out of the box.
So I've wasted rather a lot of time on a faulty batch of boards.

I really kicked myself when I realised this because I mistakenly tested a board from this batch thinking it was from a good batch and decided my process was at fault and not the batch.

In future I'll stick some labels on them!

Thanks for the suggestions all the same.

kevinkk525
Posts: 439
Joined: Sat Feb 03, 2018 7:02 pm

Re: [Solved] NodeMCU boot loop after fresh install

Post by kevinkk525 » Sat Feb 16, 2019 8:45 am

I did see the same error messages on my boards under certain circumstances but can't remember when. When I do, I'll tell you.

As it is the same with lua it might be a faulty batch or some electrical problem.

User avatar
CraigUK
Posts: 12
Joined: Fri Jan 11, 2019 11:28 am

Re: [Solved] NodeMCU boot loop after fresh install

Post by CraigUK » Sat Feb 16, 2019 9:44 am

Thanks, that would be useful information

Post Reply