Espressif ESP32-S2 Programming Manual page 1035

Table of Contents

Advertisement

Chapter 2. API Reference
const
esp_partition_t
*esp_ota_get_boot_partition(void)
Get partition info of currently configured boot app.
If esp_ota_set_boot_partition() has been called, the partition which was set by that function will be returned.
If
esp_ota_set_boot_partition()
esp_ota_get_running_partition().
not contain a valid app (meaning that the running partition will be an app that the bootloader chose via
fallback).
If the OTA data partition is not present or not valid then the result is the first app partition found in the partition
table. In priority order, this means: the factory app, the first OTA app slot, or the test app partition.
Note
that
there
esp_image_verify(ESP_IMAGE_VERIFY, ...) to verify if the returned partition contains a bootable
image.
Return Pointer to info for partition structure, or NULL if partition table is invalid or a flash read operation
failed. Any returned pointer is valid for the lifetime of the application.
const
esp_partition_t
*esp_ota_get_running_partition(void)
Get partition info of currently running app.
This function is different to esp_ota_get_boot_partition() in that it ignores any change of selected boot partition
caused by esp_ota_set_boot_partition(). Only the app whose code is currently running will have its partition
information returned.
The partition returned by this function may also differ from esp_ota_get_boot_partition() if the configured
boot partition is somehow invalid, and the bootloader fell back to a different app partition at boot.
Return Pointer to info for partition structure, or NULL if no partition is found or flash read operation failed.
Returned pointer is valid for the lifetime of the application.
const
esp_partition_t
*esp_ota_get_next_update_partition(const
Return the next OTA app partition which should be written with a new firmware.
Call this function to find an OTA app partition which can be passed to esp_ota_begin().
Finds next partition round-robin, starting from the current running partition.
Return Pointer to info for partition which should be updated next. NULL result indicates invalid OTA data
partition, or that no eligible OTA app slot partition was found.
Parameters
• start_from: If set, treat this partition info as describing the current running partition. Can be
NULL, in which case esp_ota_get_running_partition() is used to find the currently running partition.
The result of this function is never the same as this argument.
esp_err_t
esp_ota_get_partition_description(const
Returns esp_app_desc structure for app partition. This structure includes app version.
Returns a description for the requested app partition.
Return
• ESP_OK Successful.
• ESP_ERR_NOT_FOUND app_desc structure is not found. Magic word is incorrect.
• ESP_ERR_NOT_SUPPORTED Partition is not application.
• ESP_ERR_INVALID_ARG Arguments is NULL or if partition's offset exceeds partition size.
• ESP_ERR_INVALID_SIZE Read would go out of bounds of the partition.
• or one of error codes from lower-level flash driver.
Parameters
• [in] partition: Pointer to app partition. (only app partition)
• [out] app_desc: Structure of info about app.
uint8_t esp_ota_get_app_partition_count(void)
Returns number of ota partitions provided in partition table.
Espressif Systems
has
not
been
The two results are not equal if the configured boot partition does
is
no
guarantee
the
1024
Submit Document Feedback
called,
the
result
returned
partition
is
*start_from)
esp_partition_t
esp_app_desc_t
*app_desc)
is
usually
the
same
a
valid
app.
Use
esp_partition_t
*partition,
Release v4.4
as

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?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF