Change partition size

To change the partition sizes, e.g. because the program doesn’t fit anymore into the default partition size, there are 3 possibilities:

  1. change the default partition table, this affects all ESP32 boards
    this method is the easiest if the new partition sizes will be used for all projects and all boards
  2. create a new partition table only for a specific ESP32 board
    this method can be used if the new partition sizes will be used for all projects but only for a specific board
  3. clone an existing device and create a partition table only for this device
    this method can be used if the new partition sizes will be used only for a specific project and a specific board

If the partition sizes are changed there is 1 main rule: The start addresses of the partitions must be a multiple of 0x1000!

Remark 1: At least in PlatformIO the partition sizes change only if you flash the board over USB/Serial. If the board is flashed over ArduinoOTA, the partition sizes do not change!

Remark 2: This change will be lost if the ESP32 package is updated !

The default partition table default.csv is located at

for PlatformIO: .platformio\packages\framework-arduinoespressif32\tools\partitions\default.csv
for Arduino IDE: Arduino\hardware\espressif\esp32\tools\partitions\default.csv

The default partition table looks like:

A partition table with maximum size for the application and no EEPROM and SPIFFS partition could look like:

Another example with a small EEPROM and SPIFFS partition:

Method 1

  1. Change the entries of default.csv to your desired partition sizes. (See paths above)
  2. Reflash your board over USB/Serial

Method 2

[Reference](https://github.com/espressif/arduino-esp32/issues/703) from @delcomp

  1. Make a copy of esp32/tools/partitions/default.csv and rename it (my example uvee.csv) (See paths above)
  2. Make the required changes
  3. Open esp32/boards.txt and find the board (<YOUR_BOARD_NAME>)you are using
  4. Make the following changes (size depends on your configuration)

  1. Reflash your board over USB/Serial

Method 3

In this example I go for the maximum app partition size (0x1F0000) and no EEPROM and no SPIFFS partition. If you change to a different partition size you need to adapt the value 2031616 (== 0x1F0000) to the value of your partition size. E.g. a partition size of 0x1E0000 would equal to a value of 1966080 inside the different files.

  1. Make a copy of default.csv and rename it (my example maxapp.csv)
  2. Make the required changes
  3. In boards.txt make a copy of the board you want to clone.
    e.g make a copy of the ESP32 Dev Module and name it as ESP32 Dev Module MaxAppPart:

  1. change the .upload.maximum_size to your new app partition size, in the example esp32maxapp.upload.maximum_size=2031616
  2. change the esp32maxapp.build.partitions name to your new partition table name, in the example esp32maxapp.build.partitions=maxapp
  3. change the esp32maxapp.name name to your new board name, in the example esp32maxapp.name=ESP32 Dev Module MaxAppPart
  4. change the esp32maxapp.build.board name to your new board name, in the example esp32maxapp.build.board=ESP32_DEV_MAXAPP
  5. (FOR PLATFORMIO) make a copy of the json file describing the board you cloned, in this example .platformio\platforms\espressif32\boards\esp32dev.json and name it esp32devmaxapp.json in esp32devmaxapp.json change “variant”: “esp32” to “variant”: “esp32maxapp” “name”: “Espressif ESP32 Dev Module” to “name”: “Espressif ESP32 Dev Module MaxAppPart”. Change “maximum_size”: 1310720 to “maximum_size”: 2031616
  6. (FOR PLATFORMIO) change in your projects platformio.ini the entry board = esp32dev to board = esp32devmaxapp
  7. (FOR PLATFORMIO) copy .platformio\packages\framework-arduinoespressif32\variants\esp32 to .platformio\packages\framework-arduinoespressif32\variants\esp32maxapp
  8. (FOR ARDUINO IDE) change in menu Tools→Board to Espressif ESP32 Dev Module MaxAppPart
  9. Reflash your board over USB/Serial

 

Loading...
Facebooktwittergoogle_plusredditpinterestlinkedintumblrmail

Leave a Reply

Your email address will not be published. Required fields are marked *

Free Link Directory