mirror of
https://github.com/apache/nuttx.git
synced 2026-10-13 01:00:12 +00:00
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:
parent
864c97f1d9
commit
844652a7a1
1 changed files with 28 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue