EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1029 background imageLoading...
Page #1029 background image
Chapter 2. API Reference
ESP_OTA_IMG_ABORTED (see above) and this application will no longer be able to start, i.e. there will
be a rollback to the previous work application.
A new application has started and should make a self-test.
If the self-test has completed successfully, then you must call the function
esp_ota_mark_app_valid_cancel_rollback() because the application is awaiting confir-
mation of operability (ESP_OTA_IMG_PENDING_VERIFY state).
If the self-test fails then call esp_ota_mark_app_invalid_rollback_and_reboot() function to
roll back to the previous working application, while the invalid application is set ESP_OTA_IMG_INVALID
state.
If the application has not been confirmed, the state remains ESP_OTA_IMG_PENDING_VERIFY, and the
next boot it will be changed to ESP_OTA_IMG_ABORTED. That will prevent re-boot of this application.
There will be a rollback to the previous working application.
Unexpected Reset If a power loss or an unexpected crash occurs at the time of the first boot of a new application,
it will roll back the application.
Recommendation: Perform the self-test procedure as quickly as possible, to prevent rollback due to power loss.
Only OTA partitions can be rolled back. Factory partition is not rolled back.
Booting invalid/aborted apps Booting an application which was previously set to ESP_OTA_IMG_INVALID or
ESP_OTA_IMG_ABORTED is possible:
Get the last invalid application partition esp_ota_get_last_invalid_partition().
Pass the received partition to esp_ota_set_boot_partition(), this will update the otadata.
Restart esp_restart(). The bootloader will boot the specied application.
To determine if self-tests should be run during startup of an application, call the
esp_ota_get_state_partition() function. If result is ESP_OTA_IMG_PENDING_VERIFY then
self-testing and subsequent confirmation of operability is required.
Where the states are set A brief description of where the states are set:
ESP_OTA_IMG_VALID state is set by esp_ota_mark_app_valid_cancel_rollback() func-
tion.
ESP_OTA_IMG_UNDEFINED state is set by esp_ota_set_boot_partition() function if CON-
FIG_BOOTLOADER_APP_ROLLBACK_ENABLE option is not enabled.
ESP_OTA_IMG_NEW state is set by esp_ota_set_boot_partition() function if CON-
FIG_BOOTLOADER_APP_ROLLBACK_ENABLE option is enabled.
ESP_OTA_IMG_INVALID state is set by esp_ota_mark_app_invalid_rollback_and_reboot()
function.
ESP_OTA_IMG_ABORTED state is set if there was no confirmation of the application operability and occurs
reboots (if CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE option is enabled).
ESP_OTA_IMG_PENDING_VERIFY state is set in a bootloader if CON-
FIG_BOOTLOADER_APP_ROLLBACK_ENABLE option is enabled and selected app has
ESP_OTA_IMG_NEW state.
Anti-rollback
Anti-rollback prevents rollback to application with security version lower than one programmed in eFuse of chip.
This function works if set CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK option. In the bootloader, when se-
lecting a bootable application, an additional security version check is added which is on the chip and in the application
image. The version in the bootable firmware must be greater than or equal to the version in the chip.
CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK and CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE op-
tions are used together. In this case, rollback is possible only on the security version which is equal or higher than
the version in the chip.
Espressif Systems 1018
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish