New partition scheme - not able to use

I am developing an app for a esp32s3 based device from Waveshare.

It has 16MB flash. Wiki here: https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-1.85C

Wiki says :

    1. If the app has a speech recognition model, then select "ESP SR 16M (3MB APP/7MB SPIFFS/2.9MB MODEL)" for Partition Scheme
    2. If the app doesn't have a speech recognition model, then select "16M Flash (3MB APP/9.9MB FATFS)" or other for Partition Scheme

Now these 2 partition schemes work fine.

However, I need larger application space. So either I will decrease/remove the SPIFFS/FATFS partition, or I will remove the OTA.

So I create a new partition scheme with following content:

#Name,   Type, SubType, Offset,  Size, Flags

nvs,      data, nvs,     0x9000,  0x5000,
otadata,  data, ota,     0xe000,  0x2000,
app0,     app,  ota_0,   0x10000, 0x780000,
app1,     app,  ota_1,   0x790000,0x780000,
spiffs,   data, spiffs,  0xF10000,0x0EF000,

or this one:

#Name,   Type, SubType, Offset,  Size, Flags

nvs,      data, nvs,     0x9000,  0x5000,
otadata,  data, ota,     0xe000,  0x2000,
app0,     app,  ota_0,   0x10000, 0x640000,
app1,     app,  ota_1,   0x650000,0x640000,
spiffs,   data, spiffs,  0xc90000,0x360000,
coredump, data, coredump,0xFF0000,0x10000,

and then I select it from the IDE (new partition scheme is only visible after deleting cache folder of IDE)

but when building I receive the following error as if the app partition is only 1.3MB (default)

Sketch uses 3393222 bytes (258%) of program storage space. Maximum is 1310720 bytes. Global variables use 156608 bytes (47%) of dynamic memory, leaving 171072 bytes for local variables. Maximum is 327680 bytes.

I assume the IDE could not find my partition definition (csv) file. So I tried spoiling the partition scheme. I changed the size to a value which is not divisible to 16. The IDE complained about it.

So I understand that IDE can find my csv file and use it. But then why it does not assign the correct partition space and meet requirement of the app ?

As your topic does not relate directly to the installation or operation of the IDE it has been moved to the Programming category of the forum

I have played with modifying partion schemes a little bit, and there is a good chance you didn't modify all the correct files. First of all i want to state that the way to do this is to 'add' entries to the current files and not to overwrite them.

I have some trouble finding your exact board type in the pulldown. I found 'Waveshare ESP32 S3 Touch LCD 1.69'
But not all the partition schemes you list are available with that selection.
So what do you use as a board selection ?

As it does not relate to programming at all, i don't think it belongs there either. 3rd Party Boards ?

Hi @ilkeraktuna

Arduino IDE determines the maximum program storage space from the value of the upload.maximum_size property in the board definition in boards.txt. The Arduino boards platform framework is general purpose, while the partition file is architecture-specific. So the platform framework doesn't know or care about the data in the partition file.

So you need to update the value of the upload.maximum_size property in the board definition to reflect any changes you make to the available program memory.

As an example, take a look at how the property is defined in the "ESP32S3 Dev Module" board definition:

[...]

esp32s3.menu.PartitionScheme.no_fs=No FS 4MB (2MB APP x2)
esp32s3.menu.PartitionScheme.no_fs.build.partitions=no_fs
esp32s3.menu.PartitionScheme.no_fs.upload.maximum_size=2031616
esp32s3.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
esp32s3.menu.PartitionScheme.no_ota.build.partitions=no_ota
esp32s3.menu.PartitionScheme.no_ota.upload.maximum_size=2097152

[...]

Note how it defines a different value depending on which option the user has selected from the Tools > Partition Scheme custom board options menu in Arduino IDE (which has the machine identifier PartitionScheme).

If the user selects the Tools > Partition Scheme > No FS 4MB (2MB APP x2) option (which has the machine identifier no_fs) from the menu, then the property is defined with the value 2031616:

esp32s3.menu.PartitionScheme.no_fs.upload.maximum_size=2031616

but if the user instead selects the Tools > Partition Scheme > No OTA (2MB APP/2MB SPIFFS) option (which has the machine identifier no_ota) from the menu, then the property is instead defined with the value 2097152:

esp32s3.menu.PartitionScheme.no_ota.upload.maximum_size=2097152

You can learn about the custom board options system from the documentation here:

https://arduino.github.io/arduino-cli/latest/platform-specification/#custom-board-options


Make sure to restart Arduino IDE (or alternatively select Tools > Reload Board Data from the Arduino IDE menus) after making any change to the boards.txt file, as Arduino IDE loads the data from that file on startup and thus any changes you make to the file while Arduino IDE is running won't take effect until you do that.

well , actually this issue is not related to programming.

It is a IDE related problem. IDE does not use the partition scheme I selected.

Why do you assume this is “programming” related ?

Btw, I had chosen main category “Development Tool” and sub category “Uploading” I believe.

thank you.

there is also a generic definition:

esp32s3.upload.maximum_size=1310720
esp32s3.upload.maximum_data_size=327680

this is not specific to partition scheme. SHould I also increase this ?

That definition serves as a fallback. A subsequent definition associated with the custom board option will override it.

No, because some of the existing custom board options rely on that fallback. For example:

esp32s3.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
esp32s3.menu.PartitionScheme.default.build.partitions=default
esp32s3.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
esp32s3.menu.PartitionScheme.defaultffat.build.partitions=default_ffat

Here you can see that the "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)" and "Default 4MB with ffat (1.2MB APP/1.5MB FATFS)" custom board options do not define an upload.maximum_size property, so when one of those options is selected, the fallback definition will be used.

So if you change the value, you will also change the value used when those and other custom board options are selected. Presumably the current value of the property is correct when those partitions are in use.

You originally posted in the IDE 1.x category of the forum and I moved it to Programming as I misunderstood the problem
image

I have now moved it to 3rd Party Boards

thank you. it works fine now.

You are welcome. I'm glad it is working now.

Regards, Per