-
Notifications
You must be signed in to change notification settings - Fork 518
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 support for accessing the SPI flash LittleFS from user-level #1706
base: mesh-develop
Are you sure you want to change the base?
Conversation
No comment after over two months... |
Hi @tve ! Thank you for the submission. This somehow slipped through our fingers, so I'm apologizing for taking a long time to reply. While this PR does in fact what it's supposed to do (exposing the filesystem access to the user applications), it unfortunately relies too much on LittleFS, which is not something we prefer to do unless absolutely necessary. Some pointers on why:
We do have plans to implement such functionality and are currently working on a PoC, although it's not a very high priority item given other big features we are currently working on (e.g. BLE). We are currently exploring the idea of implementing a POSIX-compatible file/filesystem API which will allow us to have a stable interface which can be implemented no matter the underlying filesystem implementation and for example also allow the usage of standard libc or libstdc++ stream APIs, although this is not exactly the reason we are going with this. We're already doing that with socket API on Gen 3 devices, so this sounds like a reasonable course of action. I cannot tell the exact timeline for this feature, but you may expect a WIP PR in the nearest future. |
Thanks for the clarifications. Makes sense. The littlefs interface is already pretty close to POSIX. Other than hiding the file and dir structs and renaming constants, how far do you want to go? I noticed some semantic stuff, for example, you open a file for writing and separately the same file for reading then the two are not in sync, i.e., you can't immediately read what you wrote unless you call lfs_sync (the use-case is writing a log and simultaneously trying to keep up sending it over the network). |
Any updates on this @avtolstoy? |
@pkourany Not yet, but this is being prioritized in the nearest perspective. |
I just tried tweaking the files in my DeviceOS 1.5 installation to add this to my Argon board... It doesn't seem to work... Do I have to downgrade my deviceOS to get this to work? |
Are there any news on that? We are currently using rickkas Spiffs library for our flash which is quite a shame given littlefs is already in device os. Is there already a timeline for that feature? |
At this point this PR is for discussion purposes. It is clearly incomplete. Is this even going into an interesting direction at all?
Problem
The purpose of this PR is to provide user-level access to the LittleFS filesystem on the SPI flash chip.
Solution
As a first step, this PR exposes all the LittleFS file and directory functions to user-level. It strips the
lfs_t
first parameter and inserts the filesystem of the SPI flash.A second step would be to provide a "wiring" wrapper to the raw lfs function, perhaps a clone of https://github.com/espressif/arduino-esp32/blob/master/libraries/FS/src/FSImpl.h
Steps to Test
No tests yet.
Example App
The following functions print the directory tree:
Output:
Completeness