ESP8266 Booting: Fatal exception (0):

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
SvenA
Posts: 4
Joined: Sun Dec 19, 2021 11:23 pm

ESP8266 Booting: Fatal exception (0):

Post by SvenA » Sun Dec 19, 2021 11:37 pm

Hello!

I tried to flash MicroPython (v1.17) on my ESP-12F today, but it does not work correctly.
After booting I will get the following output:

Code: Select all

 ets Jan  8 2013,rst cause:1, boot mode:(3,7)
load 0x40100000, len 30668, room 16 
tail 12
chksum 0x20
ho 0 tail 12 room 4
load 0x3ffe8000, len 996, room 12 
tail 8
chksum 0x88
load 0x3ffe83f0, len 1064, room 0 
tail 8
chksum 0xd8
csum 0xd8
Fatal exception (0): 
epc1=0x4020e838, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0): 
epc1=0x4020e838, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
Fatal exception (0): 
[.... last two lines in an endless loop ....]
This is the output of flashing the firmware:

Code: Select all

$ esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py v3.1
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 98:cd:ac:2f:02:e8
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 0.0s
Hard resetting via RTS pin...

Code: Select all

$ esptool.py --port /dev/ttyUSB0 --baud 19200 write_flash --flash_size=detect 0 esp8266-1m-20210902-v1.17.bin 
esptool.py v3.1
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 98:cd:ac:2f:02:e8
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Flash will be erased from 0x00000000 to 0x00090fff...
Flash params set to 0x0020
Compressed 589912 bytes to 389772...
Wrote 589912 bytes (389772 compressed) at 0x00000000 in 207.2 seconds (effective 22.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
I already reduced the baud rate to 19200 to be sure I had no programming problems.
I tried it several times with different speeds and different versions.

I also tried to flash another firmware (Tasmota) on the chip, which worked without problems.
So I tried to flash the MicroPython firmware with the Tasmota flash tool, but it made no difference.

Any ideas what to try next?

Regards
Sven
Last edited by SvenA on Tue Dec 21, 2021 3:15 pm, edited 2 times in total.

bitninja
Posts: 165
Joined: Thu Sep 15, 2016 4:09 pm
Location: Spring, Texas

Re: ESP8266 Booting: Fatal exception (0):

Post by bitninja » Mon Dec 20, 2021 4:22 am

Take a look at the 'flash_mode' option available when using the write flash command. For example:

Code: Select all

esptool.py -p /dev/ttyUSB0 -c esp8266 -b 460800 write_flash -fm dio --flash_size=4MB 0x0000 esp8266-20200911-v1.13.bin
you may have to just try each option to find the one that works.

SvenA
Posts: 4
Joined: Sun Dec 19, 2021 11:23 pm

Re: ESP8266 Booting: Fatal exception (0):

Post by SvenA » Mon Dec 20, 2021 5:48 pm

Hello!

I tried all four flash modes ('qio': 0, 'qout': 1, 'dio': 2, 'dout': 3).
Nothing has changed...

Writing the tasmota image with the tool provided by tasmotizer works always.

Code: Select all

$ ./tasmotizer.py 
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Erasing flash (this may take a while)...
Chip erase completed successfully in 0.0s
Compressed 630976 bytes to 449803...
Wrote 630976 bytes (449803 compressed) at 0x00000000 in 56.6 seconds (effective 89.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
I tried then to program the Tasmota image with the tool I tried to upload MicroPython.
This worked too... So it's not a problem with the tool.

I have no idea what to try next. I have the feeling I'm using the wrong image...
I used the image from this page:
https://www.micropython.org/download/esp8266-1m/
I tried the Version 1.17, 1.16, 1.13 and one daily.

Any other ideas?

Regards
Sven

bitninja
Posts: 165
Joined: Thu Sep 15, 2016 4:09 pm
Location: Spring, Texas

Re: ESP8266 Booting: Fatal exception (0):

Post by bitninja » Tue Dec 21, 2021 3:58 am

Ah! Sorry, I missed that you had a 1MB device. I'm afraid I don't have a compatible board to test it out.... wait you said ESP-12F... I believe that module has 4MB of SPI flash. All of mine are.

SvenA
Posts: 4
Joined: Sun Dec 19, 2021 11:23 pm

Re: ESP8266 Booting: Fatal exception (0):

Post by SvenA » Tue Dec 21, 2021 10:39 am

Hmmm, you're right.
This may be a chip with 4MB flash memory.
But the autodetection of the flash size says 1MB:

Code: Select all

Auto-detected Flash size: 1MB
So I tried to flash it with the option --flash_size=4MB using the 2MB+ image.
Nothing changed.
I tried to flash the 512KB image, but it does not work either.

I do not understand why the other project's image works and the images from this project does not...
What could be the cause?

Regards
Sven

SvenA
Posts: 4
Joined: Sun Dec 19, 2021 11:23 pm

Re: ESP8266 Booting: Fatal exception (0):

Post by SvenA » Tue Dec 21, 2021 3:37 pm

Ok, I rechecked my setup.
The chip seems to be a ESP-07 from Expressif. Not an ESP-12F, sorry for this mistake.
I ordered it with 4MB, but the auto-detection only returns 1MB. Hmm?!
But this should be enough for my purposes.

I received two new ESP-12E chips and tried to flash one of these.
It worked without problems!

But the ESP-12E package is not that different from the ESP-07 package.
So I still do not understand why I have this problem.
Has anybody tried MicroPython on an ESP-07?

Regards
Sven

Post Reply