tinygo-org / tinyfs

Embedded filesystems for TinyGo. Currently supports FATfs and LittleFS on microcontrollers with either SDCard or Flash RAM.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
27 stars 5 forks source link

littlefs disk version 2.1 #13

Closed trichner closed 8 months ago

trichner commented 1 year ago

Currently the littelfs implemention provided by tinyfs is built for littlefs disk version 2.0. See here: https://github.com/tinygo-org/tinyfs/blob/release/littlefs/lfs.h#L31

The latest version though is disk version 2.1: https://github.com/littlefs-project/littlefs/blob/master/lfs.h#L31

This leads to the problem that devices are only mountable with extra hurdles on a desktop machine. To be precise, one needs to build https://github.com/littlefs-project/littlefs-fuse/tree/v2.0.0 . Newer versions seem to be problematic.

The goal would be to update the vendor-ed version here.

The fuse driver just refuses to work:

littlefs/lfs.c:4323:debug: Found older minor version v2.0 < v2.1
littlefs/lfs.c:4369:error: Invalid block count (62520320 != 62521344)
lfs_fuse.c:514:error: Invalid argument

Looking at the code, it seems the C files from https://github.com/littlefs-project/littlefs were copied one-to-one. Maybe updating them would be enough?