littlefs - advantages & disadvantages
littlefs - advantages & disadvantages
search.php?keywords=littlefs&terms=all& ... mit=Search
The search did not bring up anything obvious, but what are the main advantages and disadvantages of littlefs (other than the name suggests it is little !)
The search did not bring up anything obvious, but what are the main advantages and disadvantages of littlefs (other than the name suggests it is little !)
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: littlefs - advantages & disadvantages
the "little" is the main advantage for me The esp8266 gets 4kB more free RAM when using it, so I made it the default right away!
Apart from that I "heard" it should be more robust than FAT but can't tell anything about that.
Apart from that I "heard" it should be more robust than FAT but can't tell anything about that.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: littlefs - advantages & disadvantages
That's interesting, I didn't know it had been implemented.
FAT is pretty bad on Flash devices because the low numbered sectors get rewritten frequently. Devices like USB sticks have wear levelling code, but if you're accessing raw hardware wear is a potential issue.
FAT is pretty bad on Flash devices because the low numbered sectors get rewritten frequently. Devices like USB sticks have wear levelling code, but if you're accessing raw hardware wear is a potential issue.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: littlefs - advantages & disadvantages
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
Re: littlefs - advantages & disadvantages
The littlefs Github, especially the Design page, is full of really useful information. In short, it's a filesystem designed for an embedded environment so it's resilient to power failure, provides wear leveling and uses RAM judiciously.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: littlefs - advantages & disadvantages
Is there any information on which platforms support it and how to configure it?
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: littlefs - advantages & disadvantages
There was a PR for esp32 and I noticed the commits for esp8266. Not sure any other platform supports it yet.
These are the changes I made to the module inisetup.py to make usage of littelfs default. As soon as you format your flash with LittleFs, it will be used. But it's not the default FS on any port (yet?).
Code: Select all
from flashbdev import bdev
import uos
uos.VfsLfs2.mkfs(bdev)
vfs = uos.VfsLfs2(bdev)
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
- rcolistete
- Posts: 352
- Joined: Thu Dec 31, 2015 3:12 pm
- Location: Brazil
- Contact:
Re: littlefs - advantages & disadvantages
Pycom MicroPython has LittleFS since firmware v1.19.x.
My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).
Re: littlefs - advantages & disadvantages
It's still in progress for STM32...
One disadvantage of LFS is that it won't work with USB MSC unless your PC has LFS filesystem support (which I understand you can do with a FUSE implementation). But for people who disable USB MSC anyway (or use any port other than STM32) this obviously won't make a difference.
Overall though, it's a filesystem designed for flash rather than the constraints of an early-80's PC.
As far as I understand, the extra RAM that Kevin points out is because it can run at the correct block size, so doesn't need an additional buffer. (i.e. this isn't really the "little" in littlefs, it's more a limitation of the way FAT works on these devices).
One disadvantage of LFS is that it won't work with USB MSC unless your PC has LFS filesystem support (which I understand you can do with a FUSE implementation). But for people who disable USB MSC anyway (or use any port other than STM32) this obviously won't make a difference.
Overall though, it's a filesystem designed for flash rather than the constraints of an early-80's PC.
As far as I understand, the extra RAM that Kevin points out is because it can run at the correct block size, so doesn't need an additional buffer. (i.e. this isn't really the "little" in littlefs, it's more a limitation of the way FAT works on these devices).
Re: littlefs - advantages & disadvantages
Thanks for this great information