cores/esp8266/spiffs/README.md
V0.3.7
Copyright (c) 2013-2017 Peter Andersson (pelleplutt1976 at gmail.com)
For legal stuff, see LICENSE. Basically, you may do whatever you want with the source. Use, modify, sell, print it out, roll it and smoke it - as long as I won't be held responsible.
Love to hear feedback though!
Spiffs is a file system intended for SPI NOR flash devices on embedded targets.
Spiffs is designed with following characteristics in mind:
mkdir build; make
Otherwise, configure the builddir variable towards the top of makefile as something opposed to the default build. Sanity check on the host via make test and refer to .travis.yml for the official in-depth testing procedure. See the wiki for integrating spiffs into projects and spiffsimg from nodemcu is a good example on the subject.
What spiffs does:
What spiffs does not:
0.4.0 is under construction. This is a full rewrite and will change the underlying structure. Hence, it will not be compatible with earlier versions of the filesystem. The API is the same, with minor modifications. Some config flags will be removed (as they are mandatory in 0.4.0) and some features might fall away until 0.4.1. If you have any worries or questions, it can be discussed in issue #179
See the wiki for configuring, integrating, using, and optimizing spiffs.
For design, see docs/TECH_SPEC.
For a generic spi flash driver, see this.
New API functions:
SPIFFS_update_meta, SPIFFS_fupdate_meta - updates metadata for a fileNew config defines:
SPIFFS_OBJ_META_LEN - enable possibility to add extra metadata to filesNew API functions:
SPIFFS_ix_map - map index meta data to memory for a fileSPIFFS_ix_unmap - unmaps index meta data for a fileSPIFFS_ix_remap - changes file offset for index metadata mapSPIFFS_bytes_to_ix_map_entries - utility, get length of needed vector for given amount of bytesSPIFFS_ix_map_entries_to_bytes - utility, get number of bytes a vector can represent given lengthNew config defines:
SPIFFS_IX_MAP - enable possibility to map index meta data to memory for reading fasterSPIFFS_TEMPORAL_FD_CACHE - enable temporal cache for opening files fasterSPIFFS_TEMPORAL_CACHE_HIT_SCORE - for tuning the temporal cacheNew API functions:
SPIFFS_set_file_callback_func - register a callback informing about file eventsSPIFFS_probe_fs - probe a spi flash trying to figure out size of fsSPIFFS_open_by_page - open a file by page indexSPIFFS_eof - checks if end of file is reachedSPIFFS_tell - returns current file offsetNew config defines:
SPIFFS_READ_ONLYSPIFFS_USE_MAGIC_LENGTHMight not be compatible with 0.3.2 structures. See issue #40
New config defines:
SPIFFS_FILEHDL_OFFSETNew API functions:
SPIFFS_gc_quick - call a nonintrusive gcSPIFFS_gc - call a full-scale intrusive gcNew config defines:
SPIFFS_USE_MAGIC - enable or disable magic check upon mountSPIFFS_ALIGNED_OBJECT_INDEX_TABLES - alignment for certain targetsNew API functions:
SPIFFS_rename - rename filesSPIFFS_clearerr - clears last errnoSPIFFS_info - returns info on used and total bytes in fsSPIFFS_format - formats the filesystemSPIFFS_mounted - checks if filesystem is mounted