OTA1 Never used with Simple OTA

FreyaRose
Posts: 4
Joined: Fri Sep 13, 2019 8:25 pm

OTA1 Never used with Simple OTA

Postby FreyaRose » Wed Aug 12, 2020 11:52 pm

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

ESP_Sprite
Posts: 9759
Joined: Thu Nov 26, 2015 4:08 am

Re: OTA1 Never used with Simple OTA

Postby ESP_Sprite » Thu Aug 13, 2020 7:13 am

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.

chegewara
Posts: 2375
Joined: Wed Jun 14, 2017 9:00 pm

Re: OTA1 Never used with Simple OTA

Postby chegewara » Sat Aug 15, 2020 12:48 am

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.

Who is online

Users browsing this forum: GOT666 and 117 guests