Can build and flash, doesn't boot

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
poorandunlucky
Posts: 5
Joined: Wed Oct 16, 2019 11:07 pm
Location: Montreal, QC, CA
Contact:

Can build and flash, doesn't boot

Post by poorandunlucky » Wed Oct 16, 2019 11:19 pm

Hello,

I'm trying to try MicroPython after a shortcoming of the NodeMCU firmware (I2C ACK) motivated me to learn Python, and make the switch.

I can successfully build the firmware, and I can successfully flash it, however, when booting I only get the bootloader:

Code: Select all

load 0x40100000, len 31084, room 16
tail 12
chksum 0xef
ho 0 tail 12 room 4
load 0x00000000, len 0, room 12
tail 0
chksum 0xef
load 0x00000000, len 0, room 4
tail 0
chksum 0xef
csum 0xef
csum err
ets_main.c
My onboard SPI flash doesn't support esptool's flash_erase, however, I wrote random data to it, and flashed blank.bin and esp_default_init.bin at the proper addresses for both OTA and non-OTA (same for both maps) after several failures, and still no luck.

The boards are ESP12-E, the usual breakout boards for the castellated ESP8266-MOD modules...

Thanks in advance for any help,

rpr
Posts: 99
Joined: Sat Oct 27, 2018 5:17 pm

Re: Can build and flash, doesn't boot

Post by rpr » Thu Oct 17, 2019 1:41 am

Have you tried just flashing the mainline available stable builds first?

jomas
Posts: 59
Joined: Mon Dec 25, 2017 1:48 pm
Location: Netherlands

Re: Can build and flash, doesn't boot

Post by jomas » Thu Oct 17, 2019 4:34 pm

I had the same error when I tried to flash a esp-07 which had 1Mbyte flash while I expected that is was a 4Mbyte device like most esp12-F's.

User avatar
poorandunlucky
Posts: 5
Joined: Wed Oct 16, 2019 11:07 pm
Location: Montreal, QC, CA
Contact:

Re: Can build and flash, doesn't boot

Post by poorandunlucky » Fri Oct 18, 2019 2:53 am

