OTA upgrade failure with bootloader in enhance mode

molete
Posts: 2
Joined: Mon Mar 07, 2016 8:30 pm

OTA upgrade failure with bootloader in enhance mode

Postby molete » Mon Mar 07, 2016 9:07 pm

Hi,
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

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: OTA upgrade failure with bootloader in enhance mode

Postby ESP_Faye » Fri Mar 11, 2016 6:00 pm

Hi,

Here is a simple example of OTA http://bbs.espressif.com/viewtopic.php?f=7&t=423#p1619

To quit from enhance mode, you need to download blank.bin to initialize the system parameters. Or call system_restore to reset the system parameters.

If your problem is still unsolved, please feel free to let us know.

molete
Posts: 2
Joined: Mon Mar 07, 2016 8:30 pm

Re: OTA upgrade failure with bootloader in enhance mode

Postby molete » Sat Mar 12, 2016 1:04 am

thanks for your reply, that FOTA example you posted is exactly what I'm using, but it does not work when the bootloader is in enhance mode, making also both firmware partitions unusable.

Who is online

Users browsing this forum: No registered users and 2 guests