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

to

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

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

 

Loading...
Facebooktwittergoogle_plusredditpinterestlinkedintumblrmail

8 comments

  • 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?

    Thanks
    Emiliano

    Reply
    • beegee1962

      Hi,
      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.

      Reply
  • Ido Gabovich

    Hi,
    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?

    Reply
    • 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!

      Reply
      • 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.

        Reply
        • 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.

          Reply
          • 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.

Leave a Reply

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

Free Link Directory