[INFO] Getting OTA rollback to work

Posts: 246
Joined: Thu Oct 03, 2019 5:15 am

[INFO] Getting OTA rollback to work

Postby zliudr » Sun Mar 29, 2020 9:41 pm

This post is about how OTA rollback didn't work for me and how I made it work. If you have more ideas than me please respond with corrections. If you're just getting started with OTA rollback, this hopefully gives you some guidance.

I have the "enable rollback" enabled in menuconfig, compiled app and uploaded to factory partition. I then erased otadata partition and that caused the factory app to run. The factory app successfully ran the simple_https_ota example and downloaded an app and OTA was successful.

Now, this "new" app doesn't have the cancel_rollback() call. It's just some old app I compiled (without enabling "enable rollback"). I never observed rollback.

I've been using app-flash for uploads. I wonder if this switch requires flashing bootloader. So I recompiled an app in full that I had the rollback option enabled. I then flashed the newly compiled bootloader to my device. I watched the messages. It seems that instead of running ota_0 regardless, factory runs. This causes an OTA, reboot, new firmware runs, press reset, observed factory app run again. So that's it! The "enable ota rollback" is in the bootloader! I really wish these things were included in the docs. Such a long doc maybe I missed it?

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 55 guests