Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to flash AI-Thinker ESP-12-Q module with custom compiled nodemcu image. When very first time the chip boots up it shows a message saying it has 8mbit (1MB) flash. On every document also images it is shown that this module has 32mbit (4MB) flash. Here is what i did and the result:

  • To eliminate power problems, I power the module with 10 Amps lab supply (3.3 volts of course).
  • There is a 3.3v ftdi module sitting between esp and computer.
  • I'm using official flash download tool v2.4 from Espressif.
  • As it is stated everywhere nodemcu image goes to 0x00000

After programming the nodemcu image esp module runs the nodemcu. I need to use ADC channel. When i say adc.read(0) it gives me 65535. Then as is says everywhere i need to change 107th byte of config. To do that:

  • Open esp flash download tool 2.4
  • Goto RF InitConfig Page
  • Press Defaults button
  • Change CrystalFreq to 26MHz (because chip boots with 74880 baud)
  • Change TOUT Pin Conf to TOUT_ADC_EN and voltage to 3.3v
  • Change nothing else
  • Press GenInitBin
  • Goto FlashDownload page
  • Select esp_init_data_setting.bin file to flash at address: 0x3FC00
  • Press start. And everything seems ok.

Then the horror begins: When chip boots i can manage to catch a message like system parameter error then chip is not booting into nodemcu image. When i checked the pin GPIO0 the voltage reads around 1.9v. There is a 10K external pullup resistor on this pin. As the voltage reads like that, esp cannot boot into nodemcu image. When i force this pin to 3.3v by shorting the pullup resistor, it boots into nodemcu but with some errors (i'll try to catch them).

So the question is, what am i doing wrong?

EDIT #1:

This is the output of the chip:

 ets Jan  8 2013,rst cause:2, boot mode:(3,0)

load 0x40100000, len 30288, room 16
tail 0
chksum 0xa5
load 0x3ffe8000, len 2268, room 8
tail 4
chksum 0x3f
load 0x3ffe88dc, len 8, room 4
tail 4
chksum 0xca
csum 0xca
system param error
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff .... goes on for 100 meters.

EDIT #2:

I tried to load "factory defaults" to the chip as it is defined in the SDK v1.5

Flash size 32Mbit-C1:       1024KB+1024KB
boot_v1.2+.bin              0x00000
user1.2048.new.5.bin        0x01000
esp_init_data_default.bin   0x3fc000 (optional)
blank.bin                   0xfe000 & 0x3fe000

Then the chip starts to function normal. I tried with some AT commands, got answer as expected etc... Then I loaded the nodemcu image. It also functioned well as expected. Then the tricky part: This time I took the esp_init_data_default.bin from SDK1.5 and changed the 107th byte to 0x21 (33 DEC) by a hex editor. Then flashed the esp_init_data_default.bin and blank.bin files to the chip. Rebooted and checked what adc reads. I got some plausible results though. Seems like the chip goes normal.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
168 views
Welcome To Ask or Share your Answers For Others

1 Answer

This cannot be a definite answer because there's hardware involved but it may still be helpful (it's too long for a comment).

So, first things first try with a flasher that allows to set the flash size explicitly. I don't know the Espressif tool but many in the NodeMCU community are pretty happy with esptool.py.

esptool.py --port <USB-port-with-ESP8266> write_flash -fm dio -fs 32m 0x00000 <nodemcu-firmware>.bin

Don't try to tinker with the firmware until you confirmed that this works (i.e. boot up w/o errors) and flash size and heap size look ok.

Next, if you use a recent NodeMCU firmware from the dev branch you can skip the byte-107-dance because you can set it in Lua.

adc.force_init_mode(adc.INIT_ADC)
-- now reboot

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...