I have noticed that when I reboot in enhance mode to manually boot user2 firmware at 0x81000 and then run the OTA upgrade to upgrade user1, it looks like starts upgrading the firmware but it fails almost immediately (WDT reboot) making both user1 and user2 unusable. Basically the bootloader will endless jump between user1 and user2 (looking for a magic number on those partition?).
I replaced system_upgrade_userbin_check() with system_get_userbin_addr() in my OTA function to identify the right file for the right partition, since in enhance mode the first function is not able to understand which partition it is running from, but I got the same problem.
Code: Select all
const char* file;
switch (system_get_userbin_addr())
{
case 0x1000: file = "user2.bin"; break;
case 0x81000: file = "user1.bin"; break;
default:
os_printf("[OTA]Invalid userbin number!\n");
return;
}
...then get the file and perform the upgrade...
Also I didn't find a way to quit the enhance mode to run the boot loader normally even after flashing again the firmware and the bootloader except doing:
Code: Select all
system_upgrade_flag_set(UPGRADE_FLAG_FINISH);
system_upgrade_reboot();
Is there a nicer way to quit that mode?
Thanks