ESP8266 Developer Zone The Official ESP8266 Forum 2018-08-21T16:23:54+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=12134 2018-08-21T16:23:54+08:00 2018-08-21T16:23:54+08:00 https://bbs.espressif.com:443/viewtopic.php?t=12134&p=22816#p22816 <![CDATA[FOTA version causes FatalException (0) after boot, but non-FOTA works]]>
I have a NON-FOTA code that compiles and works perfectly fine on the ESP8266.
However if I compile the exact same code for OTA build, with the same compiler and linker options and linking the same libraries, the bootloader jumps @01000 to run user1, but immediatly after throws a fatal exception, without even executing the very first line I put in user_rf_cal_sector_set() (a simple debug printf):

Code:

2nd boot version : 1.7(5d6f877)
SPI Speed : 40MHz
SPI Mode : DIO
SPI Flash Size & Map: 16Mbit(512KB+512KB)
jump to run user1 @ 1000

Fatal exception (0): epc1=0x401000c1, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0J000000
Fatal exception (0): epc1=0x401000c1, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0J000000
...


However, if I use the same makefile to compile other sample code in OTA mode (i.e. I only change the .c sources being compiled), and flash it at address 0x01000, it runs perfectly fine.

I have no compiler nor linker errors or warnings.

Any clue why I'm getting this fatal exception ? How to solve it ?
I would love you :)

NB: By NON-FOTA, I mean a software flashed at address 0x10000 with booloader eagle.flash.bin
By FOTA, I mean a software user1 or user2 (as Espressif calls them) with user1 flashed at 0x01000 with bootloader boot_v1.7.bin.
I use esptool.py elf2image version=2 to convert the ELF to a binary for FOTA.
I'm using a ESP8266 with 2MB of flash on a WROOM-02 board, and I compile with esp-open_sdk toolchain, NONOS SDK 2.2

Statistics: Posted by Pato — Tue Aug 21, 2018 4:23 pm


]]>