Can't flash 1.8.5 (or 1.8.4) on NodeMCU

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
soapdog
Posts: 7
Joined: Wed Sep 14, 2016 11:51 am

Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Post by soapdog » Mon Nov 07, 2016 2:26 pm

Hello Friends,

I am having a lot of trouble flashing micropython 1.8.5 (or 1.8.4) firmware to my NodeMCUs. Some months ago this worked fine with the same boards. Now, the flashing happens without any error but upon reset the LED blinks like mad and garbage is spewed to the screen non-stop. The same boards are able to run NodeMCU Lua firmware without problem.

I am erasing the flash before flashing and I tried many different incantations of the esptool.py command. I am trying this with multiple boards, all the same model from the same maker. I have been trying this to flash it:

esptool.py --port COM3 --baud 115200 write_flash --flash_size=8m -fm dio 0 esp8266-20161017-v1.8.5.bin

The same process work with the Lua based firmware if I also pass the option to flash esp_init_data_default.bin. These boards used to work fine with 1.8.4, so I tried flashing them with that version again and it didn't work, same bug.

Is anyone experiencing the same problem? Anyone has some advise?

Thanks for all the help

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Post by mcauser » Tue Nov 08, 2016 9:17 am

Do you get the same error if you try --flash_size=32m?

Which version of esptool?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Post by deshipu » Tue Nov 08, 2016 10:23 am

I noticed that erasing the flash doesn't do much when the board gets stuck like that. What worked for me is flashing a different firmware (nodemcu or espruino), and then flashing MicroPython on top of that. I have no idea why that happens -- a flash dump after erase_flash returns all 0xff, so seems it worked fine...

soapdog
Posts: 7
Joined: Wed Sep 14, 2016 11:51 am

Re: Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Post by soapdog » Wed Nov 09, 2016 4:18 pm

mcauser wrote:Do you get the same error if you try --flash_size=32m?

Which version of esptool?
Hi, I tried both fs 32m and 8m, same results. I am using esptool 1.1 on windows (This used to work). I can flash the nodemcu lua one without problem tough.

thanks for the reply.

soapdog
Posts: 7
Joined: Wed Sep 14, 2016 11:51 am

Re: Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Post by soapdog » Wed Nov 09, 2016 4:19 pm

deshipu wrote:I noticed that erasing the flash doesn't do much when the board gets stuck like that. What worked for me is flashing a different firmware (nodemcu or espruino), and then flashing MicroPython on top of that. I have no idea why that happens -- a flash dump after erase_flash returns all 0xff, so seems it worked fine...
Tried that as well, more than once. Will try again because I think I was flashing the lua firmware then erasing flash then flashing micropython. Will try without erasing the flash.

Thanks for the tip.

soapdog
Posts: 7
Joined: Wed Sep 14, 2016 11:51 am

Re: Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Post by soapdog » Wed Nov 09, 2016 4:27 pm

soapdog wrote:
deshipu wrote:I noticed that erasing the flash doesn't do much when the board gets stuck like that. What worked for me is flashing a different firmware (nodemcu or espruino), and then flashing MicroPython on top of that. I have no idea why that happens -- a flash dump after erase_flash returns all 0xff, so seems it worked fine...
Tried that as well, more than once. Will try again because I think I was flashing the lua firmware then erasing flash then flashing micropython. Will try without erasing the flash.

Thanks for the tip.
Just tried this. Didn't work :-( :-(

Damn, I am about to publish a course on micropython and nodemcu and all my boards stopped working :? it is really strange since the lua firmware works fine.

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Post by kfricke » Wed Nov 09, 2016 4:47 pm

What is the real flash size of your flash ROM? The discussion does mention settings from 8mb to 32mb for esptool.

If your modules have only 512KB of flash this might be of interest to you:
A few weeks ago the MicroPython builds did exceed the initially set 512KB flash barrier. pfalcon did introduce a new build target '512k' for the ESP8266 port to compensate the situation.
You can look at this commit for details about this change. But most likely you will not like what you can read there for your course (FatFS and file related functionalities got removed completetly).

soapdog
Posts: 7
Joined: Wed Sep 14, 2016 11:51 am

Re: Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Post by soapdog » Wed Nov 09, 2016 5:09 pm

kfricke wrote:What is the real flash size of your flash ROM? The discussion does mention settings from 8mb to 32mb for esptool.

If your modules have only 512KB of flash this might be of interest to you:
A few weeks ago the MicroPython builds did exceed the initially set 512KB flash barrier. pfalcon did introduce a new build target '512k' for the ESP8266 port to compensate the situation.
You can look at this commit for details about this change. But most likely you will not like what you can read there for your course (FatFS and file related functionalities got removed completetly).
esptool gives me the following output:

Code: Select all

C:\Users\soapdog\Downloads
λ esptool.py --port COM3 flash_id
esptool.py v1.1
Connecting...
Manufacturer: e0
Device: 4016
So I guess it its the 32mb one according to http://www.esp8266.com/wiki/doku.php?id ... ule-family, it should fit.

User avatar
ernitron
Posts: 89
Joined: Fri Jun 03, 2016 5:53 pm
Location: The Netherlands

Re: Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Post by ernitron » Wed Nov 09, 2016 5:14 pm

Looks to me a bad flash or a bad image: in that case the unit continue rebooting flashing the LED.

It happened to me something similar NodeMCU was working fine and Micropython was flashing. Connecting with picocom presented garbled characters on screen continuously. As @kfricke noted, my problem was the wrong memory settings (WeMos D1 mini requires 32m and -fs=detect did not worked).

I would check all the memory sizes. Note that an update to esp-open-sdk (compiler along with esptool.py) to latest version is mandatory for 1.8.5.

Code: Select all

xgcc --version
xtensa-lx106-elf-gcc (crosstool-NG crosstool-ng-1.22.0-55-gecfc19a) 4.8.5 

User avatar
kfricke
Posts: 342
Joined: Mon May 05, 2014 9:13 am
Location: Germany

Re: Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Post by kfricke » Wed Nov 09, 2016 5:19 pm

That does seem to be the case. How about trying a newer version of esptool? The current release is 1.2.1.

Post Reply