SD card LittleFS driver for micropython #13720
jornamon
started this conversation in
Show and tell
Replies: 1 comment 7 replies
-
Hello @jornamon, did you notice this PR? |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Although LittleFS may not be the best choice for SD cards, I wanted to give it a try. I've adapted the existing SD card driver so it can be used with LFS (or any other file system that could depend on the block device driver extended interface).
You can check the driver out here: https://github.com/jornamon/mp-sdcard-littleFS
LFS is better suited for devices that can be addressed at byte level, not block level (like SD-cards), so it's slower than FAT in general, but you might still be interested in using it to take advantage of some of its features, like better reliability under power loss.
Without a cache, the performance is terrible, so I had to implement a simple block cache. Even though LFS is slower than FAT with SD cards, with the cache is quite usable. Additionally, by tweaking the cache parameters, you might even see a performance boost while using FAT in certain scenarios. You can see some test results here: https://github.com/jornamon/mp-sdcard-littleFS/blob/main/TEST_RESULTS.md
Feedback and contributions are welcome!
Beta Was this translation helpful? Give feedback.
All reactions