Skip to content

Commit

Permalink
Clear RTC memory on rollbacks (#2334)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperl authored May 23, 2024
1 parent a48e6cc commit 14251f1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/primitive_esp32.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ PRIMITIVE(ota_rollback) {
PRIVILEGED;
bool is_rollback_possible = esp_ota_check_rollback_is_possible();
if (!is_rollback_possible) FAIL(PERMISSION_DENIED);
RtcMemory::invalidate(); // Careful: This clears the RTC memory on boot.
esp_err_t err = esp_ota_mark_app_invalid_rollback_and_reboot();
ESP_LOGE("Toit", "esp_ota_end esp_ota_mark_app_invalid_rollback_and_reboot (%s)!", esp_err_to_name(err));
FAIL(ERROR);
Expand Down

0 comments on commit 14251f1

Please sign in to comment.