Page 1 of 2

Can't flash 1.8.5 (or 1.8.4) on NodeMCU

Posted: Mon Nov 07, 2016 2:26 pm
by soapdog
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

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

Posted: Tue Nov 08, 2016 9:17 am
by mcauser
Do you get the same error if you try --flash_size=32m?

Which version of esptool?

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

Posted: Tue Nov 08, 2016 10:23 am
by deshipu
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...

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

Posted: Wed Nov 09, 2016 4:18 pm
by soapdog
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.

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

Posted: Wed Nov 09, 2016 4:19 pm
by soapdog
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.

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

Posted: Wed Nov 09, 2016 4:27 pm
by soapdog
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.

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

Posted: Wed Nov 09, 2016 4:47 pm
by kfricke
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).

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

Posted: Wed Nov 09, 2016 5:09 pm
by soapdog
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.

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

Posted: Wed Nov 09, 2016 5:14 pm
by ernitron
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 

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

Posted: Wed Nov 09, 2016 5:19 pm
by kfricke
That does seem to be the case. How about trying a newer version of esptool? The current release is 1.2.1.