Rollback support for OTA ? #12350
Replies: 3 comments 6 replies
|
Hi, I see this feature(config) is enabled for all SoCs in our core. I will test to see if its working properly. |
|
@MarusGradinaru to update to latest pin the version. Use this It uses the original libs from release section of this repo. If the feature works with ArduinoIDE it will work with pioarduino too. |
|
@MarusGradinaru, you absolutely can use the ESP32 bootloader-level rollback in Arduino IDE. @P-R-O-C-H-Y was right that in the official Arduino-ESP32 core bootloader is already rollback-enabled by default. The issue why firmware rollbacks do not work straight away is again Arduino. By default, Arduino auto-validates all the firmware that gets uploaded to your ESP32, so whenever you check your firmware status it always says ESP_OTA_IMG_VALID. Why? Probably because it saves the beginners from the confusion why their firmware suddenly changes on the fly. The fix is very easy: just copy-paste the following function as-is to your code global scope - somewhere so it runs before setup() - and that's literally it. That deactivates the Arduino auto-validation and now you can use the bootloader's rollback feature. extern "C" bool verifyRollbackLater(void)
{
return true;
} |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi !
From what I understand, ESP-IDF has a rollback system for OTA uploads.
That is, after the upload, the partition with the new firmware is marked with the
SP_OTA_IMG_PENDING_VERIFYflag, and if at the next boot you do not manually call a function from the code that validates the firmware, the second boot will run the old stable firmware.I tried OTA upload with ArduinoOTA library and it seems that the old firmware is not rolled back if I restart the device without validating the new one... They say that I must enable this behavior with
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE. But I don't know where to make that setting. I am working in PlatformIO and I tried to add it inplatformio.iniatbuild_flags =. But it has no effect...Can you tell me what should I do to enable this rollback option on ESP32 ?
All reactions