diff --git a/examples/filesystem/Makefile b/examples/filesystem/Makefile index 85b2d4436395b8eff4ba7f9c955bf4913e92a2ef..f7c634529b56fcd601c56f2d96eac9e8e34d9fc7 100644 --- a/examples/filesystem/Makefile +++ b/examples/filesystem/Makefile @@ -48,7 +48,7 @@ USEMODULE += constfs # Set file systems specific variables ifneq (,$(filter littlefs, $(USEMODULE))) - CFLAGS += -DVFS_FILE_BUFFER_SIZE=52 -DVFS_DIR_BUFFER_SIZE=44 + CFLAGS += -DVFS_FILE_BUFFER_SIZE=56 -DVFS_DIR_BUFFER_SIZE=44 else ifneq (,$(filter spiffs, $(USEMODULE))) SPIFFS_NB_FD ?= 8 CFLAGS += '-DSPIFFS_FS_FD_SPACE_SIZE=(32 * $(SPIFFS_NB_FD))' diff --git a/pkg/littlefs/Makefile b/pkg/littlefs/Makefile index 2db6990774b9cc10f192e6123973b389036d682b..550991147547fddf2cf11cecc6375d9409a2b2d1 100644 --- a/pkg/littlefs/Makefile +++ b/pkg/littlefs/Makefile @@ -1,6 +1,7 @@ PKG_NAME=littlefs PKG_URL=https://github.com/geky/littlefs.git -PKG_VERSION=v1.3 +# v1.6.2 +PKG_VERSION=0bb1f7af17755bd792f0c4966877fb1886dfc802 PKG_LICENSE=Apache-2.0 .PHONY: all diff --git a/pkg/littlefs/Makefile.littlefs b/pkg/littlefs/Makefile.littlefs index cf7a262689f9c2dc7bb49ac17ecafbf1680761c2..db2830598b68bc4fd2e7a1ed1c8fc785f773eb7f 100644 --- a/pkg/littlefs/Makefile.littlefs +++ b/pkg/littlefs/Makefile.littlefs @@ -1,6 +1,6 @@ MODULE := littlefs -CFLAGS += -Wno-unused-parameter -Wno-format +CFLAGS += -Wno-format # GCC 4.9 bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64480) # used by MIPS CFLAGS += -Wno-missing-field-initializers diff --git a/pkg/littlefs/fs/littlefs_fs.c b/pkg/littlefs/fs/littlefs_fs.c index c0dfaf57b19f2f56dba4345856afeec45e16efc1..0d7d61294f8cd46fbc3c52852a5e4ebc93cbe388 100644 --- a/pkg/littlefs/fs/littlefs_fs.c +++ b/pkg/littlefs/fs/littlefs_fs.c @@ -184,6 +184,11 @@ static int _format(vfs_mount_t *mountp) static int _mount(vfs_mount_t *mountp) { + /* if one of the lines below fail to compile you probably need to adjust + vfs buffer sizes ;) */ + BUILD_BUG_ON(VFS_DIR_BUFFER_SIZE < sizeof(lfs_dir_t)); + BUILD_BUG_ON(VFS_FILE_BUFFER_SIZE < sizeof(lfs_file_t)); + littlefs_desc_t *fs = mountp->private_data; DEBUG("littlefs: mount: mountp=%p\n", (void *)mountp); diff --git a/sys/include/fs/littlefs_fs.h b/sys/include/fs/littlefs_fs.h index ec90d670885cafc4a9199babd8805bc3988f421a..df25b0b33109e86a2992207c1365166d5032c55a 100644 --- a/sys/include/fs/littlefs_fs.h +++ b/sys/include/fs/littlefs_fs.h @@ -31,14 +31,6 @@ extern "C" { #include "mtd.h" #include "mutex.h" -#if VFS_FILE_BUFFER_SIZE < 52 -#error "VFS_FILE_BUFFER_SIZE is too small, at least 52 bytes is required" -#endif - -#if VFS_DIR_BUFFER_SIZE < 44 -#error "VFS_DIR_BUFFER_SIZE is too small, at least 44 bytes is required" -#endif - /** * @name littlefs configuration * @{ diff --git a/tests/unittests/tests-littlefs/Makefile.include b/tests/unittests/tests-littlefs/Makefile.include index aa1928f832735077a5f3c3be8f5b0a87001c4bcc..b73373a73431fde44a556adc423a8863c2ca8272 100644 --- a/tests/unittests/tests-littlefs/Makefile.include +++ b/tests/unittests/tests-littlefs/Makefile.include @@ -1,6 +1,6 @@ USEMODULE += littlefs # Set vfs file and dir buffer sizes -CFLAGS += -DVFS_FILE_BUFFER_SIZE=52 -DVFS_DIR_BUFFER_SIZE=44 +CFLAGS += -DVFS_FILE_BUFFER_SIZE=56 -DVFS_DIR_BUFFER_SIZE=44 # Reduce LFS_NAME_MAX to 31 (as VFS_NAME_MAX default) CFLAGS += -DLFS_NAME_MAX=31