Hi,
I have running applications on ESP32 that were developed on v3.2.2 or v3.3.
I converted these apps to ESP-IDF 4.0.1.
Is it safe to only use OTA for updating them or is this not safe or not recommended?
If I flash directly instead of using OTA I also re-flash the boot loader, etc...
So is it safe to only flash the app (via OTA) and leave the old boot partitions?
What is the impact of keeping the old boot partitions?
Korstiaan
Safe to update a v3.3 generated app to v4.0.1 via OTA only?
Re: Safe to update a v3.3 generated app to v4.0.1 via OTA only?
Hi Korstiaan,
Yes, this is something ESP-IDF supports.
The only thing which is not supported is booting an older app on a newer bootloader (for example, if the bootloader was from IDF v4.0.1 and the app is from IDF v3.3 then this may not work. But the other way around should always work.)
Need to make sure the partition offset configured in the new app is the same as in the old app and the bootloader. Also, ideally keep the flash configuration the same (although changing it is generally supported as well, recent ESP-IDF versions will reconfigure the SPI flash when the app starts.) If you updated the app from v3.3 to v4.0.1 and kept the same sdkconfig then this should all be unchanged.
If you mean other app partitions, this should be fine - if something goes wrong with the newly selected app (V4.0.1 app) then the bootloader can still fall back to boot one of the v3.3 apps from another app partition.
If you need a "one way upgrade" for some reason (such as non-backwards-compatible data in data partitions that will cause older versions to crash) then you can write some code to erase the older app partitiions after the v4.0.1 app successfully boots, or use the anti-rollback security feature.
Yes, this is something ESP-IDF supports.
The only thing which is not supported is booting an older app on a newer bootloader (for example, if the bootloader was from IDF v4.0.1 and the app is from IDF v3.3 then this may not work. But the other way around should always work.)
Need to make sure the partition offset configured in the new app is the same as in the old app and the bootloader. Also, ideally keep the flash configuration the same (although changing it is generally supported as well, recent ESP-IDF versions will reconfigure the SPI flash when the app starts.) If you updated the app from v3.3 to v4.0.1 and kept the same sdkconfig then this should all be unchanged.
If you mean keeping the old bootloader, it's as described above.So is it safe to only flash the app (via OTA) and leave the old boot partitions?
What is the impact of keeping the old boot partitions?
If you mean other app partitions, this should be fine - if something goes wrong with the newly selected app (V4.0.1 app) then the bootloader can still fall back to boot one of the v3.3 apps from another app partition.
If you need a "one way upgrade" for some reason (such as non-backwards-compatible data in data partitions that will cause older versions to crash) then you can write some code to erase the older app partitiions after the v4.0.1 app successfully boots, or use the anti-rollback security feature.
Re: Safe to update a v3.3 generated app to v4.0.1 via OTA only?
Hi,
But because the first step in the bootloader is:
Minimal initial configuration of internal modules
I'm a little worried that there could be strange behaviours, old bugs, bad optimisations, ... of using an 'old' bootloader from v3.3 instead of the bootloader of v4.0.1. But I don't know if there are important changes between these 2.
Are we sure that the combination of an old bootloader together with a new app is no problem?
Korstiaan
But because the first step in the bootloader is:
Minimal initial configuration of internal modules
I'm a little worried that there could be strange behaviours, old bugs, bad optimisations, ... of using an 'old' bootloader from v3.3 instead of the bootloader of v4.0.1. But I don't know if there are important changes between these 2.
Are we sure that the combination of an old bootloader together with a new app is no problem?
Korstiaan
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: Safe to update a v3.3 generated app to v4.0.1 via OTA only?
Yes. It is specified as working, so we make sure it keeps working, keep an eye out for any differences in behaviour, and compensate for that in the application. I'm pretty sure we even have automated tests to verify this.
Who is online
Users browsing this forum: Bing [Bot] and 103 guests