Current Lua downloadable firmware will be posted here

User avatar
By amadeus84
#55341 Like others have reported (e.g. here: viewtopic.php?f=23&t=3061), I'm getting garbage scrolling on the screen after flashing nodemcu.
Despite all my efforts the issue persists and it's aggravating, so I desperately help.

Among many thins, I read the following:

https://nodemcu.readthedocs.io/en/master/en/flash/
https://espressif.com/en/support/explor ... rted-guide

and various other sites that provide the flash mapping. I am aware of the need to write esp_init_data_default.bin when upgrading from an older firmware version (more on that in a minute). But that did not solve the problem. So I'll provide very specific details about my setup and what I did.

Using esp-12 (4Mbit = 512kB version). These were bought sometime in 2015 and around that time I successfully replaced the original AT firmware with nodemcu-firmware compiled with xtensa provided by esp-open-sdk version 0.9.6. All went well until about 1 week ago when I tried to upgrade to the latest nodemcu, wheh I got hit by the garbage problem.

Currently using the latest esp-open-sdk from github, which comes with xtensa and ESP8266_NONOS_SDK_V1.5.4_16_05_20. I used this to compile the latest nodemcu-firmware also from github.

Code: Select all> pwd
/home/awm/esp/nodemcu-firmware/bin

> cp ../../esp-open-sdk/ESP8266_NONOS_SDK_V1.5.4_16_05_20/bin/esp_init_data_default.bin .

> which esptool.py
~/esp/esp-open-sdk/xtensa-lx106-elf/bin/esptool.py

esptool.py -p /dev/ttyUSB0 write_flash -fm qio -fs 4m 0x00000 0x00000.bin 0x10000 0x10000.bin 0x7c000 esp_init_data_default.bin
esptool.py v1.2-dev
Connecting...
Running Cesanta flasher stub...
Flash params set to 0x0000
Writing 28672 @ 0x0... 28672 (100 %)
Wrote 28672 bytes at 0x0 in 2.5 seconds (90.6 kbit/s)...
Writing 356352 @ 0x10000... 356352 (100 %)
Wrote 356352 bytes at 0x10000 in 31.4 seconds (90.9 kbit/s)...
Writing 4096 @ 0x7c000... 4096 (100 %)
Wrote 4096 bytes at 0x7c000 in 0.4 seconds (88.6 kbit/s)...
Leaving...


Note that esp_init_data_default.bin is from Espressif SDK 1.5.4. Then

Code: Select all>picocom -b 115200 --omap crcrlf /dev/ttyUSB0


and the garbage starts scrolling at any baud rate.

The only way I can get to use the module is to flash it with the eagle firmware from the Espressif SDK:

Code: Select all>pwd
/home/awm/esp/ESP8266_NONOS_SDK/bin

> esptool.py -p /dev/ttyUSB0 write_flash 0x00000 at/noboot/eagle.flash.bin 0x10000 at/noboot/eagle.irom0text.bin 0x7c000 esp_init_data_default.bin 0x7e000 blank.bin
esptool.py v1.2-dev
Connecting...
Running Cesanta flasher stub...
Flash params set to 0x0000
Writing 45056 @ 0x0... 45056 (100 %)
Wrote 45056 bytes at 0x0 in 4.0 seconds (90.7 kbit/s)...
Writing 372736 @ 0x10000... 372736 (100 %)
Wrote 372736 bytes at 0x10000 in 32.8 seconds (90.9 kbit/s)...
Writing 4096 @ 0x7c000... 4096 (100 %)
Wrote 4096 bytes at 0x7c000 in 0.4 seconds (88.5 kbit/s)...
Writing 4096 @ 0x7e000... 4096 (100 %)
Wrote 4096 bytes at 0x7e000 in 0.4 seconds (88.6 kbit/s)...
Leaving...


Note that I flashed the following 4 binaries:

esp.flash.bin @ 0x00000
esp.irom0text.bin @0x10000
esp_init_data_default.bin @0x7c000
blank.bin @0x7e000

Note also that the esp.flash.bin and the esp.irom0text.bin are from the bin/at/noboot/ directory.

Then,

Code: Select all>picocom -b 115200 --omap crcrlf

picocom v1.7

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        :
omap is        : crcrlf,
emap is        : crcrlf,delbs,

Terminal ready

AT+GMR
AT version:1.3.0.0(Jul 14 2016 18:54:01)
SDK version:2.0.0(656edbf)
compile time:Jul 19 2016 18:43:55
OK


So that works.

I need help here from esp experts, before I seek medical help. Thanks!
User avatar
By jankop
#55342 For this you not need a specialist, that I can handle myself.
For esp8266 - 12 is esp_init_data_default.bin @ 0x7c000 bad address.
Is supposed to be 0x3FC000.

Is there really a version esp8266-12 with 512 kilobytes of memory? Surely yes?
I hear it the first time.
User avatar
By schufti
#55348 AFAIK it shouldn't be necesary to flash esp_init_data_default.bin, a total clear of the flash should be enough.
The sdk restores defaults if the memory is detected as empty. Unfortunately any random data is considered to be valid settings (no crc or the like) and confuse the system.
User avatar
By amadeus84
#55350 The Espressif SDK AT firmware does not report the flash size or I don't know how to, but I found a backup of the original firmware (I think) this module came with and I flashed that onto the chip.

Code: Select allls -l v0.9.5.2ATFirmware.bin
-rw-r-----. 1 awm users 520192 Sep 18 14:54 v0.9.5.2ATFirmware.bin      # 512kB

esptool.py -p /dev/ttyUSB0 write_flash 0x00000 v0.9.5.2ATFirmware.bin
esptool.py v1.2-dev
Connecting...
Running Cesanta flasher stub...
Flash params set to 0x0000
Writing 520192 @ 0x0... 520192 (100 %)
Wrote 520192 bytes at 0x0 in 45.8 seconds (90.9 kbit/s)...
Leaving...


Then in picocom

Code: Select allpicocom -b 115200 --omap crcrlf /dev/ttyUSB0
picocom v1.7

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        :
omap is        : crcrlf,
emap is        : crcrlf,delbs,

Terminal ready

ERROR
AT

OK
AT+GMR
AT version:0.21.0.0
SDK version:0.9.5

OK
AT+RST

OK

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

wdt reset
load 0x40100000, len 816, room 16
tail 0
chksum 0x8d
load 0x3ffe8000, len 788, room 8
tail 12
chksum 0xcf
ho 0 tail 12 room 4
load 0x3ffe8314, len 288, room 12
tail 4
chksum 0xcf
csum 0xcf

2nd boot version : 1.2
  SPI Speed      : 40MHz
  SPI Mode       : QIO
  SPI Flash Size : 4Mbit
jump to run user1

rl���
Ai-Thinker Technology Co. Ltd.

ready



Note the SPI Flash line in the code above. So unless this does not report the correct size, I have a 4Mbit = 512kB chip. There is a non zero chance that the AT firmware backup was from a esp-01 chip.

Would I fry it up if it's 512kB and I try to write to a memory location that's out of bounds?