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 #1035 background imageLoading...
Page #1035 background image
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() has not been called, the result is usually the same as
esp_ota_get_running_partition(). The two results are not equal if the configured boot partition does
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 is no guarantee the returned partition is a valid app. Use
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 esp_partition_t
*start_from)
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 esp_partition_t *partition,
esp_app_desc_t *app_desc)
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 partitions 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 1024
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