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 <moura.fmo@gmail.com>
This commit is contained in:
Felipe Moura 2026-07-19 23:09:26 -03:00 • committed by Xiang Xiao
parent 864c97f1d9
commit 844652a7a1

View file

@ -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;
}