Keep both OTA_0 and OTA_1 alive, factory as FOTA bootloader

ndnam198
Posts: 1
Joined: Mon Jul 19, 2021 2:44 pm

Keep both OTA_0 and OTA_1 alive, factory as FOTA bootloader

Postby ndnam198 » Mon Jul 19, 2021 3:20 pm

*** I have been doing ota via bt spp (serial port profile) for a couple of days and got some issues that cannot be clarified however I tried
*** First let me describe my idea:
My partition table includes factory and 2 ota parititons, each size is 1MB. I planned to implement these:
- factory as an ota bootloader which will only do ota update via bt spp and select the new app to boot.
- ota_x will be the application that run all along the time until receiving an OTA_UPDATE_REQUEST from external, it'll boot back to factory partition and let the factory guy does his job
(this thread shows how to get factory as next boot partition: https://www.esp32.com/viewtopic.php?t=4210)
For example: if ota_1 is the running app and ota_1 receive OTA_UPDATE_REQUEST, after reboot factory will get ota_2 from esp_ota_get_next_update_partition(), everything that lied at ota_1 should remain intact and I can rollback to this partition whenever I want
*** But here are the results that I really got:
I got ota_0 updated from the factory partition (it worked ok at this step). From ota_0 I did esp_ota_get_next_update_partition(), surely it returned ota_2 as expected. But after boot back to factory app and run esp_ota_get_next_update_partition() again, it returned ota_1 as next available candidate for fota process which was unexpected. And I tried to set ota_1 via esp_ota_set_boot_partition(), it just said the partition has no app data. I have had no way to retrieve my valid ota_0 from this factory app. I assumed the image was still there but the otadata partition just did not allow me to select it.
Could anyone explain this to me pls? Any help would be appreciated !!!

Who is online

Users browsing this forum: No registered users and 111 guests