ESP32 Partition calculations
ESP32 Partition size calculations
ESP32 modules come in various flash memory sizes, the most common being 4MB, but 8MB & 16MB modules are available. The flash memory needs to be partitioned depending on requirements & constraints.
The requirements include:
Is over the air (OTA) updating feature required?
Is the main application (app) substantial in size?
Is a basic files system (SPIFFS) required?
Constraints include (source):
Offset offset must be a multiple of 4 KB/ 0x1000
Type 'app' have to be placed at offsets aligned to 0x10000 (64 K)
The bootloader & partition table occupy the region 0x0 to 0x9000
Some 'standard' partition schemes for the 4MB module are:
“Single factory app, no OTA”
“Factory app, two OTA definitions” configuration
Tables can be further complicated with multiple OTA partitions:
Creating your own table to support a different layout or different sized module can be require some tedious calculations but to save you can use the following table. Just input the module size & required SPIFFS size & the table will be generated for you!