Add configuration and example to test MTD partitions

This commit is contained in:
Gregory Nutt
2013-04-30 15:54:02 -06:00
parent 4d4ece78af
commit f9be47ead2
15 changed files with 1170 additions and 219 deletions
+5 -1
View File
@@ -4645,4 +4645,8 @@
sense, so it is disabled in the code (2013-4-30). sense, so it is disabled in the code (2013-4-30).
* drivers/mtd/mtd_partition.c: Support capability to clone one * drivers/mtd/mtd_partition.c: Support capability to clone one
MTD driver into several, MTD partition drivers, each of which MTD driver into several, MTD partition drivers, each of which
can manage a sub-region of the FLASH. can manage a sub-region of the FLASH (2013-4-30).
* configs/sim/nxffs: Converted to use the kconfig-frontends
tools (20130-4-30).
* configs/sim/mtdpart: A new configuration to test MTD
partitions (2013-4-30).
+2
View File
@@ -40,7 +40,9 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <stdlib.h> #include <stdlib.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include <nuttx/kmalloc.h>
#include "up_internal.h" #include "up_internal.h"
+10
View File
@@ -240,6 +240,11 @@ mount
cd <nuttx-directory>/tools cd <nuttx-directory>/tools
./configure.sh sim/mount ./configure.sh sim/mount
mtdpart
This is the apps/examples/mtdpart test using a MTD RAM driver to
simulate the FLASH part.
nettest nettest
Description Description
@@ -487,6 +492,11 @@ nx11
See apps/examples/README.txt for further details. See apps/examples/README.txt for further details.
nxffs
This is the apps/examples/nxffs test using a MTD RAM driver to
simulate the FLASH part.
nxlines nxlines
This is the apps/examples/nxlines test. This is the apps/examples/nxlines test.
+111
View File
@@ -0,0 +1,111 @@
############################################################################
# configs/sim/mtdpart/Make.defs
#
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
include ${TOPDIR}/.config
include ${TOPDIR}/tools/Config.mk
HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"}
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ARCHOPTIMIZATION = -g
else
ARCHOPTIMIZATION = -O2
endif
ARCHCPUFLAGS = -fno-builtin
ARCHCPUFLAGSXX = -fno-builtin -fno-exceptions -fno-rtti
ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
ARCHWARNINGSXX = -Wall -Wshadow
ARCHDEFINES =
ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
ARCHSCRIPT =
ifeq ($(CONFIG_SIM_M32),y)
ARCHCPUFLAGS += -m32
ARCHCPUFLAGSXX += -m32
endif
CROSSDEV =
CC = $(CROSSDEV)gcc
CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump
CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
OBJEXT = .o
LIBEXT = .a
ifeq ($(HOSTOS),Cygwin)
EXEEXT = .exe
else
EXEEXT =
endif
LDLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(LD)
CCLINKFLAGS = $(ARCHSCRIPT) # Link flags used with $(CC)
LDFLAGS = $(ARCHSCRIPT) # For backward compatibility, same as CCLINKFLAGS
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDLINKFLAGS += -g
CCLINKFLAGS += -g
LDFLAGS += -g
endif
ifeq ($(CONFIG_SIM_M32),y)
LDLINKFLAGS += -melf_i386
CCLINKFLAGS += -m32
LDFLAGS += -m32
endif
MKDEP = $(TOPDIR)/tools/mkdeps.sh
HOSTCC = gcc
HOSTINCLUDES = -I.
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(HOSTINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe
HOSTLDFLAGS =
+496
View File
@@ -0,0 +1,496 @@
#
# Automatically generated file; DO NOT EDIT.
# Nuttx/ Configuration
#
CONFIG_NUTTX_NEWCONFIG=y
#
# Build Setup
#
# CONFIG_EXPERIMENTAL is not set
CONFIG_HOST_LINUX=y
# CONFIG_HOST_OSX is not set
# CONFIG_HOST_WINDOWS is not set
# CONFIG_HOST_OTHER is not set
#
# Build Configuration
#
# CONFIG_APPS_DIR="../apps"
# CONFIG_BUILD_2PASS is not set
#
# Binary Output Formats
#
# CONFIG_RRLOAD_BINARY is not set
# CONFIG_INTELHEX_BINARY is not set
# CONFIG_MOTOROLA_SREC is not set
# CONFIG_RAW_BINARY is not set
#
# Customize Header Files
#
# CONFIG_ARCH_STDBOOL_H is not set
# CONFIG_ARCH_MATH_H is not set
# CONFIG_ARCH_FLOAT_H is not set
# CONFIG_ARCH_STDARG_H is not set
#
# Debug Options
#
CONFIG_DEBUG=y
# CONFIG_DEBUG_VERBOSE is not set
#
# Subsystem Debug Options
#
# CONFIG_DEBUG_MM is not set
# CONFIG_DEBUG_SCHED is not set
CONFIG_DEBUG_FS=y
# CONFIG_DEBUG_LIB is not set
# CONFIG_DEBUG_BINFMT is not set
# CONFIG_DEBUG_GRAPHICS is not set
#
# Driver Debug Options
#
# CONFIG_DEBUG_ANALOG is not set
# CONFIG_DEBUG_GPIO is not set
CONFIG_DEBUG_SYMBOLS=y
#
# System Type
#
# CONFIG_ARCH_8051 is not set
# CONFIG_ARCH_ARM is not set
# CONFIG_ARCH_AVR is not set
# CONFIG_ARCH_HC is not set
# CONFIG_ARCH_MIPS is not set
# CONFIG_ARCH_RGMP is not set
# CONFIG_ARCH_SH is not set
CONFIG_ARCH_SIM=y
# CONFIG_ARCH_X86 is not set
# CONFIG_ARCH_Z16 is not set
# CONFIG_ARCH_Z80 is not set
CONFIG_ARCH="sim"
#
# Simulation Configuration Options
#
# CONFIG_SIM_M32 is not set
# CONFIG_SIM_WALLTIME is not set
#
# External Memory Configuration
#
#
# Architecture Options
#
# CONFIG_ARCH_NOINTC is not set
# CONFIG_ARCH_VECNOTIRQ is not set
# CONFIG_ARCH_DMA is not set
# CONFIG_ARCH_IRQPRIO is not set
# CONFIG_CUSTOM_STACK is not set
# CONFIG_ADDRENV is not set
# CONFIG_ARCH_HAVE_VFORK is not set
# CONFIG_ARCH_STACKDUMP is not set
# CONFIG_ENDIAN_BIG is not set
# CONFIG_ARCH_HAVE_RAMFUNCS is not set
# CONFIG_ARCH_HAVE_RAMVECTORS is not set
#
# Board Settings
#
CONFIG_BOARD_LOOPSPERMSEC=5000
# CONFIG_ARCH_CALIBRATION is not set
CONFIG_DRAM_START=
CONFIG_DRAM_SIZE=
#
# Boot options
#
# CONFIG_BOOT_RUNFROMEXTSRAM is not set
CONFIG_BOOT_RUNFROMFLASH=y
# CONFIG_BOOT_RUNFROMISRAM is not set
# CONFIG_BOOT_RUNFROMSDRAM is not set
# CONFIG_BOOT_COPYTORAM is not set
#
# Board Selection
#
CONFIG_ARCH_BOARD_SIM=y
# CONFIG_ARCH_BOARD_CUSTOM is not set
CONFIG_ARCH_BOARD="sim"
#
# Common Board Options
#
#
# Board-Specific Options
#
#
# RTOS Features
#
# CONFIG_BOARD_INITIALIZE is not set
CONFIG_MSEC_PER_TICK=10
CONFIG_RR_INTERVAL=0
# CONFIG_SCHED_INSTRUMENTATION is not set
CONFIG_TASK_NAME_SIZE=32
# CONFIG_SCHED_HAVE_PARENT is not set
# CONFIG_JULIAN_TIME is not set
CONFIG_START_YEAR=2011
CONFIG_START_MONTH=4
CONFIG_START_DAY=29
CONFIG_DEV_CONSOLE=y
CONFIG_MUTEX_TYPES=y
# CONFIG_PRIORITY_INHERITANCE is not set
# CONFIG_FDCLONE_DISABLE is not set
# CONFIG_FDCLONE_STDIO is not set
CONFIG_SDCLONE_DISABLE=y
# CONFIG_SCHED_WAITPID is not set
# CONFIG_SCHED_STARTHOOK is not set
# CONFIG_SCHED_ATEXIT is not set
# CONFIG_SCHED_ONEXIT is not set
CONFIG_USER_ENTRYPOINT="mtdpart_main"
CONFIG_DISABLE_OS_API=y
# CONFIG_DISABLE_CLOCK is not set
CONFIG_DISABLE_POSIX_TIMERS=y
CONFIG_DISABLE_PTHREAD=y
CONFIG_DISABLE_SIGNALS=y
CONFIG_DISABLE_MQUEUE=y
# CONFIG_DISABLE_ENVIRON is not set
#
# Sizes of configurable things (0 disables)
#
CONFIG_MAX_TASKS=64
CONFIG_MAX_TASK_ARGS=4
CONFIG_NPTHREAD_KEYS=4
CONFIG_NFILE_DESCRIPTORS=32
CONFIG_NFILE_STREAMS=16
CONFIG_NAME_MAX=32
CONFIG_PREALLOC_MQ_MSGS=32
CONFIG_MQ_MAXMSGSIZE=32
CONFIG_MAX_WDOGPARMS=4
CONFIG_PREALLOC_WDOGS=32
CONFIG_PREALLOC_TIMERS=8
#
# Stack and heap information
#
CONFIG_IDLETHREAD_STACKSIZE=4096
CONFIG_USERMAIN_STACKSIZE=4096
CONFIG_PTHREAD_STACK_MIN=256
CONFIG_PTHREAD_STACK_DEFAULT=8192
#
# Device Drivers
#
CONFIG_DISABLE_POLL=y
CONFIG_DEV_NULL=y
# CONFIG_DEV_ZERO is not set
# CONFIG_LOOP is not set
# CONFIG_RAMDISK is not set
# CONFIG_CAN is not set
# CONFIG_PWM is not set
# CONFIG_I2C is not set
# CONFIG_SPI is not set
# CONFIG_RTC is not set
# CONFIG_WATCHDOG is not set
# CONFIG_ANALOG is not set
# CONFIG_BCH is not set
# CONFIG_INPUT is not set
# CONFIG_LCD is not set
# CONFIG_MMCSD is not set
CONFIG_MTD=y
CONFIG_MTD_PARTITION=y
CONFIG_RAMMTD=y
CONFIG_RAMMTD_BLOCKSIZE=512
CONFIG_RAMMTD_ERASESIZE=4096
CONFIG_RAMMTD_ERASESTATE=0xff
CONFIG_RAMMTD_FLASHSIM=y
# CONFIG_MTD_AT24XX is not set
# CONFIG_MTD_AT45DB is not set
# CONFIG_MTD_MP25P is not set
# CONFIG_MTD_RAMTRON is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_SST25 is not set
# CONFIG_MTD_SST39FV is not set
# CONFIG_MTD_W25 is not set
# CONFIG_PIPES is not set
# CONFIG_PM is not set
# CONFIG_POWER is not set
# CONFIG_SENSORS is not set
# CONFIG_SERCOMM_CONSOLE is not set
CONFIG_SERIAL=y
# CONFIG_DEV_LOWCONSOLE is not set
# CONFIG_16550_UART is not set
# CONFIG_STANDARD_SERIAL is not set
# CONFIG_USBDEV is not set
# CONFIG_USBHOST is not set
# CONFIG_WIRELESS is not set
#
# System Logging Device Options
#
#
# System Logging
#
# CONFIG_RAMLOG is not set
#
# Networking Support
#
# CONFIG_NET is not set
#
# File Systems
#
#
# File system configuration
#
# CONFIG_DISABLE_MOUNTPOINT is not set
# CONFIG_FS_RAMMAP is not set
CONFIG_FS_FAT=y
# CONFIG_FAT_LCNAMES is not set
# CONFIG_FAT_LFN is not set
# CONFIG_FS_FATTIME is not set
# CONFIG_FAT_DMAMEMORY is not set
# CONFIG_FS_NXFFS is not set
# CONFIG_FS_ROMFS is not set
#
# System Logging
#
# CONFIG_SYSLOG_ENABLE is not set
# CONFIG_SYSLOG is not set
#
# Graphics Support
#
# CONFIG_NX is not set
#
# Memory Management
#
# CONFIG_MM_MULTIHEAP is not set
# CONFIG_MM_SMALL is not set
CONFIG_MM_REGIONS=1
# CONFIG_GRAN is not set
#
# Binary Formats
#
# CONFIG_BINFMT_DISABLE is not set
# CONFIG_BINFMT_EXEPATH is not set
# CONFIG_NXFLAT is not set
# CONFIG_ELF is not set
# CONFIG_BUILTIN is not set
# CONFIG_PIC is not set
# CONFIG_SYMTAB_ORDEREDBYNAME is not set
#
# Library Routines
#
#
# Standard C Library Options
#
CONFIG_STDIO_BUFFER_SIZE=64
CONFIG_STDIO_LINEBUFFER=y
CONFIG_NUNGET_CHARS=2
CONFIG_LIB_HOMEDIR="/"
# CONFIG_LIBM is not set
# CONFIG_NOPRINTF_FIELDWIDTH is not set
# CONFIG_LIBC_FLOATINGPOINT is not set
CONFIG_LIB_RAND_ORDER=3
# CONFIG_EOL_IS_CR is not set
# CONFIG_EOL_IS_LF is not set
# CONFIG_EOL_IS_BOTH_CRLF is not set
CONFIG_EOL_IS_EITHER_CRLF=y
# CONFIG_LIBC_EXECFUNCS is not set
CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=1024
CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=2048
# CONFIG_LIBC_STRERROR is not set
# CONFIG_LIBC_PERROR_STDOUT is not set
CONFIG_ARCH_LOWPUTC=y
CONFIG_LIB_SENDFILE_BUFSIZE=512
# CONFIG_ARCH_ROMGETC is not set
# CONFIG_ARCH_OPTIMIZED_FUNCTIONS is not set
#
# Non-standard Library Support
#
# CONFIG_LIB_KBDCODEC is not set
#
# Basic CXX Support
#
# CONFIG_C99_BOOL8 is not set
# CONFIG_HAVE_CXX is not set
#
# Application Configuration
#
#
# Built-In Applications
#
#
# Examples
#
# CONFIG_EXAMPLES_BUTTONS is not set
# CONFIG_EXAMPLES_CAN is not set
# CONFIG_EXAMPLES_COMPOSITE is not set
# CONFIG_EXAMPLES_DHCPD is not set
# CONFIG_EXAMPLES_ELF is not set
# CONFIG_EXAMPLES_FTPC is not set
# CONFIG_EXAMPLES_FTPD is not set
# CONFIG_EXAMPLES_HELLO is not set
# CONFIG_EXAMPLES_HELLOXX is not set
# CONFIG_EXAMPLES_JSON is not set
# CONFIG_EXAMPLES_HIDKBD is not set
# CONFIG_EXAMPLES_KEYPADTEST is not set
# CONFIG_EXAMPLES_IGMP is not set
# CONFIG_EXAMPLES_LCDRW is not set
# CONFIG_EXAMPLES_MM is not set
# CONFIG_EXAMPLES_MODBUS is not set
# CONFIG_EXAMPLES_MOUNT is not set
CONFIG_EXAMPLES_MTDPART=y
# CONFIG_EXAMPLES_MTDPART_ARCHINIT is not set
CONFIG_EXAMPLES_MTDPART_NEBLOCKS=32
CONFIG_EXAMPLES_MTDPART_NPARTITIONS=3
# CONFIG_EXAMPLES_NSH is not set
# CONFIG_EXAMPLES_NULL is not set
# CONFIG_EXAMPLES_NX is not set
# CONFIG_EXAMPLES_NXCONSOLE is not set
# CONFIG_EXAMPLES_NXFFS is not set
# CONFIG_EXAMPLES_NXFLAT is not set
# CONFIG_EXAMPLES_NXHELLO is not set
# CONFIG_EXAMPLES_NXIMAGE is not set
# CONFIG_EXAMPLES_NXLINES is not set
# CONFIG_EXAMPLES_NXTEXT is not set
# CONFIG_EXAMPLES_OSTEST is not set
# CONFIG_EXAMPLES_PASHELLO is not set
# CONFIG_EXAMPLES_PIPE is not set
# CONFIG_EXAMPLES_POLL is not set
# CONFIG_EXAMPLES_POSIXSPAWN is not set
# CONFIG_EXAMPLES_QENCODER is not set
# CONFIG_EXAMPLES_RGMP is not set
# CONFIG_EXAMPLES_ROMFS is not set
# CONFIG_EXAMPLES_SENDMAIL is not set
# CONFIG_EXAMPLES_SERLOOP is not set
# CONFIG_EXAMPLES_TELNETD is not set
# CONFIG_EXAMPLES_THTTPD is not set
# CONFIG_EXAMPLES_TIFF is not set
# CONFIG_EXAMPLES_TOUCHSCREEN is not set
# CONFIG_EXAMPLES_UDP is not set
# CONFIG_EXAMPLES_UIP is not set
# CONFIG_EXAMPLES_USBSERIAL is not set
# CONFIG_EXAMPLES_USBMSC is not set
# CONFIG_EXAMPLES_USBTERM is not set
# CONFIG_EXAMPLES_WATCHDOG is not set
#
# Graphics Support
#
# CONFIG_TIFF is not set
#
# Interpreters
#
# CONFIG_INTERPRETERS_FICL is not set
# CONFIG_INTERPRETERS_PCODE is not set
#
# Network Utilities
#
#
# Networking Utilities
#
# CONFIG_NETUTILS_CODECS is not set
# CONFIG_NETUTILS_DHCPC is not set
# CONFIG_NETUTILS_DHCPD is not set
# CONFIG_NETUTILS_FTPC is not set
# CONFIG_NETUTILS_FTPD is not set
# CONFIG_NETUTILS_JSON is not set
# CONFIG_NETUTILS_RESOLV is not set
# CONFIG_NETUTILS_SMTP is not set
# CONFIG_NETUTILS_TELNETD is not set
# CONFIG_NETUTILS_TFTPC is not set
# CONFIG_NETUTILS_THTTPD is not set
# CONFIG_NETUTILS_UIPLIB is not set
# CONFIG_NETUTILS_WEBCLIENT is not set
#
# FreeModBus
#
# CONFIG_MODBUS is not set
#
# NSH Library
#
# CONFIG_NSH_LIBRARY is not set
#
# NxWidgets/NxWM
#
#
# System NSH Add-Ons
#
#
# Custom Free Memory Command
#
# CONFIG_SYSTEM_FREE is not set
#
# I2C tool
#
#
# FLASH Program Installation
#
# CONFIG_SYSTEM_INSTALL is not set
#
# RAM Test
#
# CONFIG_SYSTEM_RAMTEST is not set
#
# readline()
#
# CONFIG_SYSTEM_READLINE is not set
#
# Power Off
#
# CONFIG_SYSTEM_POWEROFF is not set
#
# RAMTRON
#
# CONFIG_SYSTEM_RAMTRON is not set
#
# SD Card
#
# CONFIG_SYSTEM_SDCARD is not set
#
# Sysinfo
#
# CONFIG_SYSTEM_SYSINFO is not set
#
# USB Monitor
#
+12 -6
View File
@@ -1,7 +1,7 @@
############################################################################ #!/bin/bash
# configs/sim/nxffs/appconfig # confisgs/sim/mtdpart/setenv.sh
# #
# Copyright (C) 2011 Gregory Nutt. All rights reserved. # Copyright (C) 2013 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@@ -31,9 +31,15 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE. # POSSIBILITY OF SUCH DAMAGE.
# #
############################################################################
# Path to example in apps/examples containing the user_start entry point if [ "$(basename $0)" = "setenv.sh" ] ; then
echo "You must source this script, not run it!" 1>&2
exit 1
fi
CONFIGURED_APPS += examples/nxffs if [ -z ${PATH_ORIG} ]; then export PATH_ORIG=${PATH}; fi
#export NUTTX_BIN=
#export PATH=${NUTTX_BIN}:/sbin:/usr/sbin:${PATH_ORIG}
echo "PATH : ${PATH}"
File diff suppressed because it is too large Load Diff
+29
View File
@@ -24,6 +24,35 @@ config MTD_PARTITION
managing the sub-region of flash beginning at 'offset' (in blocks) managing the sub-region of flash beginning at 'offset' (in blocks)
and of size 'nblocks' on the device specified by 'mtd'. and of size 'nblocks' on the device specified by 'mtd'.
config RAMMTD
bool "RAM-based MTD driver"
default n
---help---
Build support for a RAM-based MTD driver.
if RAMMTD
config RAMMTD_BLOCKSIZE
int "RAM MTD block size"
default 512
config RAMMTD_ERASESIZE
int "RAM MTD erase block size"
default 4096
config RAMMTD_ERASESTATE
hex "Simulated erase state"
default 0xff
config RAMMTD_FLASHSIM
bool "RAM MTD FLASH Simulation"
default n
---help---
RAMMTD_FLASHSIM will add some extra logic to improve the level of
FLASH simulation.
endif
config MTD_AT24XX config MTD_AT24XX
bool "I2C-based AT24XX eeprom" bool "I2C-based AT24XX eeprom"
default n default n
+7 -7
View File
@@ -75,10 +75,10 @@
# error "Must have CONFIG_RAMMTD_BLOCKSIZE <= CONFIG_RAMMTD_ERASESIZE" # error "Must have CONFIG_RAMMTD_BLOCKSIZE <= CONFIG_RAMMTD_ERASESIZE"
#endif #endif
#undef CONFIG_RAMMTD_BLKPER #undef RAMMTD_BLKPER
#define CONFIG_RAMMTD_BLKPER (CONFIG_RAMMTD_ERASESIZE/CONFIG_RAMMTD_BLOCKSIZE) #define RAMMTD_BLKPER (CONFIG_RAMMTD_ERASESIZE/CONFIG_RAMMTD_BLOCKSIZE)
#if CONFIG_RAMMTD_BLKPER*CONFIG_RAMMTD_BLOCKSIZE != CONFIG_RAMMTD_ERASESIZE #if RAMMTD_BLKPER*CONFIG_RAMMTD_BLOCKSIZE != CONFIG_RAMMTD_ERASESIZE
# error "CONFIG_RAMMTD_ERASESIZE must be an even multiple of CONFIG_RAMMTD_BLOCKSIZE" # error "CONFIG_RAMMTD_ERASESIZE must be an even multiple of CONFIG_RAMMTD_BLOCKSIZE"
#endif #endif
@@ -208,8 +208,8 @@ static int ram_erase(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks
* in logical block numbers * in logical block numbers
*/ */
startblock *= CONFIG_RAMMTD_BLKPER; startblock *= RAMMTD_BLKPER;
nblocks *= CONFIG_RAMMTD_BLKPER; nblocks *= RAMMTD_BLKPER;
/* Get the offset corresponding to the first block and the size /* Get the offset corresponding to the first block and the size
* corresponding to the number of blocks. * corresponding to the number of blocks.
@@ -240,7 +240,7 @@ static ssize_t ram_bread(FAR struct mtd_dev_s *dev, off_t startblock, size_t nbl
/* Don't let the read exceed the size of the ram buffer */ /* Don't let the read exceed the size of the ram buffer */
maxblock = priv->nblocks * CONFIG_RAMMTD_BLKPER; maxblock = priv->nblocks * RAMMTD_BLKPER;
if (startblock >= maxblock) if (startblock >= maxblock)
{ {
return 0; return 0;
@@ -280,7 +280,7 @@ static ssize_t ram_bwrite(FAR struct mtd_dev_s *dev, off_t startblock,
/* Don't let the write exceed the size of the ram buffer */ /* Don't let the write exceed the size of the ram buffer */
maxblock = priv->nblocks * CONFIG_RAMMTD_BLKPER; maxblock = priv->nblocks * RAMMTD_BLKPER;
if (startblock >= maxblock) if (startblock >= maxblock)
{ {
return 0; return 0;
+8
View File
@@ -11,6 +11,14 @@ config FS_NXFFS
Enable NuttX FLASH file system (NXFF) support. Enable NuttX FLASH file system (NXFF) support.
if FS_NXFFS if FS_NXFFS
config NXFFS_PREALLOCATED
bool "Single, preallocated volume"
default n
---help---
If CONFIG_NXFSS_PREALLOCATED is defined, then this is the single, pre-
allocated NXFFS volume instance.
config NXFFS_ERASEDSTATE config NXFFS_ERASEDSTATE
hex "FLASH erased state" hex "FLASH erased state"
default 0xff default 0xff
+2 -2
View File
@@ -334,11 +334,11 @@ extern const uint8_t g_inodemagic[NXFFS_MAGICSIZE];
extern const uint8_t g_datamagic[NXFFS_MAGICSIZE]; extern const uint8_t g_datamagic[NXFFS_MAGICSIZE];
/* If CONFIG_NXFSS_PREALLOCATED is defined, then this is the single, pre- /* If CONFIG_NXFFS_PREALLOCATED is defined, then this is the single, pre-
* allocated NXFFS volume instance. * allocated NXFFS volume instance.
*/ */
#ifdef CONFIG_NXFSS_PREALLOCATED #ifdef CONFIG_NXFFS_PREALLOCATED
extern struct nxffs_volume_s g_volume; extern struct nxffs_volume_s g_volume;
#endif #endif
+8 -8
View File
@@ -122,11 +122,11 @@ const uint8_t g_inodemagic[NXFFS_MAGICSIZE] = { 'I', 'n', 'o', 'd' };
const uint8_t g_datamagic[NXFFS_MAGICSIZE] = { 'D', 'a', 't', 'a' }; const uint8_t g_datamagic[NXFFS_MAGICSIZE] = { 'D', 'a', 't', 'a' };
/* If CONFIG_NXFSS_PREALLOCATED is defined, then this is the single, pre- /* If CONFIG_NXFFS_PREALLOCATED is defined, then this is the single, pre-
* allocated NXFFS volume instance. * allocated NXFFS volume instance.
*/ */
#ifdef CONFIG_NXFSS_PREALLOCATED #ifdef CONFIG_NXFFS_PREALLOCATED
struct nxffs_volume_s g_volume; struct nxffs_volume_s g_volume;
#endif #endif
@@ -160,11 +160,11 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd)
off_t threshold; off_t threshold;
int ret; int ret;
/* If CONFIG_NXFSS_PREALLOCATED is defined, then this is the single, pre- /* If CONFIG_NXFFS_PREALLOCATED is defined, then this is the single, pre-
* allocated NXFFS volume instance. * allocated NXFFS volume instance.
*/ */
#ifdef CONFIG_NXFSS_PREALLOCATED #ifdef CONFIG_NXFFS_PREALLOCATED
volume = &g_volume; volume = &g_volume;
memset(volume, 0, sizeof(struct nxffs_volume_s)); memset(volume, 0, sizeof(struct nxffs_volume_s));
@@ -282,7 +282,7 @@ errout_with_buffer:
errout_with_cache: errout_with_cache:
kfree(volume->cache); kfree(volume->cache);
errout_with_volume: errout_with_volume:
#ifndef CONFIG_NXFSS_PREALLOCATED #ifndef CONFIG_NXFFS_PREALLOCATED
kfree(volume); kfree(volume);
#endif #endif
return ret; return ret;
@@ -490,11 +490,11 @@ int nxffs_limits(FAR struct nxffs_volume_s *volume)
int nxffs_bind(FAR struct inode *blkdriver, FAR const void *data, int nxffs_bind(FAR struct inode *blkdriver, FAR const void *data,
FAR void **handle) FAR void **handle)
{ {
#ifndef CONFIG_NXFSS_PREALLOCATED #ifndef CONFIG_NXFFS_PREALLOCATED
# error "No design to support dynamic allocation of volumes" # error "No design to support dynamic allocation of volumes"
#else #else
/* If CONFIG_NXFSS_PREALLOCATED is defined, then this is the single, pre- /* If CONFIG_NXFFS_PREALLOCATED is defined, then this is the single, pre-
* allocated NXFFS volume instance. * allocated NXFFS volume instance.
*/ */
@@ -514,7 +514,7 @@ int nxffs_bind(FAR struct inode *blkdriver, FAR const void *data,
int nxffs_unbind(FAR void *handle, FAR struct inode **blkdriver) int nxffs_unbind(FAR void *handle, FAR struct inode **blkdriver)
{ {
#ifndef CONFIG_NXFSS_PREALLOCATED #ifndef CONFIG_NXFFS_PREALLOCATED
# error "No design to support dynamic allocation of volumes" # error "No design to support dynamic allocation of volumes"
#else #else
return g_volume.ofiles ? -EBUSY : OK; return g_volume.ofiles ? -EBUSY : OK;
+5 -5
View File
@@ -71,7 +71,7 @@
* to pre-allocate the write state structure. * to pre-allocate the write state structure.
*/ */
#ifdef CONFIG_NXFSS_PREALLOCATED #ifdef CONFIG_NXFFS_PREALLOCATED
static struct nxffs_wrfile_s g_wrfile; static struct nxffs_wrfile_s g_wrfile;
#endif #endif
@@ -503,7 +503,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
* that includes additional information to support the write operation. * that includes additional information to support the write operation.
*/ */
#ifdef CONFIG_NXFSS_PREALLOCATED #ifdef CONFIG_NXFFS_PREALLOCATED
wrfile = &g_wrfile; wrfile = &g_wrfile;
memset(wrfile, 0, sizeof(struct nxffs_wrfile_s)); memset(wrfile, 0, sizeof(struct nxffs_wrfile_s));
#else #else
@@ -673,7 +673,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
errout_with_name: errout_with_name:
kfree(wrfile->ofile.entry.name); kfree(wrfile->ofile.entry.name);
errout_with_ofile: errout_with_ofile:
#ifndef CONFIG_NXFSS_PREALLOCATED #ifndef CONFIG_NXFFS_PREALLOCATED
kfree(wrfile); kfree(wrfile);
#endif #endif
@@ -845,7 +845,7 @@ static inline void nxffs_freeofile(FAR struct nxffs_volume_s *volume,
* write-only open file container) * write-only open file container)
*/ */
#ifdef CONFIG_NXFSS_PREALLOCATED #ifdef CONFIG_NXFFS_PREALLOCATED
if ((FAR struct nxffs_wrfile_s*)ofile != &g_wrfile) if ((FAR struct nxffs_wrfile_s*)ofile != &g_wrfile)
#endif #endif
{ {
@@ -983,7 +983,7 @@ FAR struct nxffs_wrfile_s *nxffs_findwriter(FAR struct nxffs_volume_s *volume)
* name attached. * name attached.
*/ */
#ifdef CONFIG_NXFSS_PREALLOCATED #ifdef CONFIG_NXFFS_PREALLOCATED
return g_wrfile.ofile.entry.name != NULL ? &g_wrfile : NULL; return g_wrfile.ofile.entry.name != NULL ? &g_wrfile : NULL;
#else #else
# error "Missing implementation" # error "Missing implementation"
+8
View File
@@ -48,6 +48,14 @@ config LIBC_FLOATINGPOINT
By default, floating point By default, floating point
support in printf, sscanf, etc. is disabled. support in printf, sscanf, etc. is disabled.
config LIB_RAND_ORDER
int "Order of the random number generate"
default 1
range 1 3
---help---
The order of the random number generator. 1=fast but very bad random
numbers, 3=slow but very good random numbers.
choice choice
prompt "Newline Options" prompt "Newline Options"
default EOL_IS_EITHER_CRLF default EOL_IS_EITHER_CRLF
+2
View File
@@ -98,9 +98,11 @@ int posix_spawnattr_init(posix_spawnattr_t *attr)
attr->policy = sched_getscheduler(0); attr->policy = sched_getscheduler(0);
#ifndef CONFIG_DISABLE_SIGNALS
/* Empty signal masek */ /* Empty signal masek */
attr->sigmask = 0; attr->sigmask = 0;
#endif
/* Default stack size */ /* Default stack size */