ESP8266 Developer Zone The Official ESP8266 Forum 2016-06-12T21:52:03+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=2260 2016-06-12T21:52:03+08:00 2016-06-12T21:52:03+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2260&p=7286#p7286 <![CDATA[Re: FOTA ESP8266-RTOS-SDK]]> for the user1.bin:
it is the backup bin, that is this bin only do a little essential work including upgrade the user2.bin, and this bin will be upgraded rarely.
for the user2.bin:
it is the real working bin, that is this bin do all the work your device need to do.
when you need to upgrade the real firmware of this device, if it is running in user2.bin, then the device reboot to user1.bin and if it is running at user1.bin, then upgrade user2.bin.
because the user1.bin is rarly upgraded, this device always get a good firmware to run.
of cause, it may not work if you need to upgrade the user1.bin(and failed upgrading user1.bin).

Statistics: Posted by tobewinner — Sun Jun 12, 2016 9:52 pm


]]>
2016-06-07T21:32:42+08:00 2016-06-07T21:32:42+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2260&p=7247#p7247 <![CDATA[FOTA ESP8266-RTOS-SDK]]>
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:

system_upgrade_flag_set(UPGRADE_FLAG_START);

After flashing,

Code:

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.
rtos_upgrade_demo.zip

Statistics: Posted by Rutharesh — Tue Jun 07, 2016 9:32 pm


]]>