Arduino core for ESP32 Wiki content

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

# 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

...
    "variant": "esp32dev"
...
    "maximum_size": 1310720,
...

to

...
    "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.