Support littlefs as the CIRCUITPY filesystem - #11352
Draft
tannewt wants to merge 1 commit into
Draft
Conversation
Add a supervisor-level filesystem API (supervisor_vfs_*) that works on both FAT and littlefs mounts so workflows, BLE file transfer, the web workflow and settings don't care which filesystem is active. The root filesystem storage becomes a supervisor_vfs_t union of fs_user_mount_t (FAT) and mp_obj_vfs_lfs2_t (littlefs); the root is mounted as littlefs when CIRCUITPY_FILESYSTEM_LITTLEFS is set. - extmod: export mp_obj_vfs_lfs2_t and add mp_vfs_lfs2_mount_supervisor() so the supervisor can mount littlefs before the VM and GC run, and make the littlefs VFS honor the supervisor write-protection flags so storage.remount() applies to it like FAT. - supervisor: map FatFS and littlefs errors to shared supervisor_fs_err_t codes, carry mtimes as ns past 1970 and stamp littlefs mtime attributes and FAT timestamps from the same value. - workflow/USB/BLE/web code switch from FRESULT to supervisor_fs_err_t and use the new API, removing direct FatFS access. - zephyr-cp: pick FAT or littlefs per board from the partition layout (a littlefs_partition devicetree node selects littlefs), add a native_sim_lfs test harness, fix the flash write cache stale-read when the target block is in the currently cached page, and provide mp_hal_time_ns().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a supervisor-level filesystem API (supervisor_vfs_*) that works on both FAT and littlefs mounts so workflows, BLE file transfer, the web workflow and settings don't care which filesystem is active. The root filesystem storage becomes a supervisor_vfs_t union of fs_user_mount_t (FAT) and mp_obj_vfs_lfs2_t (littlefs); the root is mounted as littlefs when CIRCUITPY_FILESYSTEM_LITTLEFS is set.