LittleFS is an Open Source, Low Footprint, Resilient File System Designed for Tiny Devices

Most devices need to store data either configuration files, sensor data firmware updates, and while it’s in theory possible to write directly to the storage device, it’s normally not a good idea to do so due to issues such as wear, which could lead to a premature death of your storage…

LittleFS is an open source file system specifically designed for small devices such as IoT nodes for SPI NOR flash and SD card storage, and introduced in Mbed OS 5.7. The “high-integrity embedded file system” is resilient to power-cuts, supports wear-leveling, and comes in a small memory and storage footprint.

Mbed support both FAT and LittleFS, so the latter was compared to the former with the following key highlights:

  • Footprint – Code for LittleFS takes 13KB less storage than FAT, and 4KB less RAM
  • Power loss resilience – The file system has strong copy-on-write guarantees, and storage on disk is always kept in a valid state. FAT has no such resilience
  • Wear-leveling – LittleFS file system provides a form of dynamic wear leveling for systems that cannot fit a full flash translation layer. FAT has no wear-leveling capabilities.
FAT vs LittleFS RAM+ROM Footprint
FAT vs LittleFS wear-leveling demo

One of the downsides of LittleFS is that if you use (micro) SD cards for your project(s), you’ll lose compatibility with your computer, although if you run Linux there’s a FUSE wrapper that will allow you to mount littleFS in your computer.

The documentation and source code can be found on Github, with everything released under an Apache 2.0 license. Reference documentation is also available on Mbed website.

Share this:

Support CNX Software! Donate via PayPal or cryptocurrencies, become a Patron on Patreon, or buy review samples

Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
2 Comments
oldest
newest
Barmagly Uchkudabu
Barmagly Uchkudabu
3 years ago

What about timing? FatFS requires updates in several different places(FAT(s) and data at least) and it takes its time toll. How does littleFS operates in that regard?
Thanks.

js0x0
js0x0
3 years ago

@Barmagly Uchkudabu
Depends on what operation you’re doing.
I suggest you read their design doc, it has a pretty good overview of how it works and performance/reliability/memory usage trade-offs.
https://github.com/geky/littlefs/blob/master/DESIGN.md

Advertisement