Change partition size (Arduino IDE)

DEPRECATED. The partition size can now be choosen from the Tools–>Partition Scheme menu.

To change the partition size for ESP32 using Arduino IDE I recommend this approach:

Create a new partition description file in <LOCATION_OF_ARDUINO_ESP32>/tools/partitions , e.g max.csv

The above example gives you a partition size of 0x1E0000 or 1966080 bytes on cost of a smaller SPIFFS partition.

Edit <LOCATION_OF_ARDUINO_ESP32>/boards.txt

Make a copy of the board description that you want to change the partition size for, in this example I copied ESP32 Dev Module. Rename all ‘esp32.‘ entries to ‘esp32max.‘. Change the lines


Save all, restart ArduinoIDE and select the new board ‘ESP32 DEV MAX

Example output of a very large sketch including BLE and Bluetooth Serial:




  • emiliano

    Hi, this procedure update the esp32 partition also via OTA?
    I have some board in my enviroment and i would you like to change their partition via OTA.
    Now i m using Arduino IDE 1.8.5
    Can i do this?


    • beegee1962

      Should work, but I never did it in person. If I were you, I would try on a device that you can access and reflash by USB if it fails.

  • Ido Gabovich

    Thank’s a lot it’s work like magic!
    Is there another partition size that can give more than 1966080 bytes? My code consume lot of memory (include ble and WiFi).

    I use NodeMCU-32S (16MB Flash, 520KB SRAM.) but in compiling with arduino 1.8.5 it’s work for me when i chose the ESP32 Dev Module board. Is it matter?

    • beegee1962

      You can try to get rid of the OTA capability and define only 1 app partition instead of 2 (needed for OTA functionality only):
      # Name, Type, SubType, Offset, Size, Flags
      nvs, data, nvs, 0x9000, 0x5000,
      otadata, data, ota, 0xe000, 0x2000,
      app0, app, ota_0, 0x10000, 0x3C0000,
      eeprom, data, 0x99, 0x3F0000,0x1000,
      spiffs, data, spiffs, 0x3F1000,0xF000,

      That could give you 3932160 bytes for application.

      BUT!!!! I never tried to eliminate one of the OTA app partitions. Try with care!

      • Ido Gabovich

        Thank’s I’ll try it!
        Sorry but I’m a beginner in this, do i need the OTA? I don’t know what is it for…
        My project basically include wifi, ble, LCD and maybe RTC in the future.

        • beegee1962

          OTA is for updating the application on your ESP32 over WiFi. So if you have mounted your ESP32 somewhere where it is difficult to connect to your PC and upload a new version of your application, you can use the WiFi connection to update instead.
          For example, I have motion sensors mounted on high positions in my front and back yard. If I want to update the application running on them, I don’t need to go there with a laptop, plug in a USB cable and flash the new application. Instead I can update them over WiFi from my desktop.

          • Ido Gabovich

            It is possible that the new partition make the ESP32 and it’s code to work slower than the default partition?
            I tested the same code (simple control the ESP via BLE) and it’s barely run with the 1966080 bytes. With the default partition it’s work flawlessly.

          • beegee1962

            I am using this partition scheme all the time and I didn’t see any performance issues. But maybe the experts at Arduino-ESP32 know more.

  • David Hale

    Thanks so much!! I spent hours searching for a solution to fitting my code once I added Bluetooth. My program storage suddenly jumped from 52% to 96% !!
    It took me a while to realize many ESP32 boards like mine could not alter their partition sizes without a ‘tweak’.
    I was considering an added HC-05 instead of using ESP32’s BT, but I consider these modifications preferable.
    Please keep this information for others.

  • Steven

    Hi Sir,
    I wanna ask about Bluetooth

    I’ve tried with your code about Bluetooth serial and BLE.

    when I’m tried to upload the Bluetooth serial to my Doit ESP32 it’s fine, but it’s not detected by the apps..

    do oyu know any solution ?

    • beegee1962

      I can only guess, it is working fine for me.
      You can check in Android Settings if the ESP32 is shown there.
      The Android app shows only BT devices that starts with ESP32….. If you changed the name of the BT serial in the ESP32 code it will not be shown in the Android app.
      What version of Android are you using? I tried only on Android 5. It might be different if your phone has a newer version of Android.

  • abdallah yasser

    hi sir,
    i want to thank you for this tutorial
    you made my day <3

  • Neil Barnett

    General comment:
    the Bluetooth libraries seem to take up a lot of space, I will have to configure my ESP32 for a larger partition eventually, but in the meantime, I found that the TFT_eSPI library can give me back 20k if I turn off smoothed fonts. This is more than enough for the final few lines of my code, even though I am on 98%.
    It serves me right for including Wifi, time, TFT, TM1637, Bluetooth serial,7789 TFT, SPI, FastLED and Preferences, but it is a digital, analogue and binary clock!

    • beegee1962

      Another possibility is to use NimBLE library for ESP32.
      90% compatible with the Arduino BLE library but uses less Flash and Heap memory. I switched most of my projects to NimBLE.

      • ashish

        I Don’t know why, after uploading firmware in ESP32, device still not visible by scanning , putting same firmware and same Android Application , mentioned above.

  • Hein

    Great explanation and a big help.


  • ashish

    I Don’t know why, after uploading firmware in ESP32, device still not visible by scanning , putting same firmware and same Android Application , mentioned above.


Leave a Reply

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

Free Link Directory