spiffs icon indicating copy to clipboard operation
spiffs copied to clipboard

Only 80-87% of a SPIFFS partition on the internal Flash Chip can be used to store data files.

Open pantaluna opened this issue 6 years ago • 0 comments

I was referred here by @igrr for the following ESP-IDF issue https://github.com/espressif/esp-idf/issues/1737

Is this the expected behavior?

I discovered in the mean time that SPIFFS required at least 2 free blocks (=8KB) at all times. But the program stops much earlier than that for various partition sizes.

Partition size 1MB. Block size 4K. Page size 256 bytes:

I (155682) myapp: df. Partition size of myspiffs: total: 956561, used: 769315 (80%)
E (159582) myapp: ABORT. failed fprintf() ret -1
ls /spiffs
      Type                  Size                                                Name
----------  --------------------  --------------------------------------------------
      FILE                763136                                             log.txt

Partition size 512MB. Block size 4K. Page size 256 bytes:

E (69511) myapp: ABORT. failed fprintf() ret -1
I (69511) myapp: df. Partition size of myspiffs: total: 474641, used: 382022 (80%)
ls /spiffs
      Type                  Size                                                Name
----------  --------------------  --------------------------------------------------
      FILE                378752                                             log.txt

Partition size 64KB. Block size 4K. Page size 256 bytes:

E (17372) myapp: ABORT. failed fprintf() ret -1
I (17372) myapp: df. Partition size of myspiffs: total: 52961, used: 46184 (87%)
ls /spiffs
      Type                  Size                                                Name
----------  --------------------  --------------------------------------------------
      FILE                 45440                                             log.txt

pantaluna avatar Mar 18 '18 13:03 pantaluna