B4R Tutorial What is SPIFFS (SPI Flash File System)?

I didn't really know what SPIFFS stood for. I knew the basics of what it was but still I should have known more about it, so here is some information about SPIFFS.

Please note: I didn't fully write the following, but I did add to it.

SPIFFS is a file system intended for SPI NOR flash devices on embedded targets.

SPIFFS is designed with following characteristics in mind:
  • Small (embedded) targets, sparse RAM without heap
  • Uses statically sized ram buffers, independent of number of files
  • Uses statically sized ram buffers, independent of number of files
  • Designed for low ram usage
  • Only big areas of data (blocks) can be erased
  • An erase will reset all bits in block to ones
  • Writing pulls one to zeroes
  • Posix-like api: open, close, read, write, seek, stat, etc
  • Zeroes can only be pulled to ones by erase
  • Implements static wear levelling to prolong the life of system flash

What SPIFFS does not do:
  • SPIFFS does not support directories and uses a flat structure. Creating a file with path tmp/myfile.txt will create a file called tmp/myfile.txt instead of a myfile.txt under directory tmp.
  • It is not a real time stack. One write operation might take much longer than another. So is best used at start up, shut down or when time critical activities are not scheduled.
  • Presently, it does not detect or handle bad blocks.

For example:
FOQIDE2IZT6MS7P.MEDIUM.jpg


Enjoy...
 
Last edited:
Top