From a866a745b501d41164969783c248e4a33fd3a686 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Mon, 14 Feb 2022 14:33:51 +0100 Subject: [PATCH] boards/iotlab-m3: configure littlefs2 on external flash --- boards/iotlab-m3/Makefile.dep | 6 ++++++ boards/iotlab-m3/mtd.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/boards/iotlab-m3/Makefile.dep b/boards/iotlab-m3/Makefile.dep index 9323e8ae12..7a4d350b63 100644 --- a/boards/iotlab-m3/Makefile.dep +++ b/boards/iotlab-m3/Makefile.dep @@ -9,4 +9,10 @@ ifneq (,$(filter mtd,$(USEMODULE))) USEMODULE += mtd_spi_nor endif +# default to using littlefs2 on the external flash +ifneq (,$(filter vfs_default,$(USEMODULE))) + USEPKG += littlefs2 + USEMODULE += mtd +endif + USEMODULE += boards_common_iotlab diff --git a/boards/iotlab-m3/mtd.c b/boards/iotlab-m3/mtd.c index 23bf99753a..20e24df08b 100644 --- a/boards/iotlab-m3/mtd.c +++ b/boards/iotlab-m3/mtd.c @@ -52,4 +52,9 @@ static mtd_spi_nor_t mtd_nor_dev = { }; mtd_dev_t *mtd0 = (mtd_dev_t *)&mtd_nor_dev; + +#ifdef MODULE_VFS_DEFAULT +#include "vfs_default.h" +VFS_AUTO_MOUNT(littlefs2, VFS_MTD(mtd_nor_dev), VFS_DEFAULT_NVM(0), 0); +#endif #endif /* MODULE_MTD */