Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.99 KB

partition.rst

File metadata and controls

41 lines (26 loc) · 1.99 KB

Partitions API

:link_to_translation:zh_CN:[中文]

Overview

The esp_partition component has higher-level API functions which work with partitions defined in the /api-guides/partition-tables. These APIs are based on lower level API provided by /api-reference/peripherals/spi_flash/index.

Partition Table API

ESP-IDF projects use a partition table to maintain information about various regions of SPI flash memory (bootloader, various application binaries, data, filesystems). More information can be found in /api-guides/partition-tables.

This component provides API functions to enumerate partitions found in the partition table and perform operations on them. These functions are declared in esp_partition.h:

  • :cppesp_partition_find checks a partition table for entries with specific type, returns an opaque iterator.
  • :cppesp_partition_get returns a structure describing the partition for a given iterator.
  • :cppesp_partition_next shifts the iterator to the next found partition.
  • :cppesp_partition_iterator_release releases iterator returned by :cppesp_partition_find.
  • :cppesp_partition_find_first is a convenience function which returns the structure describing the first partition found by :cppesp_partition_find.
  • :cppesp_partition_read, :cppesp_partition_write, :cppesp_partition_erase_range are equivalent to :cppesp_flash_read, :cppesp_flash_write, :cppesp_flash_erase_region, but operate within partition boundaries.

See Also

  • ../../api-guides/partition-tables
  • ../system/ota provides high-level API for updating applications stored in flash.
  • nvs_flash provides a structured API for storing small pieces of data in SPI flash.

API Reference - Partition Table

inc/esp_partition.inc