Firmware issue

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
wgreybe
Posts: 4
Joined: Wed Sep 07, 2016 1:50 pm

Firmware issue

Post by wgreybe » Wed Sep 07, 2016 2:23 pm

I am using the Linolin NodeMCU v3 board. When I update the firmware to the current latest version, I get gibberish scrolling across the screen.

I cant upload attachments in order to show you.

However the latest version I tried to upload is:
sudo python esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash 0x00000 esp8266-20160907-v1.8.3-126-gdab0f31.bin --verify

Erasing the flash is the only way I can reconnect to the board after reloading an older firmware.
sudo python esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash 0x00000 esp8266-20160809-v1.8.3.bin --verify

The problem with this is that when I try to use the "Esp8266" getting started web page, it seems that there may be features missing, as I receive errors when trying to get some of the examples working.

I am new to this, so its not impossible that I'm at fault.

Any help/advise with info on learning how to troubleshoot/understand, as well as build firmware and learn mico/python will be greatly appreciated.

Thanking you in advance

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Firmware issue

Post by pythoncoder » Wed Sep 07, 2016 6:31 pm

Try adding --flash_size=8m to your esptool command line. It's recommended for all boards with >= 1MB of Flash. The command specifies 1MB (8Mbits) and the tool will detect your actual size. It works on boards with 4MB like yours.

This is what I use on my various 4MB boards (obviously you'll need to adapt the filename):
esptool.py -p /dev/ttyUSB0 write_flash --verify --flash_size=8m 0 build/firmware-combined.bin
Peter Hinch
Index to my micropython libraries.

wgreybe
Posts: 4
Joined: Wed Sep 07, 2016 1:50 pm

Re: Firmware issue

Post by wgreybe » Wed Sep 07, 2016 7:07 pm

Thanks. That seemed to work. Ill get back to the "getting started"

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

Re: Firmware issue

Post by mcauser » Thu Sep 08, 2016 12:43 am

--flash_size=8m
8m = 8 megabits = 1 megabyte

For the 4MB WeMos D1 board, I use --flash_size=32m (32Mbits = 4MBytes) and set flash mode -fm dio (dual io)

@pythoncoder If you specify -fs 8m esptool automagically increases to 32m if your flash chip supports it?

More on flash modes here:
https://nodemcu.readthedocs.io/en/dev/en/flash/
https://github.com/themadinventor/esptool#flash-modes

More about determining flash size here: http://forum.micropython.org/viewtopic.php?f=16&t=1777

If you are not sure how much flash you have, you can use esptool to get the flash id, then match it against known ids.
esptool.py flash_id

For example, on my WeMos D1 Mini:
esptool.py v1.1
Connecting...
Manufacturer: e0
Device: 4016

0xe0 is Winbond (not listed in flashchips.h?)
0x4016 is W25Q32FV https://www.winbond.com/resource-files/ ... 091613.pdf

You can find most matching ids here:
https://code.coreboot.org/p/flashrom/so ... ashchips.h
https://github.com/jhcloos/flashrom/blo ... ashchips.h

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Firmware issue

Post by pythoncoder » Thu Sep 08, 2016 4:27 am

@pfalcon stated http://forum.micropython.org/viewtopic. ... ion#p12362 that if you specify 8m it will automatically resize for bigger boards.
Peter Hinch
Index to my micropython libraries.

wgreybe
Posts: 4
Joined: Wed Sep 07, 2016 1:50 pm

Re: Firmware issue

Post by wgreybe » Thu Sep 08, 2016 4:50 am

Is there a way to "interogate" the chips to know what their flash size and available space is? Should it display it on the chip somewhere?

Thanks for the help.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Firmware issue

Post by pythoncoder » Thu Sep 08, 2016 5:02 am

Code: Select all

import port_diag
Peter Hinch
Index to my micropython libraries.

jms
Posts: 108
Joined: Thu May 05, 2016 8:29 pm
Contact:

Re: Firmware issue

Post by jms » Thu Sep 08, 2016 9:58 am

Why do we have to suffer this problem time and time again ?

As I have said repeatedly esptool should stop there and then if the file is larger than the size of the flash it (guesses or knows) it is dealing with.

Could somebody with the authority to do so please fix esptool !

(I'll have a go at the github method but suspect it is more political than technical.)

Credit to pfalcon who clearly sees there is a (closely related) problem.
https://github.com/themadinventor/esptool/issues/105

Jon

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

Re: Firmware issue

Post by deshipu » Thu Sep 08, 2016 11:57 am

jms wrote: Could somebody with the authority to do so please fix esptool !
I think they accept pull requests. Feel free to propose one.

jms
Posts: 108
Joined: Thu May 05, 2016 8:29 pm
Contact:

Re: Firmware issue

Post by jms » Fri Sep 09, 2016 11:22 am

Done.

Jon

NEW: My first ever pull request has just been accepted
Last edited by jms on Thu Sep 15, 2016 8:35 am, edited 1 time in total.

Post Reply