The flash memory of the ESP32 is divided into several partitions.
The standard partition table divides the flash memory as follows:
default.csv
:
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
app0, app, ota_0, 0x10000, 0x140000,
app1, app, ota_1, 0x150000,0x140000,
spiffs, data, spiffs, 0x290000,0x160000,
coredump, data, coredump,0x3F0000,0x10000,
Meanings and size in kB:
NVS data 20 kB (nvs storage)
OTA data 8 kB (ota configuration)
APP0 1280 kB (this is where your app goes)
APP1 1280 kB (this is where your app goes)
SPIFFS 1408 kB (data partition)
COREDUMP 64 kB (coredump goes here)
-------------------------------------------------
sum 4060 kB
The first 36 kB of the flash memory are reserved and cannot be used.
For this reason, the first partition starts at offset 0x9000.
36 kB + 4060 kb make up the 4 MB of your ESP32.
This means that 1280 kB (1310720 bytes) are available for your app.
The 70% refers to this size.
Two app partitions of the same size are required to use OTA.
One partition is active and an update is saved to the other.
If an update is successful, the system switches between the partitions.
You can create your own partition table that works with a different partitioning. See Espressif 32 — PlatformIO latest documentation
For example, you can reduce the size of the SPIFFS partition and increase the size of the two app partitions. Details on the structure of the partition table can be found at Partition Tables - ESP32 - — ESP-IDF Programming Guide latest documentation
Please note the information on the offset and sizes of the various partitions at Partition Tables - ESP32 - — ESP-IDF Programming Guide latest documentation