Partition Tables Question

Partition tables seem to be sticky. Deleting the ~\AppData\Roaming\arduino-ide does not change things.

Here is what I think I know:

  1. If you put partitions.csv in the sketch directory, the build process will use that.

  2. If you select a (non-default) partition scheme, the build process will use that.

  3. If you then open a new sketch and leave the partition to the default, the build process will use the partition scheme used in #2.

  4. If you modify the .csv file that defines a partition scheme in the ~\AppData\Local...\tools\partitions directory, the changes are never recognized.

It is this odd stickyness that is hard to understand. If I knew what to delete to cause the current selected partition setting under the Tools menu to always be in effect, I would be happy.

Hi @fboggle. I am interested in looking into this, but I'm actually not very knowledgeable about the partition system as I have happened to not find a need to depart from the defaults in my trivial use of the boards that have such a system during the course of my support and beta testing work.

So I'll need some additional information from you so that I can try to reproduce the fault myself.

Which board do you have selected from the Tools > Board menu in Arduino IDE?

What is the specific indicator you are observing to conclude that the unexpected results you describe in points (3) and (4) are occurring?

Thanks for your help.

I am using ESP32-S2 and ESP32-S3 platforms (specifically UM TinyS2 and UM TinyS3).

In step 3. I expect that the build process will use the partition scheme I chose under the Tools/Partition Scheme -- specifically for the S3 board, the Default Scheme (3 MB App, 1.5 MB Spiff)

In step 4. If I change the partition scheme from three OTA partitions to four OTA partitions, then rebuild, I expect that the build will show four OTA partitions. Instead I will see three OTA partitions.

I routinely delete the ~/AppData/Roaming/arduino-ide directory after making any of these changes. It seems that there is some per-sketch information that is being cached and these external changes to the partition table are not being recognized.

Thanks.

What exactly do you mean by "see"?

Where do you "see" that there are three partitions?

What specific procedure can I follow on my own computer and ESP32 board to verify that there are three partitions instead of the expected four?

python ~/AppData/Local/Arduino15/packages/esp32/hardware/esp32/2.0.13/tools/gen_esp32part.py sketch.ino.partitions.bin

This will dump the partitions of the created binary.

OK, I had a look at what the "Partition Scheme" custom board option does in the "esp32" boards platform so I'm a bit more familiar with the subject now.

I'm going to ask you to provide the verbose output from the build process during some of the steps from your report so I can check whether there is anything unusual there.

Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to "Show verbose output during: ☐ compilation" in the "Preferences" dialog.
  3. Click the "OK" button.
  4. Perform the operation you described in your item (2):
  5. Wait for the compilation to finish.
  6. Right click on the black "Output" panel at the bottom of the Arduino IDE window.
  7. From the context menu, click Copy All.
  8. Open any text editor program.
  9. Paste the copied output into the text editor.
  10. Save the file in .txt format with the filename 2.txt.
  11. Open a forum reply here by clicking the "Reply" button.
  12. Click the "Upload" icon (image) on the post composer toolbar:
    Upload icon on toolbar
    A dialog will open.
  13. In the dialog, select the 2.txt file you saved.
  14. Click the "Open" button.
  15. Perform the operation you described in your item (3):
  16. Wait for the compilation to finish.
  17. Right click on the black "Output" panel at the bottom of the Arduino IDE window.
  18. From the context menu, click Copy All.
  19. Open any text editor program.
  20. Paste the copied output into the text editor.
  21. Save the file in .txt format, with the filename 3.txt.
  22. Switch back to the browser window where you are composing the forum reply.
  23. Attach the 3.txt file, just as you did with the previous one.
  24. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in the steps above, you can simply drag and drop the .txt file onto the post composer field to attach it.


Please let me know if you have any questions or problems while following those instructions.

2.txt (86.1 KB)

3.txt (1.3 MB)

Just to confirm, these were both built for UM TinyS2. I just created new sketches (nothing in them but the boilerplate empty setup and loop routines).

When I built the sketch that resulted in 2.txt, I used the Partition Scheme "Minimal SPIFFS (1.9MB APP with OTA, 190K SPIFFS)". The 2.txt build resulted in the following partition table as reported by gen_esp32part.py:

Parsing binary partition input...
Verifying table...

ESP-IDF Partition Table

Name, Type, SubType, Offset, Size, Flags

nvs,data,nvs,0x9000,20K,
otadata,data,ota,0xe000,8K,
app0,app,ota_0,0x10000,1920K,
app1,app,ota_1,0x1f0000,1920K,
spiffs,data,spiffs,0x3d0000,128K,
coredump,data,coredump,0x3f0000,64K,

Next I built the sketch that resulted in 3.txt, I used the Partition Scheme "Default 4MB with SPIFFS (1.2MB APP/1.5MB SPIFFS)". The 3.txt build resulted in the following partition table as reported by gen_esp32part.py:

Parsing binary partition input...
Verifying table...

ESP-IDF Partition Table

Name, Type, SubType, Offset, Size, Flags

nvs,data,nvs,0x9000,20K,
otadata,data,ota,0xe000,8K,
app0,app,ota_0,0x10000,1280K,
app1,app,ota_1,0x150000,1280K,
spiffs,data,spiffs,0x290000,1408K,
coredump,data,coredump,0x3f0000,64K,

Thanks

This may be overkill but I cleared out the following temporary directories and all is well. I do this anytime I modify boards.txt. First I stop the IDE, then I kill the directories, then I restart the IDE.

Delete ~/AppData/Local/Temp/arduino* directories
Delete ~/AppData/Roaming/arduino* directories