-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LittleFS as an optional filesystem, API compatible w/SPIFFS (but not on-flash-format compatible) #5511
Commits on Dec 26, 2018
-
Add LittleFS as internal flash filesystem
Adds a LittleFS object which uses the ARMmbed littlefs embedded filesystem, https://github.com/ARMmbed/littlefs, to enable a new filesystem for onboard flash utilizing the exact same API as the existing SPIFFS filesystem. LittleFS is built for low memory systems that are subject to random power losses, is actively supported by the ARMmbed community, supports directories, and seems to be much faster in the large-ish read-mostly applications I use. LittleFS, however, has a larger minimum file allocation unit and does not do static wear levelling. This means that for systems that need many little files (<4K), have small SPIFFS areas (64K), or which have a large static set of files covering the majority of flash coupled with a frequently updated set of other files, it may not perform as well. Simply replace SPIFFS.begin() with LittleFS.begin() in your sketch, use LittleFS.open in place of SPIFFS.open to open files, and everything else just works thanks to the magic of @igrr's File base class. **LITTLEFS FLASH LAYOUT IS INCOMPATIBLE WITH SPIFFS** Since it is a completely different filesystem, you will need to reformat your flash (and lose any data therein) to use it. Tools to build the flash filesystem and upload are at https://github.com/earlephilhower/arduino-esp8266littlefs-plugin and https://github.com/earlephilhower/mklittlefs/ . The mklittlefs tool is installed as part of the Arduino platform installation, automatically. The included example shows a contrived read-mostly example and demonstrates how the same calls work on either SPIFFS.* or LittleFS.* Host tests are also included as part of CI. Directories are fully supported in LittleFS. This means that LittleFS will have a slight difference vs. SPIFFS when you use LittleFS.openDir()/Dir.next(). On SPIFFS dir.next() will return all filesystem entries, including ones in "subdirs" (because in SPIFFS there are no subdirs and "/" is the same as any other character in a filename). On LittleFS, dir.next() will only return entries in the directory specified, not subdirs. So to list files in "/subdir/..." you need to actually openDir("/subdir") and use Dir.next() to parse through just those elements. The returned filenames also only have the filename returned, not full paths. So on a FS with "/a/1", "/a/2" when you do openDir("/a"); dir.next().getName(); you get "1" and "2" and not "/a/1" and "/a/2" like in SPIFFS. This is consistent with POSIX ideas about reading directories and more natural for a FS. Most code will not be affected by this, but if you depend on openDir/Dir.next() you need to be aware of it. Corresponding ::mkdir, ::rmdir, ::isDirectory, ::isFile, ::openNextFile, and ::rewind methods added to Filesystem objects. Documentation has been updated with this and other LittleFS information. Subdirectories are made silently when they do not exist when you try and create a file in a subdir. They are silently removed when the last file in them is deleted. This is consistent with what SPIFFS does but is obviously not normal POSIX behavior. Since there has never been a "FS.mkdir()" method this is the only way to be compatible with legacy SPIFFS code. SPIFFS code has been refactored to pull out common flash_hal_* ops and placed in its own namespace, like LittleFS.
Configuration menu - View commit details
-
Copy full SHA for cd03a6f - Browse repository at this point
Copy the full SHA cd03a6fView commit details
Commits on Jan 7, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 3d24167 - Browse repository at this point
Copy the full SHA 3d24167View commit details -
Earle F. Philhower, III authored and Earle F. Philhower, III committed
Jan 7, 2019 Configuration menu - View commit details
-
Copy full SHA for c22b9d4 - Browse repository at this point
Copy the full SHA c22b9d4View commit details -
Merge in the FSConfig changs from SDFS PR
Enable setConfig for LittleFS as well plys merge the SPIFFS changes done in the SDFS PR.
Earle F. Philhower, III authored and Earle F. Philhower, III committedJan 7, 2019 Configuration menu - View commit details
-
Copy full SHA for a42bc48 - Browse repository at this point
Copy the full SHA a42bc48View commit details
Commits on Jan 9, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 8016386 - Browse repository at this point
Copy the full SHA 8016386View commit details
Commits on Feb 27, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 4acc649 - Browse repository at this point
Copy the full SHA 4acc649View commit details -
Configuration menu - View commit details
-
Copy full SHA for e3e8de3 - Browse repository at this point
Copy the full SHA e3e8de3View commit details
Commits on Mar 1, 2019
-
The V2-alpha branch supports small file optimizations which can help increase the utilization of flash when small files are prevalent. It also adds support for metadata, which means we can start adding things like file creation times, if desired (not yet).
Configuration menu - View commit details
-
Copy full SHA for 13e985c - Browse repository at this point
Copy the full SHA 13e985cView commit details
Commits on Apr 11, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 3340b95 - Browse repository at this point
Copy the full SHA 3340b95View commit details -
Update test to support non-creation-ordered files
In a directory, the order in which "readNextFile()" will return a name is undefined. SPIFFS may return it in order, but LittleFS does not as of V2. Update the test to look for files by name when doing readNextFile() testing.
Configuration menu - View commit details
-
Copy full SHA for 31e925a - Browse repository at this point
Copy the full SHA 31e925aView commit details -
Merge branch 'master' of https://github.com/esp8266/Arduino into litt…
…lefs Everything compiles, but host tests do not yet pass. Add LittleFS.truncate() method. Add SDFS test to cover all SPIFFS/LittleFS ones.
Configuration menu - View commit details
-
Copy full SHA for 49f4618 - Browse repository at this point
Copy the full SHA 49f4618View commit details -
Configuration menu - View commit details
-
Copy full SHA for ddafe05 - Browse repository at this point
Copy the full SHA ddafe05View commit details -
Configuration menu - View commit details
-
Copy full SHA for da1383c - Browse repository at this point
Copy the full SHA da1383cView commit details
Commits on Apr 12, 2019
-
SDFS, SPIFFS, and LittleFS now all share the same common set of tests, greatly increasing the SDFS test coverage.
Configuration menu - View commit details
-
Copy full SHA for d7fe68d - Browse repository at this point
Copy the full SHA d7fe68dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 90ea0ba - Browse repository at this point
Copy the full SHA 90ea0baView commit details -
Update to point to mklittlefs v2
Upgrade mklittlefs to V2 format support
Configuration menu - View commit details
-
Copy full SHA for c3ac058 - Browse repository at this point
Copy the full SHA c3ac058View commit details -
Remove extra FS::write(const char *s) method
This was removed in esp8266#5861 and erroneously re-introduced here.
Configuration menu - View commit details
-
Copy full SHA for e3e6860 - Browse repository at this point
Copy the full SHA e3e6860View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a827a5 - Browse repository at this point
Copy the full SHA 4a827a5View commit details
Commits on Apr 14, 2019
-
Dramatically reduce memory usage
Reduce the program and read chunk sizes which impacts performance minimally but reduces per-file RAM usage of 16KB to <1KB.
Configuration menu - View commit details
-
Copy full SHA for 0874498 - Browse repository at this point
Copy the full SHA 0874498View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b33dcf - Browse repository at this point
Copy the full SHA 6b33dcfView commit details
Commits on Apr 15, 2019
-
Configuration menu - View commit details
-
Copy full SHA for dc3e14a - Browse repository at this point
Copy the full SHA dc3e14aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7435409 - Browse repository at this point
Copy the full SHA 7435409View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f9ac16 - Browse repository at this point
Copy the full SHA 6f9ac16View commit details
Commits on Apr 18, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 9d2ffed - Browse repository at this point
Copy the full SHA 9d2ffedView commit details -
Thanks to @TD-er for discovering the issue
Configuration menu - View commit details
-
Copy full SHA for 78fbb64 - Browse repository at this point
Copy the full SHA 78fbb64View commit details
Commits on Apr 23, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 88a9cf6 - Browse repository at this point
Copy the full SHA 88a9cf6View commit details -
Configuration menu - View commit details
-
Copy full SHA for c0594ef - Browse repository at this point
Copy the full SHA c0594efView commit details
Commits on May 1, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 7bdfaf0 - Browse repository at this point
Copy the full SHA 7bdfaf0View commit details -
Configuration menu - View commit details
-
Copy full SHA for fbe1d48 - Browse repository at this point
Copy the full SHA fbe1d48View commit details -
Configuration menu - View commit details
-
Copy full SHA for f0fb051 - Browse repository at this point
Copy the full SHA f0fb051View commit details -
Configuration menu - View commit details
-
Copy full SHA for d1666e5 - Browse repository at this point
Copy the full SHA d1666e5View commit details
Commits on May 2, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 8e732d2 - Browse repository at this point
Copy the full SHA 8e732d2View commit details
Commits on May 12, 2019
-
Configuration menu - View commit details
-
Copy full SHA for e7d5a45 - Browse repository at this point
Copy the full SHA e7d5a45View commit details -
Configuration menu - View commit details
-
Copy full SHA for a70facc - Browse repository at this point
Copy the full SHA a70faccView commit details
Commits on May 13, 2019
-
Merge branch 'littlefs' of https://github.com/earlephilhower/Arduino …
…into littlefs
Configuration menu - View commit details
-
Copy full SHA for a6d17e3 - Browse repository at this point
Copy the full SHA a6d17e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ab6d76 - Browse repository at this point
Copy the full SHA 3ab6d76View commit details
Commits on May 17, 2019
-
Configuration menu - View commit details
-
Copy full SHA for e016613 - Browse repository at this point
Copy the full SHA e016613View commit details -
Configuration menu - View commit details
-
Copy full SHA for edbd1ba - Browse repository at this point
Copy the full SHA edbd1baView commit details
Commits on May 20, 2019
-
Configuration menu - View commit details
-
Copy full SHA for bd57b00 - Browse repository at this point
Copy the full SHA bd57b00View commit details
Commits on May 24, 2019
-
Configuration menu - View commit details
-
Copy full SHA for bf06492 - Browse repository at this point
Copy the full SHA bf06492View commit details