-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Introduce Zephyr Filesystem VFS interface #17084
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
base: master
Are you sure you want to change the base?
Conversation
95e18a8
to
6b7d85f
Compare
Code size report:
|
What is needed to set this up on a device? Any limitations, or can one use any file-system operations from Python like on other ports? |
Basically you need to setup a fstab and then format it (format can be done via mpy like normal fs, you may need to enable format ability on zephyr side): https://docs.zephyrproject.org/latest/services/file_system/index.html After that it works like any mpy fs. |
rebased on main |
Allows using Zephyr RTOS File system drivers and share files with Zephyr Signed-off-by: Vdragon <mail@massdriver.space>
Added guardrail for automount / mkfs. Here is to use it on rp2040, this was for a 16MB rp2040 board so adapt the sizes to yours. boards/rpi_pico.conf:
boards/rpi_pico.overlay:
In mpy: import zephyr
zfs = zephyr.FS(zephyr.FS.fstab()[0])
vfs.mount(zfs, "/zephyr") Be aware you may have to disable the automatic vfs mounting in main or umount manually, because mpy's vfs will detect zephyr's and take ownership of it through its own vfs system so /flash is likely to be occupied. Edit: and i mean the vfs.mount name, the '/flash' in the overlay is the name used in the fstab on zephyr side, not useful mpy side except when creating the class. |
Summary
Adds VFS interface for Zephyr filesystems
Testing
Basic tests on nrf52840, would recommend thorough testing.
15/08/2025: also tested on rp2040.