How to Customize Partitions
This document describes how to customize the partitions in your ESP32 by modifying the at_customize.csv table provided by ESP-AT. There are two partition tables: the primary partition and the secondary partition table.
The primary partition table partitions_at.csv is for system usage, based on which the partitions_at.bin file is generated. If the primary partition table goes wrong, the system will fail to startup. Therefore, it is not recommended to modify the partitions_at.csv.
ESP-AT provides a secondary partition table at_customize.csv that you can customize to store self-defined blocks of data. It is based on the primary partition table.
To modify the partition in your ESP32, please follow the first three steps. The fourth section illustrates the three steps with an example.
Find the at_customize.csv for your module with reference to the following table.
Then, follow the rules below when modifying at_customize.csv.
Do not change the
Typeof the user partitions that have already been defined in it, while
Sizecan be changed.
If you need to add a new user partition, please check if it has already been defined in the ESP-IDF (
If yes, you should keep the
Typevalue the same as that of ESP-IDF.
If no, please set the
A user partition’s
Nameshould not be longer than
The default size of the entire
at_customizepartition is defined in the partitions_at.csv table. Please do not exceed the range when adding new user partitions.
After having modified the at_customize.csv, you can either recompile the ESP-AT project to generate the at_customize.bin file, or use the python script
If you use the script, execute the following command under the root directory of ESP-AT project and replace
python esp-idf/components/partition_table/gen_esp32part.py <INPUT> [OUTPUT]
INPUTwith the path to at_customize.csv or the binary file to parse.
OUTPUTwith the path to output converted binary or CSV file. Stdout will be used if omitted.
Flash at_customize.bin into ESP32 Device
Download the at_customize.bin into flash. Please refer to Flash AT Firmware into Your Device for how to flash bin files into ESP32 device and the following table for the download address for your module.
There are cases where at_customize.bin must be downloaded to flash in order to use certain AT commands:
The section demonstrates how to add a 4 KB partition named
test into the ESP32-WROOM-32 module.
Firstly, find the at_customize.csv table for ESP32-WROOM-32 and set the
Size of the new partition:
Secondly, recompile the ESP-AT project, or execute the python script in the ESP-AT root directory to generate at_customize.bin.
python esp-idf/components/partition_table/gen_esp32part.py -q ./module_config/module_esp32_default/at_customize.csv at_customize.bin
Then, the at_customize.bin will be generated in the ESP-AT root directory.
Thirdly, download the at_customize.bin to flash.
Execute the following command under the root directory of ESP-AT project and replace
python esp-idf/components/esptool_py/esptool/esptool.py -p PORT -b BAUD --before default_reset --after hard_reset --chip auto write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x20000 ./at_customize.bin
PORTwith your port name.
BAUDwith the baud rate.