How do you determine the max size for the SPIFFS on the flash? When I pick different partitions from arduino-esp32/tools/partitions at master · espressif/arduino-esp32 · GitHub I am not able to see what the size PlatformIO thinks it has when it complains that the image I am trying to upload is too large?
For instance, using no_ota.csv, it’s my understanding that 0x1F0000 is just below 2MB - but I cannot upload 1.5MB - the max size is closer to 1.2MB, so I’m unsure how PlatformIO is determining the size of the Flash for upload.
PlatformIO invokes mkspiffs with the given parameters
to generate a spiffs.bin. If that does not fit within the allocated size → error. The maximum size of the SPIFFS partition is not the maximum size of the uploaded file, this ignores the filesystem overhead.
What’s the size of the partitions.bin given a particular filesize where it later fails to upload? (Inside .pio/build/<env>)
This is test-data I BARELY can push with the 0x1f0000 size SPIFFS partition. Anything larger and it fails. And while I understand that overhead is unavoidable, having almost 50% overhead makes no sense. 1200KB taking 2000KB of structural data is QUITE the overhead.
It’s worth noting that with the old Arduino IDE I can push 1.5MB files to the same storage size just fine. So perhaps the constants used by platformio is part of the issue here.
Outside of using the partition table setup, is there a way for me to manipulate/control the size here - ie can I override the variables you list from platformio.ini ??
Hm not sure, you could try an extra_scripts (post) script that overwrites the value of env["SPIFFS_BLOCK"] and env["SPIFFS_PAGE"], but the values like 0x1000 (4096) are based on the flash’s properties (e.g. this).
That’s intersting, can post the exact version of which Arduino-ESP32 and possibly SPIFFS plugin you’re using there and for which filesize PlatformIO fails but the Arduino IDE does not?