mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
SAMV71-XULT: Add support for the NXFFS file system on QuadSPI
This commit is contained in:
@@ -503,6 +503,8 @@ FLASH:
|
||||
CONFIG_S25FL1_QSPIMODE=0
|
||||
CONFIG_S25FL1_QSPI_FREQUENCY=108000000
|
||||
|
||||
SmartFS
|
||||
-------
|
||||
I tested using the SmartFS FLASH file system. This additional options
|
||||
enable the SmartFS:
|
||||
|
||||
@@ -535,6 +537,36 @@ A better application design would perform SmartFS initialization
|
||||
asynchronously on a separate thread to avoid the delay at the user
|
||||
interface.
|
||||
|
||||
Update: SmartFS support is disabled temporarily due to some
|
||||
integration issues that still need to be resolved.
|
||||
|
||||
NXFFS
|
||||
-----
|
||||
The NXFFS file system is selected with the following settings.
|
||||
|
||||
CONFIG_FS_NXFFS=y
|
||||
CONFIG_NXFFS_ERASEDSTATE=0xff
|
||||
CONFIG_NXFFS_MAXNAMLEN=255
|
||||
CONFIG_NXFFS_PACKTHRESHOLD=32
|
||||
CONFIG_NXFFS_PREALLOCATED=y
|
||||
CONFIG_NXFFS_TAILTHRESHOLD=8192
|
||||
|
||||
The NXFFS file system is automatically mounted by logic src/sam_bringup.c when the system boots:
|
||||
|
||||
nsh> mount
|
||||
/mnt/s25fl1 type nxffs
|
||||
nsh> echo "This is a test" >/mnt/s25fl1/atest.txt
|
||||
nsh> ls /mnt/s25fl1
|
||||
/mnt/s25fl1:
|
||||
atest.txt
|
||||
nsh> cat /mnt/s25fl1/atest.txt
|
||||
This is a test
|
||||
|
||||
Character Driver
|
||||
----------------
|
||||
If neither SmartFS nor NXFFS are defined, then the S25FL1 driver will be
|
||||
wrapped as a character driver and available as /dev/mtd0.
|
||||
|
||||
Networking
|
||||
==========
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/fs/ramdisk.h>
|
||||
#include <nuttx/fs/nxffs.h>
|
||||
#include <nuttx/binfmt/elf.h>
|
||||
|
||||
#include "samv71-xult.h"
|
||||
@@ -99,7 +100,7 @@ int sam_bringup(void)
|
||||
#ifdef HAVE_S25FL1
|
||||
FAR struct qspi_dev_s *qspi;
|
||||
FAR struct mtd_dev_s *mtd;
|
||||
#ifndef HAVE_SMARTFS
|
||||
#ifndef HAVE_S25FL1_SMARTFS
|
||||
char blockdev[18];
|
||||
char chardev[12];
|
||||
#endif
|
||||
@@ -213,7 +214,7 @@ int sam_bringup(void)
|
||||
SYSLOG("ERROR: s25fl1_initialize failed\n");
|
||||
}
|
||||
|
||||
#ifdef HAVE_SMARTFS
|
||||
#ifdef HAVE_S25FL1_SMARTFS
|
||||
/* Configure the device with no partition support */
|
||||
|
||||
ret = smart_initialize(S25FL1_SMART_MINOR, mtd, NULL);
|
||||
@@ -222,6 +223,24 @@ int sam_bringup(void)
|
||||
SYSLOG("ERROR: Failed to initialize SmartFS: %d\n", ret);
|
||||
}
|
||||
|
||||
#elif defined(HAVE_S25FL1_NXFFS)
|
||||
/* Initialize to provide NXFFS on the S25FL1 MTD interface */
|
||||
|
||||
ret = nxffs_initialize(mtd);
|
||||
if (ret < 0)
|
||||
{
|
||||
SYSLOG("ERROR: NXFFS initialization failed: %d\n", ret);
|
||||
}
|
||||
|
||||
/* Mount the file system at /mnt/s25fl1 */
|
||||
|
||||
ret = mount(NULL, "/mnt/s25fl1", "nxffs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
SYSLOG("ERROR: Failed to mount the NXFFS volume: %d\n", errno);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else
|
||||
/* Use the FTL layer to wrap the MTD driver as a block driver */
|
||||
|
||||
|
||||
@@ -53,18 +53,19 @@
|
||||
************************************************************************************/
|
||||
/* Configuration ********************************************************************/
|
||||
|
||||
#define HAVE_HSMCI 1
|
||||
#define HAVE_AUTOMOUNTER 1
|
||||
#define HAVE_USB 1
|
||||
#define HAVE_USBDEV 1
|
||||
#define HAVE_USBMONITOR 1
|
||||
#define HAVE_NETWORK 1
|
||||
#define HAVE_MACADDR 1
|
||||
#define HAVE_MTDCONFIG 1
|
||||
#define HAVE_S25FL1 1
|
||||
#define HAVE_SMARTFS 1
|
||||
#define HAVE_WM8904 1
|
||||
#define HAVE_AUDIO_NULL 1
|
||||
#define HAVE_HSMCI 1
|
||||
#define HAVE_AUTOMOUNTER 1
|
||||
#define HAVE_USB 1
|
||||
#define HAVE_USBDEV 1
|
||||
#define HAVE_USBMONITOR 1
|
||||
#define HAVE_NETWORK 1
|
||||
#define HAVE_MACADDR 1
|
||||
#define HAVE_MTDCONFIG 1
|
||||
#define HAVE_S25FL1 1
|
||||
#define HAVE_S25FL1_NXFFS 1
|
||||
#undef HAVE_S25FL1_SMARTFS /* There are some issues to be resolved */
|
||||
#define HAVE_WM8904 1
|
||||
#define HAVE_AUDIO_NULL 1
|
||||
|
||||
/* HSMCI */
|
||||
/* Can't support MMC/SD if the card interface is not enabled */
|
||||
@@ -187,16 +188,22 @@
|
||||
|
||||
#ifndef CONFIG_MTD_S25FL1
|
||||
# undef HAVE_S25FL1
|
||||
# undef HAVE_SMARTFS
|
||||
# undef HAVE_S25FL1_NXFFS
|
||||
# undef HAVE_S25FL1_SMARTFS
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SAMV7_QSPI
|
||||
# undef HAVE_S25FL1
|
||||
# undef HAVE_SMARTFS
|
||||
# undef HAVE_S25FL1_NXFFS
|
||||
# undef HAVE_S25FL1_SMARTFS
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_FS_NXFFS
|
||||
# undef HAVE_S25FL1_NXFFS
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_MTD_SMART) || !defined(CONFIG_FS_SMARTFS)
|
||||
# undef HAVE_SMARTFS
|
||||
# undef HAVE_S25FL1_SMARTFS
|
||||
#endif
|
||||
|
||||
/* If both the S25FL1 FLASH and SmartFS, then this is the minor device
|
||||
|
||||
Reference in New Issue
Block a user