Skip to content
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 support #2304

Merged
merged 6 commits into from
Apr 11, 2021
Merged

Add LittleFS support #2304

merged 6 commits into from
Apr 11, 2021

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Apr 10, 2021

This PR adds an IFS implementation for LittleFS.

The Basic_IFS sample has been updated to demonstrate use of littlefs volumes. Initial image files can be created using the lfs-build are defined using an FWFS build configuration file, which is then copied into the target littlefs image file using an fscopy tool.

TODO

These items are not critical to filesystem operation and can be added in future updates.

The following two methods are not fully implemented - they require modifications to the littlefs library.

FileHandle IFileSystem::fopen(const Stat& stat, OpenFlags flags);
int IFileSystem::fremove(FileHandle file);

Note: The fopen() call is an optimisation to avoid the need to re-parse the filesystem for a file which has already been discovered during a directory enumeration. The Stat::id field is intended to provide a way for the implementation to do this, but for littlefs it will probably need the filename as well. Also, there are a few internal optimisations which can be made to avoid the need to store filenames and paths separately.

Update Basic_IFS sample, start after short delay to allow easier debugging.
Start after short delay to allow easier debugging
Increase FWFS partition size
Add `strcpn` and `strcspn` implementations for old toolchain
Update Basic_IFS sample
…ample. Warning message printed in LittleFS.
@slaff
Copy link
Contributor

slaff commented Apr 11, 2021

@mikee47 are you ready with this PR?

@mikee47
Copy link
Contributor Author

mikee47 commented Apr 11, 2021

@slaff yes

@slaff slaff merged commit 5321a3d into SmingHub:develop Apr 11, 2021
@slaff slaff mentioned this pull request Apr 11, 2021
5 tasks
@mikee47 mikee47 deleted the feature/littlefs branch September 11, 2021 08:05
slaff pushed a commit that referenced this pull request Sep 27, 2021
This PR adds an IFS implementation for [LittleFS](https://github.com/littlefs-project/littlefs).

The `Basic_IFS` sample has been updated to demonstrate use of littlefs volumes. Initial image files can be created using the `lfs-build` are defined using an FWFS build configuration file, which is then copied into the target littlefs image file using an `fscopy` tool.

**TODO**

These items are not critical to filesystem operation and can be added in future updates.

The following two methods are not fully implemented - they require modifications to the littlefs library.

```
FileHandle IFileSystem::fopen(const Stat& stat, OpenFlags flags);
int IFileSystem::fremove(FileHandle file);
```

Note: The `fopen()` call is an optimisation to avoid the need to re-parse the filesystem for a file which has already been discovered during a directory enumeration. The `Stat::id` field is intended to provide a way for the implementation to do this, but for littlefs it will probably need the filename as well. Also, there are a few internal optimisations which can be made to avoid the need to store filenames and paths separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants