I have placed the user1.bin and user2.bin in the local server. I have used the flash size of
FLASH_SIZE_32M_MAP_1024_1024 Flash size : 32Mbits. Map : 1024KBytes + 1024KBytes
I am currently running the user1.bin and from that i have successfully flashed the user2.bin, before flashing I will call
Code: Select all
system_upgrade_flag_set(UPGRADE_FLAG_START);
After flashing,
Code: Select all
system_upgrade_flag_set(UPGRADE_FLAG_FINISH);
system_upgrade_reboot();
When I call system_upgrade_reboot(), the device is successfully booted in user2.bin and viceversa from user2.bin to user1.bin
case 1:
Now I am running user1.bin, when there is an issue in booting the newly flashed user2.bin, it fails to boot. Now the the backup bin (user1.bin) gets booted successfully and its log as follows.
[FOTA Update]: Upgrade success, rebooting device...
reboot to use2
del if0
usl
sul 0 0
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0
2nd boot version : 1.4(b1)
SPI Speed : 40MHz
SPI Mode : DIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user2 @ 81000
error magic!
first boot failed, reboot to try backup bin
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0
2nd boot version : 1.4(b1)
SPI Speed : 40MHz
SPI Mode : DIO
SPI Flash Size & Map: 32Mbit(512KB+512KB)
jump to run user1 @ 1000
The device runs the Backup bin (In this case user1.bin)
case 2:
When user2.bin is running, and if there is an issue in user1.bin file the reboot of user1.bin fails and device tries to boot the backup user2.bin in the address "0x81000". But the device always tries to boot the backup bin in the address location of "0x01000" which points to "user1.bin"(already failed to boot).
In this case the device fails to boot the correct backup bin, so the device moves to a dead state.
In this case, please provide a solution to boot the correct backup bin.