Chapter 2. API Reference
Functions
esp_partition_iterator_t esp_partition_find(esp_partition_type_t type, esp_partition_subtype_t sub-
type, const char *label)
Find partition based on one or more parameters.
Return iterator which can be used to enumerate all the partitions found, or NULL if no partitions were found.
Iterator obtained through this function has to be released using esp_partition_iterator_release when not
used any more.
Parameters
• type: Partition type, one of esp_partition_type_t values or an 8-bit unsigned integer. To find all
partitions, no matter the type, use ESP_PARTITION_TYPE_ANY, and set subtype argument to
ESP_PARTITION_SUBTYPE_ANY.
• subtype: Partition subtype, one of esp_partition_subtype_t values or an 8-bit unsigned integer.
To find all partitions of given type, use ESP_PARTITION_SUBTYPE_ANY.
• label: (optional) Partition label. Set this value if looking for partition with a specific name. Pass
NULL otherwise.
const esp_partition_t *esp_partition_find_first(esp_partition_type_t type,
esp_partition_subtype_t subtype, const
char *label)
Find first partition based on one or more parameters.
Return pointer to esp_partition_t structure, or NULL if no partition is found. This pointer is valid for the
lifetime of the application.
Parameters
• type: Partition type, one of esp_partition_type_t values or an 8-bit unsigned integer. To find all
partitions, no matter the type, use ESP_PARTITION_TYPE_ANY, and set subtype argument to
ESP_PARTITION_SUBTYPE_ANY.
• subtype: Partition subtype, one of esp_partition_subtype_t values or an 8-bit unsigned integer To
find all partitions of given type, use ESP_PARTITION_SUBTYPE_ANY.
• label: (optional) Partition label. Set this value if looking for partition with a specific name. Pass
NULL otherwise.
const esp_partition_t *esp_partition_get(esp_partition_iterator_t iterator)
Get esp_partition_t structure for given partition.
Return pointer to esp_partition_t structure. This pointer is valid for the lifetime of the application.
Parameters
• iterator: Iterator obtained using esp_partition_find. Must be non-NULL.
esp_partition_iterator_t esp_partition_next(esp_partition_iterator_t iterator)
Move partition iterator to the next partition found.
Any copies of the iterator will be invalid after this call.
Return NULL if no partition was found, valid esp_partition_iterator_t otherwise.
Parameters
• iterator: Iterator obtained using esp_partition_find. Must be non-NULL.
void esp_partition_iterator_release(esp_partition_iterator_t iterator)
Release partition iterator.
Parameters
• iterator: Iterator obtained using esp_partition_find. The iterator is allowed to be NULL, so it
is not necessary to check its value before calling this function.
const esp_partition_t *esp_partition_verify(const esp_partition_t *partition)
Verify partition data.
Given a pointer to partition data, verify this partition exists in the partition table (all fields match.)
This function is also useful to take partition data which may be in a RAM buffer and convert it to a pointer to
the permanent partition data stored in flash.
Pointers returned from this function can be compared directly to the address of any pointer returned from
esp_partition_get(), as a test for equality.
Espressif Systems 757
Submit Document Feedback
Release v4.4