Chapter 4. API Guides
• When type is data, the subtype field can be specified as ota (0x00), phy (0x01), nvs (0x02), nvs_keys
(0x04), or a range of other component-specific subtypes (see subtype enum).
– ota (0) is the OTA data partition which stores information about the currently selected OTA app slot.
This partition should be 0x2000 bytes in size. Refer to the OTA documentation for more details.
– phy (1) is for storing PHY initialisation data. This allows PHY to be configured per-device, instead of
in firmware.
* In the default configuration, the phy partition is not used and PHY initialisation data is compiled into
the app itself. As such, this partition can be removed from the partition table to save space.
* To load PHY data from this partition, open the project configuration menu (idf.py menucon-
fig) and enable CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION option. You will also need to
flash your devices with phy init data as the esp-idf build system does not do this automatically.
– nvs (2) is for the Non-Volatile Storage (NVS) API.
* NVS is used to store per-device PHY calibration data (different to initialisation data).
* NVS is used to store WiFi data if the esp_wifi_set_storage(WIFI_STORAGE_FLASH) initialisation
function is used.
* The NVS API can also be used for other application data.
* It is strongly recommended that you include an NVS partition of at least 0x3000 bytes in your project.
* If using NVS API to store a lot of data, increase the NVS partition size from the default 0x6000
bytes.
– nvs_keys (4) is for the NVS key partition. See Non-Volatile Storage (NVS) API for more details.
* It is used to store NVS encryption keys when NVS Encryption feature is enabled.
* The size of this partition should be 4096 bytes (minimum partition size).
– There are other predefined data subtypes for data storage supported by ESP-IDF.
These include FAT filesystem (ESP_PARTITION_SUBTYPE_DATA_FAT), SPIFFS
(ESP_PARTITION_SUBTYPE_DATA_SPIFFS), etc.
Other subtypes of data type are reserved for future ESP-IDF uses.
• If the partition type is any application-defined value (range 0x40-0xFE), then subtype field can be any value
chosen by the application (range 0x00-0xFE).
Note that when writing in C++, an application-defined subtype value requires casting to type
esp_partition_subtype_t in order to use it with the partition API.
Offset & Size
Partitions with blank offsets in the CSV file will start after the previous partition, or after the partition table in the
case of the first partition.
Partitions of type app have to be placed at offsets aligned to 0x10000 (64K). If you leave the offset field blank,
gen_esp32part.py will automatically align the partition. If you specify an unaligned offset for an app partition,
the tool will return an error.
Sizes and offsets can be specified as decimal numbers, hex numbers with the prefix 0x, or size multipliers K or M
(1024 and 1024*1024 bytes).
If you want the partitions in the partition table to work relative to any placement (CON-
FIG_PARTITION_TABLE_OFFSET) of the table itself, leave the offset field (in CSV file) for all partitions
blank. Similarly, if changing the partition table offset then be aware that all blank partition offsets may change to
match, and that any fixed offsets may now collide with the partition table (causing an error).
Flags
Only one flag is currently supported, encrypted. If this field is set to encrypted, this partition will be encrypted
if Flash Encryption is enabled.
Note: app type partitions will always be encrypted, regardless of whether this flag is set or not.
Espressif Systems 1436
Submit Document Feedback
Release v4.4