Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards/adafruit-itsybitsy-m4: configure littleFS on external flash #19355

Merged
merged 1 commit into from
Sep 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions boards/adafruit-itsybitsy-m4/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ 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

# setup the samd21 arduino bootloader related dependencies
include $(RIOTBOARD)/common/samdx1-arduino-bootloader/Makefile.dep
7 changes: 7 additions & 0 deletions boards/adafruit-itsybitsy-m4/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include "periph/gpio.h"
#include "mtd_spi_nor.h"
#include "timex.h"
#ifdef MODULE_VFS_DEFAULT
#include "vfs_default.h"
#endif

#ifdef MODULE_MTD
/* GD25x16 */
Expand Down Expand Up @@ -52,4 +55,8 @@ static mtd_spi_nor_t samd51_nor_dev = {
};

mtd_dev_t *mtd0 = (mtd_dev_t *)&samd51_nor_dev;

#ifdef MODULE_VFS_DEFAULT
VFS_AUTO_MOUNT(littlefs2, VFS_MTD(samd51_nor_dev), VFS_DEFAULT_NVM(0), 0);
#endif
#endif /* MODULE_MTD */