diff options
author | Damien George <damien@micropython.org> | 2021-11-08 12:43:18 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-11-19 15:13:05 +1100 |
commit | 01f1c3aac200fa33f981e0e53a20005e7ae3f6e8 (patch) | |
tree | 376e9ff74a8926cd85f75da54c373dae3171a6d3 /docs/reference/filesystem.rst | |
parent | 1904833e0c7c650e86d8e151ea57ea1fa2ab09bd (diff) |
docs/reference/filesystem.rst: Add detail on how to use littlefs fuse.
Without the --block_count option the fuse will fail.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'docs/reference/filesystem.rst')
-rw-r--r-- | docs/reference/filesystem.rst | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/docs/reference/filesystem.rst b/docs/reference/filesystem.rst index 114e59735..ca9e56344 100644 --- a/docs/reference/filesystem.rst +++ b/docs/reference/filesystem.rst @@ -219,15 +219,6 @@ resistant to filesystem corruption. situations, for details see `littlefs issue 347`_ and `littlefs issue 295`_. -Note: It can be still be accessed over USB MSC using the `littlefs FUSE -driver`_. Note that you must use the ``-b=4096`` option to override the block -size. - -.. _littlefs FUSE driver: https://github.com/ARMmbed/littlefs-fuse/tree/master/littlefs -.. _Littlefs: https://github.com/ARMmbed/littlefs -.. _littlefs issue 295: https://github.com/ARMmbed/littlefs/issues/295 -.. _littlefs issue 347: https://github.com/ARMmbed/littlefs/issues/347 - To format the entire flash using littlefs v2:: # ESP8266 and ESP32 @@ -243,6 +234,27 @@ To format the entire flash using littlefs v2:: os.mount(pyb.Flash(start=0), '/flash') os.chdir('/flash') +A littlefs filesystem can be still be accessed on a PC over USB MSC using the +`littlefs FUSE driver`_. Note that you must specify both the ``--block_size`` +and ``--block_count`` options to override the defaults. For example (after +building the littlefs-fuse executable):: + + $ ./lfs --block_size=4096 --block_count=512 -o allow_other /dev/sdb1 mnt + +This will allow the board's littlefs filesystem to be accessed at the ``mnt`` +directory. To get the correct values of ``block_size`` and ``block_count`` use:: + + import pyb + f = pyb.Flash(start=0) + f.ioctl(1, 1) # initialise flash in littlefs raw-block mode + block_count = f.ioctl(4, 0) + block_size = f.ioctl(5, 0) + +.. _littlefs FUSE driver: https://github.com/littlefs-project/littlefs-fuse +.. _Littlefs: https://github.com/littlefs-project/littlefs +.. _littlefs issue 295: https://github.com/littlefs-project/littlefs/issues/295 +.. _littlefs issue 347: https://github.com/littlefs-project/littlefs/issues/347 + Hybrid (STM32) ~~~~~~~~~~~~~~ |