-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add littlefs component, with submodule and VFS bindings (WIP) #3847
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that extmod/vfs.h should be included in pyblittlefs.c if MICROPY_VFS_LITTLEFS is true.
Thanks, now fixed! |
Some of the commits here were merged to master (the ones related to a refactoring of the drivers/memory/spiflash driver), and this PR was rebased and force-pushed. |
.gitmodules
Outdated
@@ -15,3 +15,6 @@ | |||
path = lib/stm32lib | |||
url = https://github.com/micropython/stm32lib | |||
branch = work-F4-1.13.1+F7-1.5.0+L4-1.3.0 | |||
[submodule "lib/littlefs"] | |||
path = lib/littlefs | |||
url = https://github.com/geky/littlefs.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I go to https://github.com/geky/littlefs in my web browser it automatically redirects to https://github.com/ARMmbed/littlefs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After I made this PR the littlefs project moved to the ARMmbed organisation. I'll update the link.
++s; | ||
} | ||
return s - ss; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably missing something obvious, but a) the functionality of strspn
and strcspn
appears to be identical, and b) neither of these functions actually seem to be used?
EDIT: Ooops, I finally spotted that one is doing != NULL
and the other is doing == NULL
😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neither of these functions actually seem to be used?
They are used within littlefs itself. The linker will complain if they are not defined.
As a test/example, external SPI flash is mounted automatically on boot. The configuration for this is defined at the top of pyblittlefs.c.
Runs on unix coverage and stm32.
This needs to be enabled by a particular board when it wants to have a native littlefs filesystem.
I pushed some changes to this branch:
|
For reference, I've got a rebased copy of this with some minor additional patches available at: https://github.com/andrewleech/micropython/tree/littlefs |
Chatting about this on slack, "Scott (tannewt)" brought up GhostFat from https://github.com/lancaster-university/codal-core/blob/master/source/drivers/GhostFAT.cpp as a possible avenue for maintaining mass storage support with littlefs etc in a safer way. It' implements fake block interface for mass storage, pretending to be fat. This looks to be very similar too: https://github.com/mmoskal/uf2-stm32f/blob/master/ghostfat.c |
adafruit_bus_device: Don't transmit STOP condition in write_then_readinto
This PR is work-in-progress to add littlefs as a new component for a new VFS. Currently works on unix coverage build and stm32 (pyboard etc). See tests/extmod/vfs_little.py for a demo/test, and ports/stm32/pyblittlefs.c for stm32 configuration.
Still to do: