You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ce...@apache.org on 2026/08/05 13:26:48 UTC
(nuttx) 13/27: stm32f746g-disco: Add LittleFS support for N25Q QSPI flash
This is an automated email from the ASF dual-hosted git repository.
cederom pushed a commit to branch releases/13.0
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 91090a9990e827b3428a7f1583c3e41d25b757fb
Author: Felipe Moura <mo...@gmail.com>
AuthorDate: Sun Jul 19 23:09:26 2026 -0300
stm32f746g-disco: Add LittleFS support for N25Q QSPI flash
Add a LittleFS mount option for the on-board N25Q QSPI flash,
mirroring the existing NXFFS/LittleFS toggle already used by the
sibling stm32_w25q.c driver. Needed because NXFFS does not support
rename(), which the companion Dropbear config depends on.
Signed-off-by: Felipe Moura <mo...@gmail.com>
---
.../arm/stm32f7/stm32f746g-disco/src/stm32_n25q.c | 29 +++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_n25q.c b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_n25q.c
index 3249fb4ac01..8b9fef97de2 100644
--- a/boards/arm/stm32f7/stm32f746g-disco/src/stm32_n25q.c
+++ b/boards/arm/stm32f7/stm32f746g-disco/src/stm32_n25q.c
@@ -56,7 +56,9 @@
#include "stm32_qspi.h"
-#define HAVE_N25QXXX_NXFFS
+#if defined(CONFIG_FS_NXFFS) && !defined(CONFIG_FS_LITTLEFS)
+# define HAVE_N25QXXX_NXFFS
+#endif
/****************************************************************************
* Public Functions
@@ -115,5 +117,30 @@ int stm32_n25qxxx_setup(void)
#endif
+#if !defined(CONFIG_FS_NXFFS) && defined(CONFIG_FS_LITTLEFS)
+ /* Register the MTD driver so that it can be accessed from the
+ * VFS.
+ */
+
+ ret = register_mtddriver("/dev/n25q", mtd_dev, 0755, NULL);
+ if (ret < 0)
+ {
+ syslog(LOG_ERR, "ERROR: Failed to register MTD driver: %d\n",
+ ret);
+ return ret;
+ }
+
+ /* Mount the LittleFS file system */
+
+ ret = nx_mount("/dev/n25q", "/data", "littlefs", 0, "autoformat");
+ if (ret < 0)
+ {
+ syslog(LOG_ERR,
+ "ERROR: Failed to mount LittleFS at /data: %d\n",
+ ret);
+ return ret;
+ }
+#endif
+
return 0;
}