@rpr : I just tried again to flash the precompiled binary image just to make sure (I wasn't sure I tried after erasing the flash), and same result, I just get the bootloader with a csum error.

@jomas : I've been working with that specific module for a while, almost a year... it's autodetected as a 4 MB and I know for a fact it can hold more than 1 MB... : \

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Can build and flash, doesn't boot

Post by Roberthh » Fri Oct 18, 2019 5:42 am

The data sheet tells it has 4 MB flash. But you could try the various flash modes, option -fm {keep,qio,qout,dio,dout}

User avatar
poorandunlucky
Posts: 5
Joined: Wed Oct 16, 2019 11:07 pm
Location: Montreal, QC, CA
Contact:

Re: Can build and flash, doesn't boot

Post by poorandunlucky » Fri Oct 18, 2019 7:57 pm

@roberthh : Those are SPI communication modes, basically speed and duplex... I've flashed firmware to it already in QIO, I've been working with the NodeMCU Lua firmware for close to a year now, it's just that I need to communicate with an I2C module, and control the ACK signals being sent. It's not implemented in NodeMCU, but it's implemented in MicroPython.

That shortcoming, along others, makes that switching to MicroPython seemed worthwhile; I, however, am not having a whole lot of success booting the darned thing....

I've even tried on another module, with the same amount of success...

User avatar
poorandunlucky
Posts: 5
Joined: Wed Oct 16, 2019 11:07 pm
Location: Montreal, QC, CA
Contact:

Re: Can build and flash, doesn't boot

Post by poorandunlucky » Fri Oct 18, 2019 8:52 pm

Well I'll be a monkey's uncle....

I flashed it in DIO and it worked....

What does this mean? Why did other binaries flash fine in QIO?

I always thought the ESP8285 needed to be flashed in DOUT because of the SPI flash chip...

Can anyone explain, this intrigues me..?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Can build and flash, doesn't boot

Post by Roberthh » Sat Oct 19, 2019 6:17 am

As far as I understand it, the ESP8266 is a SPI flash too, only external. I never looked into the technical reason, why some esp8266 modules require qio, some dio, some dout. It may be related to the flash chip type. The devices I have on my desk all work with qio mode. But following the discussion in the forum, some devices need other modes.

User avatar
poorandunlucky
Posts: 5
Joined: Wed Oct 16, 2019 11:07 pm
Location: Montreal, QC, CA
Contact:

Re: Can build and flash, doesn't boot

Post by poorandunlucky » Wed Oct 23, 2019 12:05 am

I could flash other firmwares (NodeMCU) on this very modules in QIO and it worked fine... I know the ESP8285 needs to be flashed in DIO, and the ESP8266EX does use external SPI flash (that uses one of the two hardware SPI buses, which is why you should use HSPI), but I didn't change physical modules...

This is a curiosity now...

User avatar
ta1db
Posts: 53
Joined: Mon Sep 02, 2019 12:05 pm
Contact:

Re: Can build and flash, doesn't boot

Post by ta1db » Fri Oct 25, 2019 5:29 pm

poorandunlucky wrote:
Fri Oct 18, 2019 8:52 pm
I flashed it in DIO and it worked....
What is DIO ? I am trying to flash ESP01 with AT WiFi firmware and I have exactly the same issue ( I am erasing and flashing the device using esptool.py successfully but it doesn't work, it doesn't respond AT commands as expected).

**BTW** , it also responds with "boot mode: (3,6)" message, does anybody know what is the 2nd digit's meaning.. what is 6 ? It sometimes become 7,.. The first digit is known but I couldn't find meaning of the 2nd digit.. ( It says something but we don't understand :shock: )

Edit: I got it, it is flash mode flag and mine was already dio !

How I flash:

Code: Select all

C:\Users\murat>esptool.py -p COM4: --baud 74880 write_flash --flash_size=8m -fm dio 0 C:\Users\murat\Downloads\ESP01_AT_firmware\ATFirmware.bin
WARNING: Flash size arguments in megabits like '8m' are deprecated.
Please use the equivalent size '1MB'.
Megabit arguments may be removed in a future release.
esptool.py v2.8
Serial port COM4:
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 2c:f4:32:2d:ee:19
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash params set to 0x0220
Compressed 520192 bytes to 134837...
Wrote 520192 bytes (134837 compressed) at 0x00000000 in 18.3 seconds (effective 227.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

When I reset:

Code: Select all

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

load 0x40100000, len 25020, room 16 
tail 12
chksum 0xef
ho 0 tail 12 room 4
load 0x00000000, len 0, room 12 
tail 0
chksum 0xef
load 0x00000000, len 0, room 4 
tail 0
chksum 0xef
csum 0xef
csum err
ets_main.c 
With the firmware here : https://github.com/espressif/ESP8266_AT, after flashing and reset I get:

Code: Select all

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

load 0x40100000, len 612, room 16 
tail 4
chksum 0x12
load 0x3ffe8000, len 788, room 4 
tail 0
chksum 0x50
load 0x3ffe8314, len 264, room 8 
tail 0
chksum 0x4a
csum 0x4a

2nd boot version : 1.1
  SPI Speed      : 40MHz
  SPI Mode       : DIO
  SPI Flash Size : 8Mbit
jump to run usererror user bin flag, flag = c
user code done
But no response to AT commands !

With another firmware I could get jump to run user1 but still no response to AT comnands.

Code: Select all

 ets Jan  8 2013,rst cause:1, boot mode:(3,6)

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       : DIO
  SPI Flash Size : 8Mbit
jump to run user1
With MicroPython Firmware esp8266-20190529-v1.11.bin I get this, no REPL.

Code: Select all

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

load 0x40100000, len 31024, room 16 
tail 0
chksum 0xb4
load 0x3ffe8000, len 1104, room 8 
tail 8
chksum 0x74
load 0x3ffe8450, len 824, room 0 
tail 8
chksum 0x45
csum 0x45

E D I T

Finally I could manage to communicate with the ESP01 chip!
Persons having the same difficulties should read this document first ! entirely and carefully ! Everything is written here : https://github.com/espressif/esptool
Especially here : https://github.com/espressif/esptool#wr ... doesnt-run
Power quality is the main issue. This board doesn't work on a breadboard, with long wires, poor power supply and without any capacitor! I put a 100 uF capacitor just on the Vcc GND pins of the board, I made a small pcb with short wire connections and got the USB connection from a powered USB hub.

Post Reply