Change partition size (PlatformIO)
To change the partition size for ESP32 using PlatformIO I recommend this approach:
Create a new partition description file in <USER>\.platformio\packages\framework-arduinoespressif32\tools\partitions, e.g max.csv
1 2 3 4 5 6 7 |
# Name, Type, SubType, Offset, Size, Flags nvs, data, nvs, 0x9000, 0x5000, otadata, data, ota, 0xe000, 0x2000, app0, app, ota_0, 0x10000, 0x1E0000, app1, app, ota_1, 0x1F0000,0x1E0000, eeprom, data, 0x99, 0x3F0000,0x1000, spiffs, data, spiffs, 0x3F1000,0xF000, |
The above example gives you a partition size of 0x1E0000 or 1966080 bytes on cost of a smaller SPIFFS partition.
Then go to <USER>\.platformio\packages\framework-arduinoespressif32\variants and make a copy of the folder matching your board, for my board that is the folder ‘esp32‘ and my copy is named ‘esp32max‘
Then go to <USER>\.platformio\platforms\espressif32\boards\ and copy the .json file matching your board, for my board that is the folder ‘esp32dev.json‘ and my copy is named ‘esp32max.json‘.
Open ‘esp32max.json‘ with a text editor and change
1 2 3 4 5 |
... "variant": "esp32dev" ... "maximum_size": 1310720, ... |
to
1 2 3 4 5 6 |
... "variant": "esp32max", "partitions": "max.csv" ... "maximum_size": 1966080, ... |
(You might to add the “partitions” part if it is not existing).
Restart Atom/Visual Studio Code and create a new project. You will now find a board ‘ESP32 Max’ which will use the changed partition table.







00:13
I had to use add “max.csv” instead of just “max”, but other than that it worked perfectly.
22:05
Same here. It works only with the full file name (e.g. “min_spiffs.csv”) is given in the json file with the board description.
20:09
Thanks Daniel and Verkehrsrot for the correction. Need to update this tip as PlatformIO offers now an easier way to implement custom partition tables.
04:41
“partitions”: “max”
Needed to include the .csv extention
“partitions”: “max.csv”
Other than that this worked perfectly! Thank you.
08:02
Thank for reporting my mistake. Will correct it.