Espressif ESP32-S2 Programming Manual page 1029

Table of Contents

Advertisement

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
esp_ota_mark_app_valid_cancel_rollback()
mation of operability (ESP_OTA_IMG_PENDING_VERIFY state).
• If the self-test fails then call
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
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 specified application.
To
determine
if
self-tests
esp_ota_get_state_partition()
self-testing and subsequent confirmation of operability is required.
Where the states are set
• ESP_OTA_IMG_VALID state is set by
tion.
• ESP_OTA_IMG_UNDEFINED state is set by
FIG_BOOTLOADER_APP_ROLLBACK_ENABLE
• ESP_OTA_IMG_NEW state is set by
FIG_BOOTLOADER_APP_ROLLBACK_ENABLE
• ESP_OTA_IMG_INVALID state is set by
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
• ESP_OTA_IMG_PENDING_VERIFY
FIG_BOOTLOADER_APP_ROLLBACK_ENABLE
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
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
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
has
completed
successfully,
esp_ota_mark_app_invalid_rollback_and_reboot()
Booting an application which was previously set to ESP_OTA_IMG_INVALID or
should
be
run
function.
A brief description of where the states are set:
esp_ota_mark_app_valid_cancel_rollback()
esp_ota_set_boot_partition()
esp_ota_mark_app_invalid_rollback_and_reboot()
state
CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
and
Submit Document Feedback
then
you
because the application is awaiting confir-
during
startup
of
If result is ESP_OTA_IMG_PENDING_VERIFY then
esp_ota_set_boot_partition()
option is not enabled.
option is enabled.
option is enabled).
is
set
in
option
is
enabled
option. In the bootloader, when se-
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
1018
must
call
the
function
function to
an
application,
call
function if
function if
a
bootloader
if
and
selected
app
Release v4.4
the
func-
CON-
CON-
CON-
has
op-

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents

Save PDF