Page 1 of 1

OTA1 Never used with Simple OTA

Posted: Wed Aug 12, 2020 11:52 pm
by FreyaRose
Hello,

I am using the simple OTA example to update my app.

I can successfully relfash OTA0 from the Factory app and boot into OTA0.

However, if I go to back to Factory to reflash again, it still uses OTA0. Shouldn't it point to OTA1 for the next update?

Everytime I check esp_ota_get_next_update_partition, it does not seem to point to OTA1 ever....

I am on a 16mb flash size, using the below partition table.

nvs data nvs 0x4000
otadata data ota 0x2000
phy_init data phy 0x1000
factory app factory 2M
ota_0 app ota_0 4M
ota_1 app ota_1 4M

Re: OTA1 Never used with Simple OTA

Posted: Thu Aug 13, 2020 7:13 am
by ESP_Sprite
I'm not too familiar with OTA, but probably not. The OTA0/OTA1 scheme mostly is there because you can't flash over a running firmware. If you use the factory flash to do OTA, there's no such limitation.

Re: OTA1 Never used with Simple OTA

Posted: Sat Aug 15, 2020 12:48 am
by chegewara
esp_ota_get_next_update_partition
Return the next OTA app partition which should be written with a new firmware.

Call this function to find an OTA app partition which can be passed to esp_ota_begin().

Finds next partition round-robin, starting from the current running partition.
https://docs.espressif.com/projects/esp ... artition_t

So, if you start each time from factory then next boot partition is always ota0.