I have been testing FOTA upgrade process with custom server and ESP8285.
When running user1.bin -> the system OTA downloads user2.bin and reboots -> no problem.
However when running user2.bin -> after calling system_upgrade_start -> we receive the HEAD request on the server and the GET (download) -> after awhile (a few seconds) -> UART interface (used for debug) starts to send garbage.
When I manually reset the ESP8285 it jumps to user2.bin but throws a fatal exception epc1=0x40201dd4 (all others epc=0x00000000).
The only way to solve the boot problem is to flash (UART download) a valid user1.bin.
After manually flashing user1.bin the system runs (not the user1.bin just flashed) but user2.bin.
Despite the system is running (user2.bin) somehow what is saved on user1.bin can crash the system - what is odd.
Where does the system saves info about which user.bin to run on startup?
This really seems like a bug on bootv1.7.bin
It seems to always erase the user2.bin, when you run user1.bin to erase and update the user2.bin, it works fine; but when you run user2.bin, it is still erasing the user2.bin so the system crashed, because you erased the running firmware.
Before that, I had cases when system_upgrade_userbin_check() was 1 (== bin2) and system_get_userbin_addr() was 0x1000... I flashed starting from 0x1000 and the whole thing crashed under my nose.
I know I'm running user2.bin, because system states (on boot): jump to run user2 @ 81000
I'm sure the FOTA functions are erasing / writing user1.bin - when the garbage on the UART appear.
To make it work again I need to flash user1.bin - however the sytem still states (on boot): jump to run user2 @ 81000
So it seems I can´t let system_upgrade_start flash whatever it wants on user1, because it might destroy booting user2 (current firmware booting). If I completely erase the user1.bin area (by UART), it also works, booting user2.
So I'm now sure system_upgrade_start can flash something wrong to user1.bin area that prevents system bootv.1.7.bin to run user2 (that has a valid firmware loaded). I don't understand is why bootv.1.7.bin has to check user1.bin area, when the flag is set to run user2.bin.
Maybe someone from EspressIf can reply.
Who is online
Users browsing this forum: No registered users and 6 guests
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
We also have a RTOS version and a MESH version too!
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!