From bede2bcc72fd6bb592bea3ff93ee63128025edae Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 2 Feb 2012 04:35:35 +0000 Subject: [PATCH] Add David Hewson's corrections to the LPC214x USB device driver; Add LPC214x configuration to test the USB composite device git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4359 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- apps/examples/README.txt | 10 +- apps/examples/composite/composite_main.c | 9 +- apps/netutils/README.txt | 73 +- nuttx/ChangeLog | 4 + nuttx/TODO | 11 +- nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c | 37 +- nuttx/configs/mcu123-lpc214x/README.txt | 5 +- .../mcu123-lpc214x/composite/Make.defs | 160 ++++ .../mcu123-lpc214x/composite/appconfig | 39 + .../mcu123-lpc214x/composite/defconfig | 890 ++++++++++++++++++ .../mcu123-lpc214x/composite/ld.script | 119 +++ .../mcu123-lpc214x/composite/setenv.sh | 66 ++ nuttx/configs/mcu123-lpc214x/nsh/ld.script | 8 +- nuttx/configs/mcu123-lpc214x/ostest/ld.script | 8 +- nuttx/configs/mcu123-lpc214x/src/Makefile | 10 +- .../configs/mcu123-lpc214x/src/up_composite.c | 155 +++ nuttx/configs/mcu123-lpc214x/src/up_spi.c | 5 +- nuttx/configs/mcu123-lpc214x/src/up_usbmsc.c | 0 .../mcu123-lpc214x/usbserial/ld.script | 8 +- .../mcu123-lpc214x/usbstorage/Make.defs | 4 +- .../mcu123-lpc214x/usbstorage/ld.script | 8 +- .../configs/stm3210e-eval/composite/Make.defs | 2 +- nuttx/lib/termios/lib_tcsetattr.c | 2 +- 23 files changed, 1575 insertions(+), 58 deletions(-) create mode 100644 nuttx/configs/mcu123-lpc214x/composite/Make.defs create mode 100644 nuttx/configs/mcu123-lpc214x/composite/appconfig create mode 100644 nuttx/configs/mcu123-lpc214x/composite/defconfig create mode 100644 nuttx/configs/mcu123-lpc214x/composite/ld.script create mode 100755 nuttx/configs/mcu123-lpc214x/composite/setenv.sh create mode 100644 nuttx/configs/mcu123-lpc214x/src/up_composite.c mode change 100755 => 100644 nuttx/configs/mcu123-lpc214x/src/up_usbmsc.c diff --git a/apps/examples/README.txt b/apps/examples/README.txt index 5004058934..fa14d57dce 100644 --- a/apps/examples/README.txt +++ b/apps/examples/README.txt @@ -139,8 +139,8 @@ examples/composite CONFIG_NSH_BUILTIN_APPS This example can be built as two NSH "built-in" commands if this option - is selected: 'msconn' will connect the USB mass storage device; 'msdis' - will disconnect the USB storage device. + is selected: 'conn' will connect the USB composite device; 'msdis' + will disconnect the USB composite device. Configuration options unique to this example: @@ -970,11 +970,11 @@ examples/thttpd CONFIG_EXAMPLE_THTTPD_NETMASK - Network mask Applications using this example will need to provide an appconfig - file in the configuration driver with instruction to build applications + file in the configuration directory with instruction to build applications like: - CONFIGURED_APPS += uiplib - CONFIGURED_APPS += thttpd + CONFIGURED_APPS += uiplib + CONFIGURED_APPS += thttpd examples/tiff ^^^^^^^^^^^^^ diff --git a/apps/examples/composite/composite_main.c b/apps/examples/composite/composite_main.c index 0166b7fa13..6c2a862872 100644 --- a/apps/examples/composite/composite_main.c +++ b/apps/examples/composite/composite_main.c @@ -373,6 +373,9 @@ static int dumptrace(void) static int open_serial(void) { int errcode; +#ifdef CONFIG_USBDEV_TRACE + int ret; +#endif /* Open the USB serial device for writing (blocking) */ @@ -402,13 +405,15 @@ static int open_serial(void) } } - /* If USB tracing is enabled, then dump all collected trace data to stdout */ + /* If USB tracing is enabled, then dump all collected trace data to + * stdout. + */ #ifdef CONFIG_USBDEV_TRACE ret = dumptrace(); if (ret < 0) { - goto errout; + return ret; } #endif } diff --git a/apps/netutils/README.txt b/apps/netutils/README.txt index ea9dbd5c37..b804449258 100644 --- a/apps/netutils/README.txt +++ b/apps/netutils/README.txt @@ -1,34 +1,88 @@ netutils ^^^^^^^^ +Contents +-------- + + - uIP Applications + - Other Network Applications + - Tips for Using Telnetd + - Tips for Using DHCPC + +uIP Applications +^^^^^^^^^^^^^^^^ + This directory contains most of the network applications contained under the uIP-1.0 apps directory. As the uIP apps/README says, these applications "are not all heavily tested." These uIP apps include: - dhcpc - Dynamic Host Configuration Protocol (DHCP) client - resolv - uIP DNS resolver - smtp - Simple Mail Transfer Protocol (SMTP) client - webclient - HTTP web client - webserver - HTTP web server + dhcpc - Dynamic Host Configuration Protocol (DHCP) client. See + apps/include/netutils/dhcpc.h for interface information. + resolv - uIP DNS resolver. See apps/include/netutils/resolv.h + for interface information. + smtp - Simple Mail Transfer Protocol (SMTP) client. See + apps/include/netutils/smtp.h for interface information. + webclient - HTTP web client. See apps/include/netutils/webclient.h + for interface information. + webserver - HTTP web server. See apps/include/netutils/httpd.h + for interface information. You may find additional information on these apps in the uIP forum accessible through: http://www.sics.se/~adam/uip/index.php/Main_Page +Other Network Applications +^^^^^^^^^^^^^^^^^^^^^^^^^^ + Additional applications that were not part of uIP (but which are highly influenced by uIP) include: - dhcpd - Dynamic Host Configuration Protocol (DHCP) server - tftpc - TFTP client + dhcpd - Dynamic Host Configuration Protocol (DHCP) server. See + apps/include/netutils/dhcpd.h for interface information. + tftpc - TFTP client. See apps/include/netutils/tftp.h + for interface information. telnetd - TELNET server. This is the Telnet logic adapted from uIP and generalized for use as the front end to any shell. The telnet daemon creates sessions that are "wrapped" as character devices and mapped to stdin, stdout, and stderr. Now the telnet session can be inherited by spawned tasks. - ftpc - FTP client + ftpc - FTP client. See apps/include/ftpc.h for interface + information. thttpd - This is a port of Jef Poskanzer's THTTPD HTPPD server. - See http://acme.com/software/thttpd/. + See http://acme.com/software/thttpd/ for general THTTPD + information. See apps/include/netutils/thttpd.h + for interface information. Applications using this thttpd + will need to provide an appconfig file in the configuration + directory with instruction to build applications like: + + CONFIGURED_APPS += uiplib + CONFIGURED_APPS += thttpd + +Tips for Using Telnetd +^^^^^^^^^^^^^^^^^^^^^^ + +Telnetd is set up to be the front end for a shell. The primary use of +Telnetd in NuttX is to support the NuttShell (NSH) Telnet front end. See +apps/include/netutils/telnetd.h for information about how to incorporate +Telnetd into your custom applications. + +To enable and link the Telnetd daemon, you need to include the following in +in your appconfig (apps/.config) file: + + CONFIGURED_APPS += uiplib + CONFIGURED_APPS += netutils/telnetd + +Also if the Telnet console is enabled, make sure that you have the following +set in the NuttX configuration file or else the performance will be very bad +(because there will be only one character per TCP transfer): + + CONFIG_STDIO_BUFFER_SIZE Some value >= 64 + CONFIG_STDIO_LINEBUFFER=y Since Telnetd is line oriented, line buffering + is optimal. + +Tips for Using DHCPC +^^^^^^^^^^^^^^^^^^^^ If you use DHCPC/D, then some special configuration network options are required. These include: @@ -43,3 +97,4 @@ required. These include: CONFIG_NET_BUFSIZE=650 The client must be prepared to receive (or larger) DHCP messages of up to 576 bytes (excluding Ethernet, IP, or UDP headers and FCS). + diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index bd73f2899d..6afd07c8c6 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -2431,3 +2431,7 @@ was renamed readline() and moved to apps/system/readline. The version of fgets() in lib/stdio was them simplified and stripped down so that it *only* gets a string -- as its description implies. + * arch/arm/src/lpc214x/lpc214x_usbdev.c: Add corrections suggested by + David Hewson many, many months ago. + * configs/mcu123-lpc214x/composite and configs/mcu123-lpc214x/src/up_composite.c: + Add a configuration to test the USB composite device. diff --git a/nuttx/TODO b/nuttx/TODO index 1bf1437295..7fdaf377a9 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -27,7 +27,7 @@ nuttx/ (3) ARM/DM320 (arch/arm/src/dm320/) (2) ARM/i.MX (arch/arm/src/imx/) (3) ARM/LPC17xx (arch/arm/src/lpc17xx/) - (7) ARM/LPC214x (arch/arm/src/lpc214x/) + (6) ARM/LPC214x (arch/arm/src/lpc214x/) (2) ARM/LPC313x (arch/arm/src/lpc313x/) (3) ARM/STR71x (arch/arm/src/str71x/) (3) ARM/LM3S6918 (arch/arm/src/lm3s/) @@ -1011,15 +1011,6 @@ o ARM/LPC214x (arch/arm/src/lpc214x/) Status: Open Priority: Uncertain - Title: USB DEVICE DRIVER ISSUES? - Description: Possible errors in USB device driver reported "I suspect there's a few - issues in the lpc214x USB driver - in particular it doesn't stall both - in/out endpoints for unsupported setup requests and it doesn't call - CLASS_DISCONNCET on a USB reset - I don't have any access to that hardware - so can't pursue it really." - Status: Open - Priority: Medium - o ARM/LPC313x (arch/arm/src/lpc313x/) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c index 1c2b315489..a74ac70385 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -1,8 +1,8 @@ /******************************************************************************* * arch/arm/src/lpc214x/lpc214x_usbdev.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1393,6 +1393,8 @@ static inline void lpc214x_dmareset(uint32_t enable) static void lpc214x_usbreset(struct lpc214x_usbdev_s *priv) { + int epphy; + /* Disable all endpoint interrupts */ lpc214x_putreg(0, LPC214X_USBDEV_EPINTEN); @@ -1410,6 +1412,28 @@ static void lpc214x_usbreset(struct lpc214x_usbdev_s *priv) priv->paddrset = 0; + /* Reset endpoints */ + + for (epphy = 0; epphy < LPC214X_NPHYSENDPOINTS; epphy++) + { + struct lpc214x_ep_s *privep = &priv->eplist[epphy]; + + lpc214x_cancelrequests(privep); + + /* Reset endpoint status */ + + privep->stalled = false; + } + + /* Tell the class driver that we are disconnected. The class + * driver should then accept any new configurations. + */ + + if (priv->driver) + { + CLASS_DISCONNECT(priv->driver, &priv->usbdev); + } + /* Endpoints not yet configured */ lpc214x_usbcmd(CMD_USB_DEV_CONFIG, 0); @@ -1418,13 +1442,12 @@ static void lpc214x_usbreset(struct lpc214x_usbdev_s *priv) lpc214x_ep0configure(priv); -#ifdef CONFIG_LPC214X_USBDEV_DMA /* Enable End_of_Transfer_Interrupt and System_Error_Interrupt USB DMA * interrupts */ +#ifdef CONFIG_LPC214X_USBDEV_DMA lpc214x_dmareset(CONFIG_LPC214X_USBDEV_DMAINTMASK); - #endif /* Enable Device interrupts */ @@ -1839,7 +1862,9 @@ static inline void lpc214x_ep0setup(struct lpc214x_usbdev_s *priv) if (priv->stalled) { usbtrace(TRACE_DEVERROR(LPC214X_TRACEERR_EP0SETUPSTALLED), priv->ep0state); + ep0 = &priv->eplist[LPC214X_EP0_OUT]; lpc214x_epstall(&ep0->ep, false); + ep0 = &priv->eplist[LPC214X_EP0_IN]; lpc214x_epstall(&ep0->ep, false); } } @@ -1903,6 +1928,7 @@ static inline void lpc214x_ep0dataoutinterrupt(struct lpc214x_usbdev_s *priv) usbtrace(TRACE_DEVERROR(LPC214X_TRACEERR_EP0OUTSTALLED), priv->ep0state); ep0 = &priv->eplist[LPC214X_EP0_OUT]; lpc214x_epstall(&ep0->ep, false); + ep0 = &priv->eplist[LPC214X_EP0_IN]; lpc214x_epstall(&ep0->ep, false); } return; @@ -1968,8 +1994,9 @@ static inline void lpc214x_ep0dataininterrupt(struct lpc214x_usbdev_s *priv) if (priv->stalled) { usbtrace(TRACE_DEVERROR(LPC214X_TRACEERR_EP0INSTALLED), priv->ep0state); - ep0 = &priv->eplist[LPC214X_EP0_IN]; + ep0 = &priv->eplist[LPC214X_EP0_OUT]; lpc214x_epstall(&ep0->ep, false); + ep0 = &priv->eplist[LPC214X_EP0_IN]; lpc214x_epstall(&ep0->ep, false); } } diff --git a/nuttx/configs/mcu123-lpc214x/README.txt b/nuttx/configs/mcu123-lpc214x/README.txt index b7634aba89..b2f8dd2f91 100644 --- a/nuttx/configs/mcu123-lpc214x/README.txt +++ b/nuttx/configs/mcu123-lpc214x/README.txt @@ -137,10 +137,9 @@ Here are the detailed steps I use: changed from high to low, the LPC214x will enter ISP (In System Programming) state. -3. start lpc21isp.sh - -4. reset the board +3. Start lpc21isp.sh +4. Reset the board ARM/LPC214X-specific Configuration Options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/configs/mcu123-lpc214x/composite/Make.defs b/nuttx/configs/mcu123-lpc214x/composite/Make.defs new file mode 100644 index 0000000000..d6dfa38075 --- /dev/null +++ b/nuttx/configs/mcu123-lpc214x/composite/Make.defs @@ -0,0 +1,160 @@ +############################################################################## +# configs/mcu123-lpc214x/composite/Make.defs +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 + +# The default value for CROSSDEV can be overridden from the make command line: +# make -- Will build for the NuttX buildroot toolchain +# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain +# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain +# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain + +CROSSDEV = arm-elf- +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 + +HOSTOS = ${shell uname -o 2>/dev/null || echo "Other"} + +ARCHCCVERSION = ${shell $(CC) -v 2>&1 | sed -n '/^gcc version/p' | sed -e 's/^gcc version \([0-9\.]\)/\1/g' -e 's/[-\ ].*//g' -e '1q'} +ARCHCCMAJOR = ${shell echo $(ARCHCCVERSION) | cut -d'.' -f1} + +ifeq ($(ARCHCCMAJOR),4) +ifneq ($(HOSTOS),Cygwin) +OBJCOPYARGS = -R .note -R .note.gnu.build-id -R .comment +endif +endif + +ifeq ($(CROSSDEV),arm-elf-) + MKDEP = $(TOPDIR)/tools/mkdeps.sh + ARCHINCLUDES = -I. -isystem $(TOPDIR)/include + ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx + ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/composite/ld.script + MAXOPTIMIZATION = -Os +else + WINTOOL = y + DIRLINK = $(TOPDIR)/tools/winlink.sh + DIRUNLINK = $(TOPDIR)/tools/unlink.sh + MKDEP = $(TOPDIR)/tools/mknulldeps.sh + ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" + ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}" + ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/composite/ld.script}" + MAXOPTIMIZATION = -O2 +endif + +ifeq ("${CONFIG_DEBUG_SYMBOLS}","y") + ARCHOPTIMIZATION = -g +else + ARCHOPTIMIZATION = $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer +endif + +ifeq ($(ARCHCCMAJOR),4) + ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft +else + ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float +endif + +ARCHCFLAGS = -fno-builtin +ARCHCXXFLAGS = -fno-builtin -fno-exceptions +ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 +ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow +ARCHWARNINGSXX = -Wall -Wshadow +ARCHDEFINES = + +CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) +CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ + $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +AFLAGS = $(CFLAGS) -D__ASSEMBLY__ + +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) \ + -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld \ + -no-check-sections +LDNXFLATFLAGS = -e main -s 2048 + +OBJEXT = .o +LIBEXT = .a +EXEEXT = + +ifneq ($(CROSSDEV),arm-elf-) + LDFLAGS += -nostartfiles -nodefaultlibs +endif +ifeq ($(CONFIG_DEBUG_SYMBOLS),y) + LDFLAGS += -g +endif + +define PREPROCESS + @echo "CPP: $1->$2" + @$(CPP) $(CPPFLAGS) $1 -o $2 +endef + +define COMPILE + @echo "CC: $1" + @$(CC) -c $(CFLAGS) $1 -o $2 +endef + +define COMPILEXX + @echo "CXX: $1" + @$(CXX) -c $(CXXFLAGS) $1 -o $2 +endef + +define ASSEMBLE + @echo "AS: $1" + @$(CC) -c $(AFLAGS) $1 -o $2 +endef + +define ARCHIVE + echo "AR: $2"; \ + $(AR) $1 $2 || { echo "$(AR) $1 $2 FAILED!" ; exit 1 ; } +endef + +define CLEAN + @rm -f *.o *.a +endef + +HOSTCC = gcc +HOSTINCLUDES = -I. +HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe +HOSTLDFLAGS = + diff --git a/nuttx/configs/mcu123-lpc214x/composite/appconfig b/nuttx/configs/mcu123-lpc214x/composite/appconfig new file mode 100644 index 0000000000..47d5346369 --- /dev/null +++ b/nuttx/configs/mcu123-lpc214x/composite/appconfig @@ -0,0 +1,39 @@ +############################################################################ +# configs/mcu123-lpc214x/composite/appconfig +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ + +# Path to example in apps/examples containing the user_start entry point + +CONFIGURED_APPS += examples/composite + diff --git a/nuttx/configs/mcu123-lpc214x/composite/defconfig b/nuttx/configs/mcu123-lpc214x/composite/defconfig new file mode 100644 index 0000000000..b08f203085 --- /dev/null +++ b/nuttx/configs/mcu123-lpc214x/composite/defconfig @@ -0,0 +1,890 @@ +############################################################################ +# configs/mcu123-lpc214x/composite/defconfig +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# +############################################################################ +# +# Architecture selection +# +# CONFIG_ARCH - identifies the arch subdirectory and, hence, the +# processor architecture. +# CONFIG_ARCH_family - for use in C code. This identifies the +# particular chip family that the architecture is implemented +# in. +# CONFIG_ARCH_architecture - for use in C code. This identifies the +# specific architecture within the chip familyl. +# CONFIG_ARCH_CHIP - Identifies the arch/*/chip subdirectory +# CONFIG_ARCH_CHIP_name - For use in C code +# CONFIG_ARCH_BOARD - identifies the configs subdirectory and, hence, +# the board that supports the particular chip or SoC. +# CONFIG_ENDIAN_BIG - define if big endian (default is little endian) +# CONFIG_ARCH_BOARD_name - for use in C code +# CONFIG_BOARD_LOOPSPERMSEC - for delay loops +# CONFIG_ARCH_LEDS - Use LEDs to show state. Unique to lpc2148. +# CONFIG_DRAM_SIZE - Describes the internal DRAM. +# CONFIG_DRAM_START - The start address of internal DRAM +# CONFIG_ARCH_INTERRUPTSTACK - This architecture supports an interrupt +# stack. If defined, this symbol is the size of the interrupt +# stack in bytes. If not defined, the user task stacks will be +# used during interrupt handling. +# CONFIG_ARCH_STACKDUMP - Do stack dumps after assertions +# +CONFIG_ARCH=arm +CONFIG_ARCH_ARM=y +CONFIG_ARCH_ARM7TDMI=y +CONFIG_ARCH_CHIP=lpc214x +CONFIG_ARCH_LPC2148=y +CONFIG_ARCH_BOARD=mcu123-lpc214x +CONFIG_ARCH_BOARD_MCU123=y +CONFIG_BOARD_LOOPSPERMSEC=3270 +CONFIG_ARCH_LEDS=y +CONFIG_DRAM_SIZE=0x00008000 +CONFIG_DRAM_START=0x40000000 +CONFIG_DRAM_END=(CONFIG_DRAM_START+CONFIG_DRAM_SIZE) +CONFIG_ARCH_INTERRUPTSTACK=1024 +CONFIG_ARCH_STACKDUMP=y + +# +# LPC2148 specific chip initialization +# +CONFIG_EXTMEM_MODE=n +CONFIG_RAM_MODE=n +CONFIG_CODE_BASE=0x00000000 +CONFIG_PLL_SETUP=y +CONFIG_MAM_SETUP=y +CONFIG_APBDIV_SETUP=y +CONFIG_EMC_SETUP=n +CONFIG_BCFG0_SETUP=n +CONFIG_BCFG1_SETUP=n +CONFIG_BCFG2_SETUP=n +CONFIG_BCFG3_SETUP=n +CONFIG_ADC_SETUP=y + +# +# LPC214X specific device driver settings +# +# CONFIG_UARTn_SERIAL_CONSOLE - selects the UARTn for the +# console and ttys0 (default is the UART0). +# CONFIG_UARTn_RXBUFSIZE - Characters are buffered as received. +# This specific the size of the receive buffer +# CONFIG_UARTn_TXBUFSIZE - Characters are buffered before +# being sent. This specific the size of the transmit buffer +# CONFIG_UARTn_BAUD - The configure BAUD of the UART. Must be +# CONFIG_UARTn_BITS - The number of bits. Must be either 7 or 8. +# CONFIG_UARTn_PARTIY - 0=no parity, 1=odd parity, 2=even parity, 3=mark 1, 4=space 0 +# CONFIG_UARTn_2STOP - Two stop bits +# +CONFIG_UART0_SERIAL_CONSOLE=y +CONFIG_UART1_SERIAL_CONSOLE=n +CONFIG_UART0_TXBUFSIZE=256 +CONFIG_UART1_TXBUFSIZE=256 +CONFIG_UART0_RXBUFSIZE=256 +CONFIG_UART1_RXBUFSIZE=256 +CONFIG_UART0_BAUD=38400 +CONFIG_UART1_BAUD=38400 +CONFIG_UART0_BITS=8 +CONFIG_UART1_BITS=8 +CONFIG_UART0_PARITY=0 +CONFIG_UART1_PARITY=0 +CONFIG_UART0_2STOP=0 +CONFIG_UART1_2STOP=0 + +# +# General build options +# +# CONFIG_RRLOAD_BINARY - make the rrload binary format used with +# BSPs from www.ridgerun.com using the tools/mkimage.sh script +# CONFIG_INTELHEX_BINARY - make the Intel HEX binary format +# used with many different loaders using the GNU objcopy program +# Should not be selected if you are not using the GNU toolchain. +# CONFIG_RAW_BINARY - make a raw binary format file used with many +# different loaders using the GNU objcopy program. This option +# should not be selected if you are not using the GNU toolchain. +# CONFIG_HAVE_LIBM - toolchain supports libm.a +# +CONFIG_RRLOAD_BINARY=n +CONFIG_INTELHEX_BINARY=n +CONFIG_RAW_BINARY=y +CONFIG_HAVE_LIBM=n + +# +# General OS setup +# +# CONFIG_APPS_DIR - Identifies the relative path to the directory +# that builds the application to link with NuttX. Default: ../apps +# CONFIG_DEBUG - enables built-in debug options +# CONFIG_DEBUG_VERBOSE - enables verbose debug output +# CONFIG_DEBUG_SYMBOLS - build without optimization and with +# debug symbols (needed for use with a debugger). +# CONFIG_MM_REGIONS - If the architecture includes multiple +# regions of memory to allocate from, this specifies the +# number of memory regions that the memory manager must +# handle and enables the API mm_addregion(start, end); +# CONFIG_ARCH_LOWPUTC - architecture supports low-level, boot +# time console output +# CONFIG_MSEC_PER_TICK - The default system timer is 100Hz +# or MSEC_PER_TICK=10. This setting may be defined to +# inform NuttX that the processor hardware is providing +# system timer interrupts at some interrupt interval other +# than 10 msec. +# CONFIG_RR_INTERVAL - The round robin timeslice will be set +# this number of milliseconds; Round robin scheduling can +# be disabled by setting this value to zero. +# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in +# scheduler to monitor system performance +# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a +# task name to save in the TCB. Useful if scheduler +# instrumentation is selected. Set to zero to disable. +# CONFIG_START_YEAR, CONFIG_START_MONTH, CONFIG_START_DAY - +# Used to initialize the internal time logic. +# CONFIG_JULIAN_TIME - Enables Julian time conversions +# CONFIG_DEV_CONSOLE - Set if architecture-specific logic +# provides /dev/console. Enables stdout, stderr, stdin. +# CONFIG_DEV_LOWCONSOLE - Use the simple, low-level serial console +# driver (minimul support) +# CONFIG_MUTEX_TYPES: Set to enable support for recursive and +# errorcheck mutexes. Enables pthread_mutexattr_settype(). +# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority +# inheritance on mutexes and semaphores. +# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority +# inheritance is enabled. It defines the maximum number of +# different threads (minus one) that can take counts on a +# semaphore with priority inheritance support. This may be +# set to zero if priority inheritance is disabled OR if you +# are only using semaphores as mutexes (only one holder) OR +# if no more than two threads participate using a counting +# semaphore. +# CONFIG_SEM_NNESTPRIO. If priority inheritance is enabled, +# then this setting is the maximum number of higher priority +# threads (minus 1) than can be waiting for another thread +# to release a count on a semaphore. This value may be set +# to zero if no more than one thread is expected to wait for +# a semaphore. +# CONFIG_FDCLONE_DISABLE. Disable cloning of all file descriptors +# by task_create() when a new task is started. If set, all +# files/drivers will appear to be closed in the new task. +# CONFIG_FDCLONE_STDIO. Disable cloning of all but the first +# three file descriptors (stdin, stdout, stderr) by task_create() +# when a new task is started. If set, all files/drivers will +# appear to be closed in the new task except for stdin, stdout, +# and stderr. +# CONFIG_SDCLONE_DISABLE. Disable cloning of all socket +# desciptors by task_create() when a new task is started. If +# set, all sockets will appear to be closed in the new task. +# CONFIG_NXFLAT. Enable support for the NXFLAT binary format. +# This format will support execution of NuttX binaries located +# in a ROMFS filesystem (see examples/nxflat). +# +#CONFIG_APPS_DIR= +CONFIG_DEBUG=n +CONFIG_DEBUG_VERBOSE=n +CONFIG_DEBUG_SYMBOLS=n +CONFIG_DEBUG_USB=n +CONFIG_MM_REGIONS=1 +CONFIG_ARCH_LOWPUTC=y +CONFIG_RR_INTERVAL=0 +CONFIG_SCHED_INSTRUMENTATION=n +CONFIG_TASK_NAME_SIZE=0 +CONFIG_START_YEAR=2008 +CONFIG_START_MONTH=10 +CONFIG_START_DAY=1 +CONFIG_JULIAN_TIME=n +CONFIG_DEV_CONSOLE=y +CONFIG_DEV_LOWCONSOLE=n +CONFIG_MUTEX_TYPES=n +CONFIG_PRIORITY_INHERITANCE=n +CONFIG_SEM_PREALLOCHOLDERS=0 +CONFIG_SEM_NNESTPRIO=0 +CONFIG_FDCLONE_DISABLE=n +CONFIG_FDCLONE_STDIO=n +CONFIG_SDCLONE_DISABLE=y +CONFIG_NXFLAT=n + +# +# The following can be used to disable categories of +# APIs supported by the OS. If the compiler supports +# weak functions, then it should not be necessary to +# disable functions unless you want to restrict usage +# of those APIs. +# +# There are certain dependency relationships in these +# features. +# +# o mq_notify logic depends on signals to awaken tasks +# waiting for queues to become full or empty. +# o pthread_condtimedwait() depends on signals to wake +# up waiting tasks. +# +CONFIG_DISABLE_CLOCK=n +CONFIG_DISABLE_POSIX_TIMERS=n +CONFIG_DISABLE_PTHREAD=n +CONFIG_DISABLE_SIGNALS=n +CONFIG_DISABLE_MQUEUE=n +CONFIG_DISABLE_MOUNTPOINT=y +CONFIG_DISABLE_ENVIRON=n +CONFIG_DISABLE_POLL=y + +# +# Misc libc settings +# +# CONFIG_NOPRINTF_FIELDWIDTH - sprintf-related logic is a +# little smaller if we do not support fieldwidthes +# +CONFIG_NOPRINTF_FIELDWIDTH=n + +# +# Allow for architecture optimized implementations +# +# The architecture can provide optimized versions of the +# following to improve system performance +# +CONFIG_ARCH_MEMCPY=n +CONFIG_ARCH_MEMCMP=n +CONFIG_ARCH_MEMMOVE=n +CONFIG_ARCH_MEMSET=n +CONFIG_ARCH_STRCMP=n +CONFIG_ARCH_STRCPY=n +CONFIG_ARCH_STRNCPY=n +CONFIG_ARCH_STRLEN=n +CONFIG_ARCH_STRNLEN=n +CONFIG_ARCH_BZERO=n + +# +# Sizes of configurable things (0 disables) +# +# CONFIG_MAX_TASKS - The maximum number of simultaneously +# active tasks. This value must be a power of two. +# CONFIG_MAX_TASK_ARGS - This controls the maximum number of +# of parameters that a task may receive (i.e., maxmum value +# of 'argc') +# CONFIG_NPTHREAD_KEYS - The number of items of thread- +# specific data that can be retained +# CONFIG_NFILE_DESCRIPTORS - The maximum number of file +# descriptors (one for each open) +# CONFIG_NFILE_STREAMS - The maximum number of streams that +# can be fopen'ed +# CONFIG_NAME_MAX - The maximum size of a file name. +# CONFIG_STDIO_BUFFER_SIZE - Size of the buffer to allocate +# on fopen. (Only if CONFIG_NFILE_STREAMS > 0) +# CONFIG_NUNGET_CHARS - Number of characters that can be +# buffered by ungetc() (Only if CONFIG_NFILE_STREAMS > 0) +# CONFIG_PREALLOC_MQ_MSGS - The number of pre-allocated message +# structures. The system manages a pool of preallocated +# message structures to minimize dynamic allocations +# CONFIG_MQ_MAXMSGSIZE - Message structures are allocated with +# a fixed payload size given by this settin (does not include +# other message structure overhead. +# CONFIG_MAX_WDOGPARMS - Maximum number of parameters that +# can be passed to a watchdog handler +# CONFIG_PREALLOC_WDOGS - The number of pre-allocated watchdog +# structures. The system manages a pool of preallocated +# watchdog structures to minimize dynamic allocations +# CONFIG_PREALLOC_TIMERS - The number of pre-allocated POSIX +# timer structures. The system manages a pool of preallocated +# timer structures to minimize dynamic allocations. Set to +# zero for all dynamic allocations. +# +CONFIG_MAX_TASKS=16 +CONFIG_MAX_TASK_ARGS=4 +CONFIG_NPTHREAD_KEYS=4 +CONFIG_NFILE_DESCRIPTORS=8 +CONFIG_NFILE_STREAMS=8 +CONFIG_NAME_MAX=32 +CONFIG_STDIO_BUFFER_SIZE=256 +CONFIG_NUNGET_CHARS=2 +CONFIG_PREALLOC_MQ_MSGS=4 +CONFIG_MQ_MAXMSGSIZE=32 +CONFIG_MAX_WDOGPARMS=2 +CONFIG_PREALLOC_WDOGS=4 +CONFIG_PREALLOC_TIMERS=4 + +# +# Filesystem configuration +# +# CONFIG_FS_FAT - Enable FAT filesystem support +# CONFIG_FAT_SECTORSIZE - Max supported sector size +# CONFIG_FS_ROMFS - Enable ROMFS filesystem support +CONFIG_FS_FAT=n +CONFIG_FS_ROMFS=n + +# +# SPI-based MMC/SD driver +# +# CONFIG_MMCSD_NSLOTS +# Number of MMC/SD slots supported by the driver +# CONFIG_MMCSD_READONLY +# Provide read-only access (default is read/write) +# CONFIG_MMCSD_SPICLOCK - Maximum SPI clock to drive MMC/SD card. +# Default is 20MHz. +# +CONFIG_MMCSD_NSLOTS=1 +CONFIG_MMCSD_READONLY=n +#CONFIG_MMCSD_SPICLOCK=20000000 + +# +# TCP/IP and UDP support via uIP +# CONFIG_NET - Enable or disable all network features +# CONFIG_NET_IPv6 - Build in support for IPv6 +# CONFIG_NSOCKET_DESCRIPTORS - Maximum number of socket descriptors per task/thread. +# CONFIG_NET_SOCKOPTS - Enable or disable support for socket options +# CONFIG_NET_BUFSIZE - uIP buffer size +# CONFIG_NET_TCP - TCP support on or off +# CONFIG_NET_TCP_CONNS - Maximum number of TCP connections (all tasks) +# CONFIG_NET_TCP_READAHEAD_BUFSIZE - Size of TCP read-ahead buffers +# CONFIG_NET_NTCP_READAHEAD_BUFFERS - Number of TCP read-ahead buffers (may be zero) +# CONFIG_NET_TCPBACKLOG - Incoming connections pend in a backlog until +# accept() is called. The size of the backlog is selected when listen() is called. +# CONFIG_NET_MAX_LISTENPORTS - Maximum number of listening TCP ports (all tasks) +# CONFIG_NET_UDP - UDP support on or off +# CONFIG_NET_UDP_CHECKSUMS - UDP checksums on or off +# CONFIG_NET_UDP_CONNS - The maximum amount of concurrent UDP connections +# CONFIG_NET_ICMP - ICMP ping response support on or off +# CONFIG_NET_ICMP_PING - ICMP ping request support on or off +# CONFIG_NET_PINGADDRCONF - Use "ping" packet for setting IP address +# CONFIG_NET_STATISTICS - uIP statistics on or off +# CONFIG_NET_RECEIVE_WINDOW - The size of the advertised receiver's window +# CONFIG_NET_ARPTAB_SIZE - The size of the ARP table +# CONFIG_NET_BROADCAST - Broadcast support +# CONFIG_NET_FWCACHE_SIZE - number of packets to remember when looking for duplicates +# +CONFIG_NET=n +CONFIG_NET_IPv6=n +CONFIG_NSOCKET_DESCRIPTORS=0 +CONFIG_NET_SOCKOPTS=y +CONFIG_NET_BUFSIZE=420 +CONFIG_NET_TCP=n +CONFIG_NET_TCP_CONNS=40 +CONFIG_NET_MAX_LISTENPORTS=40 +CONFIG_NET_UDP=n +CONFIG_NET_UDP_CHECKSUMS=y +#CONFIG_NET_UDP_CONNS=10 +CONFIG_NET_ICMP=n +CONFIG_NET_ICMP_PING=n +#CONFIG_NET_PINGADDRCONF=0 +CONFIG_NET_STATISTICS=y +#CONFIG_NET_RECEIVE_WINDOW= +#CONFIG_NET_ARPTAB_SIZE=8 +CONFIG_NET_BROADCAST=n +#CONFIG_NET_FWCACHE_SIZE=2 + +# +# UIP Network Utilities +# CONFIG_NET_DHCP_LIGHT - Reduces size of DHCP +# CONFIG_NET_RESOLV_ENTRIES - Number of resolver entries +CONFIG_NET_DHCP_LIGHT=n +CONFIG_NET_RESOLV_ENTRIES=4 + +# +# USB Device Configuration +# +# CONFIG_USBDEV +# Enables USB device support +# CONFIG_USBDEV_ISOCHRONOUS +# Build in extra support for isochronous endpoints +# CONFIG_USBDEV_DUALSPEED +# Hardware handles high and full speed operation (USB 2.0) +# CONFIG_USBDEV_SELFPOWERED +# Will cause USB features to indicate that the device is +# self-powered +# CONFIG_USBDEV_MAXPOWER +# Maximum power consumption in mA +# CONFIG_USBDEV_TRACE +# Enables USB tracing for debug +# CONFIG_USBDEV_TRACE_NRECORDS +# Number of trace entries to remember +CONFIG_USBDEV=y +CONFIG_USBDEV_ISOCHRONOUS=n +CONFIG_USBDEV_DUALSPEED=n +CONFIG_USBDEV_SELFPOWERED=y +CONFIG_USBDEV_REMOTEWAKEUP=n +CONFIG_USBDEV_MAXPOWER=100 +CONFIG_USBDEV_TRACE=y +CONFIG_USBDEV_TRACE_NRECORDS=128 + +# +# LPC214X USB Configuration +# +# CONFIG_LPC214X_USBDEV_FRAME_INTERRUPT +# Handle USB Start-Of-Frame events. +# Enable reading SOF from interrupt handler vs. simply reading on demand. +# Probably a bad idea... Unless there is some issue with sampling the SOF +# from hardware asynchronously. +# CONFIG_LPC214X_USBDEV_EPFAST_INTERRUPT +# Enable high priority interrupts. I have no idea why you might want to +# do that +# CONFIG_LPC214X_USBDEV_NDMADESCRIPTORS +# Number of DMA descriptors to allocate in the 8Kb USB RAM. This is a +# tradeoff between the number of DMA channels that can be supported vs +# the size of the DMA buffers available. +# CONFIG_LPC214X_USBDEV_DMA +# Enable lpc214x-specific DMA support +CONFIG_LPC214X_USBDEV_FRAME_INTERRUPT=n +CONFIG_LPC214X_USBDEV_EPFAST_INTERRUPT=n +CONFIG_LPC214X_USBDEV_DMA=n +CONFIG_LPC214X_USBDEV_NDMADESCRIPTORS=0 +CONFIG_LPC214X_USBDEV_DMAINTMASK=0 + +# +# USB Serial Device Configuration +# +# CONFIG_PL2303 +# Enable compilation of the USB serial driver +# CONFIG_PL2303_EPINTIN +# The logical 7-bit address of a hardware endpoint that supports +# interrupt IN operation +# CONFIG_PL2303_EPBULKOUT +# The logical 7-bit address of a hardware endpoint that supports +# bulk OUT operation +# CONFIG_PL2303_EPBULKIN +# The logical 7-bit address of a hardware endpoint that supports +# bulk IN operation +# CONFIG_PL2303_NWRREQS and CONFIG_PL2303_NRDREQS +# The number of write/read requests that can be in flight +# CONFIG_PL2303_VENDORID and CONFIG_PL2303_VENDORSTR +# The vendor ID code/string +# CONFIG_PL2303_PRODUCTID and CONFIG_PL2303_PRODUCTSTR +# The product ID code/string +# CONFIG_PL2303_RXBUFSIZE and CONFIG_PL2303_TXBUFSIZE +# Size of the serial receive/transmit buffers +CONFIG_PL2303=n +CONFIG_PL2303_EPINTIN=1 +CONFIG_PL2303_EPBULKOUT=2 +CONFIG_PL2303_EPBULKIN=5 +CONFIG_PL2303_NWRREQS=4 +CONFIG_PL2303_NRDREQS=4 +CONFIG_PL2303_VENDORID=0x067b +CONFIG_PL2303_PRODUCTID=0x2303 +CONFIG_PL2303_VENDORSTR="Nuttx" +CONFIG_PL2303_PRODUCTSTR="USBdev Serial" +CONFIG_PL2303_RXBUFSIZE=512 +CONFIG_PL2303_TXBUFSIZE=512 + +# +# USB Storage Device Configuration +# +# CONFIG_USBMSC +# Enable compilation of the USB storage driver +# CONFIG_USBMSC_COMPOSITE +# Configure the mass storage driver as part of a composite driver +# (only if CONFIG_USBDEV_COMPOSITE is also defined) +# CONFIG_USBMSC_IFNOBASE +# If the CDC driver is part of a composite device, then this may need to +# be defined to offset the mass storage interface number so that it is +# unique and contiguous. When used with the CDC/ACM driver, the +# correct value for this offset is two (because of the two CDC/ACM +# interfaces that will precede it). +# CONFIG_USBMSC_STRBASE +# If the CDC driver is part of a composite device, then this may need to +# be defined to offset the mass storage string numbers so that they are +# unique and contiguous. When used with the CDC/ACM driver, the +# correct value for this offset is four (or perhaps 5 or 6, depending +# on if CONFIG_CDCACM_NOTIFSTR or CONFIG_CDCACM_DATAIFSTR are defined). +# CONFIG_USBMSC_EP0MAXPACKET +# Max packet size for endpoint 0 +# CONFIG_PL2303_EPBULKOUT and CONFIG_PL2303_EPBULKIN +# The logical 7-bit address of a hardware endpoints that support +# bulk OUT and IN operations +# CONFIG_PL2303_NWRREQS and CONFIG_PL2303_NRDREQS +# The number of write/read requests that can be in flight +# CONFIG_USBMSC_BULKINREQLEN and CONFIG_USBMSC_BULKOUTREQLEN +# The size of the buffer in each write/read request. This +# value needs to be at least as large as the endpoint +# maxpacket and ideally as large as a block device sector. +# CONFIG_PL2303_VENDORID and CONFIG_PL2303_VENDORSTR +# The vendor ID code/string +# CONFIG_PL2303_PRODUCTID and CONFIG_PL2303_PRODUCTSTR +# The product ID code/string +# CONFIG_USBMSC_REMOVABLE +# Select if the media is removable +# +CONFIG_USBMSC=y +CONFIG_USBMSC_COMPOSITE=y +CONFIG_USBMSC_IFNOBASE=2 +CONFIG_USBMSC_STRBASE=4 +CONFIG_USBMSC_EP0MAXPACKET=64 +CONFIG_USBMSC_EPBULKOUT=4 +CONFIG_USBMSC_EPBULKIN=5 +CONFIG_USBMSC_NRDREQS=2 +CONFIG_USBMSC_NWRREQS=2 +CONFIG_USBMSC_BULKINREQLEN=256 +CONFIG_USBMSC_BULKOUTREQLEN=256 +CONFIG_USBMSC_VENDORID=0x584e +CONFIG_USBMSC_VENDORSTR="NuttX" +CONFIG_USBMSC_PRODUCTID=0x5342 +CONFIG_USBMSC_PRODUCTSTR="USBdev Storage" +CONFIG_USBMSC_VERSIONNO=0x0399 +CONFIG_USBMSC_REMOVABLE=y + +# +# USB serial device class driver (Standard CDC ACM class) +# +# CONFIG_CDCACM +# Enable compilation of the USB serial driver +# CONFIG_CDCACM_COMPOSITE +# Configure the CDC serial driver as part of a composite driver +# (only if CONFIG_USBDEV_COMPOSITE is also defined) +# CONFIG_CDCACM_IFNOBASE +# If the CDC driver is part of a composite device, then this may need to +# be defined to offset the CDC/ACM interface numbers so that they are +# unique and contiguous. When used with the Mass Storage driver, the +# correct value for this offset is zero. +# CONFIG_CDCACM_STRBASE +# If the CDC driver is part of a composite device, then this may need to +# be defined to offset the CDC/ACM string numbers so that they are +# unique and contiguous. When used with the Mass Storage driver, the +# correct value for this offset is four (this value actuallly only needs +# to be defined if names are provided for the Notification interface, +# CONFIG_CDCACM_NOTIFSTR, or the data interface, CONFIG_CDCACM_DATAIFSTR). +# CONFIG_CDCACM_EP0MAXPACKET +# Endpoint 0 max packet size. Default 64 +# CONFIG_CDCACM_EPINTIN +# The logical 7-bit address of a hardware endpoint that supports +# interrupt IN operation. Default 2. +# CONFIG_CDCACM_EPINTIN_FSSIZE +# Max package size for the interrupt IN endpoint if full speed mode. +# Default 64. +# CONFIG_CDCACM_EPINTIN_HSSIZE +# Max package size for the interrupt IN endpoint if high speed mode. +# Default 64 +# CONFIG_CDCACM_EPBULKOUT +# The logical 7-bit address of a hardware endpoint that supports +# bulk OUT operation +# CONFIG_CDCACM_EPBULKOUT_FSSIZE +# Max package size for the bulk OUT endpoint if full speed mode. +# Default 64. +# CONFIG_CDCACM_EPBULKOUT_HSSIZE +# Max package size for the bulk OUT endpoint if high speed mode. +# Default 512. +# CONFIG_CDCACM_EPBULKIN +# The logical 7-bit address of a hardware endpoint that supports +# bulk IN operation +# CONFIG_CDCACM_EPBULKIN_FSSIZE +# Max package size for the bulk IN endpoint if full speed mode. +# Default 64. +# CONFIG_CDCACM_EPBULKIN_HSSIZE +# Max package size for the bulk IN endpoint if high speed mode. +# Default 512. +# CONFIG_CDCACM_NWRREQS and CONFIG_CDCACM_NRDREQS +# The number of write/read requests that can be in flight. +# Default 256. +# CONFIG_CDCACM_VENDORID and CONFIG_CDCACM_VENDORSTR +# The vendor ID code/string. Default 0x0525 and "NuttX" +# 0x0525 is the Netchip vendor and should not be used in any +# products. This default VID was selected for compatibility with +# the Linux CDC ACM default VID. +# CONFIG_CDCACM_PRODUCTID and CONFIG_CDCACM_PRODUCTSTR +# The product ID code/string. Default 0xara7 and "CDC/ACM Serial" +# 0xa4a7 was selected for compatibility with the Linux CDC ACM +# default PID. +# CONFIG_CDCACM_RXBUFSIZE and CONFIG_CDCACM_TXBUFSIZE +# Size of the serial receive/transmit buffers. Default 256. +# +CONFIG_CDCACM=y +CONFIG_CDCACM_COMPOSITE=y +CONFIG_CDCACM_IFNOBASE=0 +CONFIG_CDCACM_STRBASE=4 +#CONFIG_CDCACM_EP0MAXPACKET +CONFIG_CDCACM_EPINTIN=1 +#CONFIG_CDCACM_EPINTIN_FSSIZE +#CONFIG_CDCACM_EPINTIN_HSSIZE +CONFIG_CDCACM_EPBULKOUT=3 +#CONFIG_CDCACM_EPBULKOUT_FSSIZE +#CONFIG_CDCACM_EPBULKOUT_HSSIZE +CONFIG_CDCACM_EPBULKIN=2 +#CONFIG_CDCACM_EPBULKIN_FSSIZE +#CONFIG_CDCACM_EPBULKIN_HSSIZE +#CONFIG_CDCACM_NWRREQS +#CONFIG_CDCACM_NRDREQS +#CONFIG_CDCACM_VENDORID +#CONFIG_CDCACM_VENDORSTR +#CONFIG_CDCACM_PRODUCTID +#CONFIG_CDCACM_PRODUCTSTR +#CONFIG_CDCACM_RXBUFSIZE +#CONFIG_CDCACM_TXBUFSIZE + +# +# USB Composite Device Configuration +# +# CONFIG_USBDEV_COMPOSITE +# Enables USB composite device support +# CONFIG_COMPOSITE_IAD +# If one of the members of the composite has multiple interfaces +# (such as CDC/ACM), then an Interface Association Descriptor (IAD) +# will be necessary. Default: IAD will be used automatically if +# needed. It should not be necessary to set this. +# CONFIG_COMPOSITE_EP0MAXPACKET +# Max packet size for endpoint 0 +# CONFIG_COMPOSITE_VENDORID and CONFIG_COMPOSITE_VENDORSTR +# The vendor ID code/string +# CONFIG_COMPOSITE_PRODUCTID and CONFIG_COMPOSITE_PRODUCTSTR +# The product ID code/string +# CONFIG_COMPOSITE_SERIALSTR +# Device serial number string +# CONFIG_COMPOSITE_CONFIGSTR +# Configuration string +# CONFIG_COMPOSITE_VERSIONNO +# The device version number +# +CONFIG_USBDEV_COMPOSITE=y +CONFIG_COMPOSITE_IAD=y +#CONFIG_COMPOSITE_EP0MAXPACKET +CONFIG_COMPOSITE_VENDORID=0x03eb +CONFIG_COMPOSITE_PRODUCTID=0x2022 +CONFIG_COMPOSITE_VENDORSTR="NuttX" +CONFIG_COMPOSITE_PRODUCTSTR="Composite Device" +CONFIG_COMPOSITE_SERIALSTR="12345" +CONFIG_COMPOSITE_CONFIGSTR="examples/composite" +CONFIG_COMPOSITE_VERSIONNO=0x0101 + +# +# Settings for apps/nshlib +# +# CONFIG_NSH_FILEIOSIZE - Size of a static I/O buffer +# CONFIG_NSH_STRERROR - Use strerror(errno) +# CONFIG_NSH_LINELEN - Maximum length of one command line +# CONFIG_NSH_STACKSIZE - Stack size to use for new threads. +# CONFIG_NSH_NESTDEPTH - Max number of nested if-then[-else]-fi +# CONFIG_NSH_DISABLESCRIPT - Disable scripting support +# CONFIG_NSH_DISABLEBG - Disable background commands +# CONFIG_NSH_ROMFSETC - Use startup script in /etc +# CONFIG_NSH_CONSOLE - Use serial console front end +# CONFIG_NSH_TELNET - Use telnetd console front end +# CONFIG_NSH_ARCHINIT - Platform provides architecture +# specific initialization (nsh_archinitialize()). +# +# If CONFIG_NSH_TELNET is selected: +# CONFIG_NSH_IOBUFFER_SIZE -- Telnetd I/O buffer size +# CONFIG_NSH_DHCPC - Obtain address using DHCP +# CONFIG_NSH_IPADDR - Provides static IP address +# CONFIG_NSH_DRIPADDR - Provides static router IP address +# CONFIG_NSH_NETMASK - Provides static network mask +# CONFIG_NSH_NOMAC - Use a bogus MAC address +# +# If CONFIG_NSH_ROMFSETC is selected: +# CONFIG_NSH_ROMFSMOUNTPT - ROMFS mountpoint +# CONFIG_NSH_INITSCRIPT - Relative path to init script +# CONFIG_NSH_ROMFSDEVNO - ROMFS RAM device minor +# CONFIG_NSH_ROMFSSECTSIZE - ROMF sector size +# CONFIG_NSH_FATDEVNO - FAT FS RAM device minor +# CONFIG_NSH_FATSECTSIZE - FAT FS sector size +# CONFIG_NSH_FATNSECTORS - FAT FS number of sectors +# CONFIG_NSH_FATMOUNTPT - FAT FS mountpoint +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_STRERROR=n +CONFIG_NSH_LINELEN=64 +CONFIG_NSH_STACKSIZE=2048 +CONFIG_NSH_NESTDEPTH=3 +CONFIG_NSH_DISABLESCRIPT=n +CONFIG_NSH_DISABLEBG=n +CONFIG_NSH_ROMFSETC=n +CONFIG_NSH_CONSOLE=y +CONFIG_NSH_TELNET=n +CONFIG_NSH_ARCHINIT=n +CONFIG_NSH_IOBUFFER_SIZE=512 +CONFIG_NSH_DHCPC=n +CONFIG_NSH_NOMAC=n +CONFIG_NSH_IPADDR=(10<<24|0<<16|0<<8|2) +CONFIG_NSH_DRIPADDR=(10<<24|0<<16|0<<8|1) +CONFIG_NSH_NETMASK=(255<<24|255<<16|255<<8|0) +CONFIG_NSH_ROMFSMOUNTPT="/etc" +CONFIG_NSH_INITSCRIPT="init.d/rcS" +CONFIG_NSH_ROMFSDEVNO=0 +CONFIG_NSH_ROMFSSECTSIZE=64 +CONFIG_NSH_FATDEVNO=1 +CONFIG_NSH_FATSECTSIZE=512 +CONFIG_NSH_FATNSECTORS=1024 +CONFIG_NSH_FATMOUNTPT=/tmp + +# +# Architecture-specific NSH options +CONFIG_NSH_MMCSDSPIPORTNO=1 +CONFIG_NSH_MMCSDSLOTNO=0 +CONFIG_NSH_MMCSDMINOR=0 + +# +# Settings for examples/ostest +CONFIG_EXAMPLES_OSTEST_LOOPS=1 +CONFIG_EXAMPLES_OSTEST_STACKSIZE=4096 +CONFIG_EXAMPLES_OSTEST_NBARRIER_THREADS=3 + +# +# Settings for examples/usbserial +# +# CONFIG_EXAMPLES_USBSERIAL_INONLY +# Only verify IN (device-to-host) data transfers. Default: both +# CONFIG_EXAMPLES_USBSERIAL_OUTONLY +# Only verify OUT (host-to-device) data transfers. Default: both +# CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL +# Send only small, single packet messages. Default: Send large and small. +# CONFIG_EXAMPLES_USBSERIAL_ONLYBIG +# Send only large, multi-packet messages. Default: Send large and small. +# +CONFIG_EXAMPLES_USBSERIAL_INONLY=n +CONFIG_EXAMPLES_USBSERIAL_OUTONLY=n +CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL=n +CONFIG_EXAMPLES_USBSERIAL_ONLYBIG=n + +# +# Settings for examples/usbstorage +# +# CONFIG_EXAMPLES_USBMSC_NLUNS +# Defines the number of logical units (LUNs) exported by the USB storage +# driver. Each LUN corresponds to one exported block driver (or partition +# of a block driver). May be 1, 2, or 3. Default is 1. +# CONFIG_EXAMPLES_USBMSC_DEVMINOR1 +# The minor device number of the block driver for the first LUN. For +# example, N in /dev/mmcsdN. Used for registering the block driver. Default +# is zero. +# CONFIG_EXAMPLES_USBMSC_DEVPATH1 +# The full path to the registered block driver. Default is "/dev/mmcsd0" +# CONFIG_EXAMPLES_USBMSC_DEVMINOR2 and CONFIG_EXAMPLES_USBMSC_DEVPATH2 +# Similar parameters that would have to be provided if CONFIG_EXAMPLES_USBMSC_NLUNS +# is 2 or 3. No defaults. +# CONFIG_EXAMPLES_USBMSC_DEVMINOR3 and CONFIG_EXAMPLES_USBMSC_DEVPATH3 +# Similar parameters that would have to be provided if CONFIG_EXAMPLES_USBMSC_NLUNS +# is 3. No defaults. +# +# If CONFIG_USBDEV_TRACE is enabled (or CONFIG_DEBUG and CONFIG_DEBUG_USB), then +# the example code will also manage the USB trace output. The amount of trace output +# can be controlled using: +# +# CONFIG_EXAMPLES_USBMSC_TRACEINIT +# Show initialization events +# CONFIG_EXAMPLES_USBMSC_TRACECLASS +# Show class driver events +# CONFIG_EXAMPLES_USBMSC_TRACETRANSFERS +# Show data transfer events +# CONFIG_EXAMPLES_USBMSC_TRACECONTROLLER +# Show controller events +# CONFIG_EXAMPLES_USBMSC_TRACEINTERRUPTS +# Show interrupt-related events. +# +CONFIG_EXAMPLES_USBMSC_NLUNS=1 +CONFIG_EXAMPLES_USBMSC_DEVMINOR1=0 +CONFIG_EXAMPLES_USBMSC_DEVPATH1="/dev/mmcsd0" +CONFIG_EXAMPLES_USBMSC_TRACEINIT=n +CONFIG_EXAMPLES_USBMSC_TRACECLASS=y +CONFIG_EXAMPLES_USBMSC_TRACETRANSFERS=y +CONFIG_EXAMPLES_USBMSC_TRACECONTROLLER=y +CONFIG_EXAMPLES_USBMSC_TRACEINTERRUPTS=n + +# +# Settings for examples/composite +# +# CONFIG_EXAMPLES_COMPOSITE_DEBUGMM +# Enables some debug tests to check for memory usage and memory leaks. +# +# CONFIG_EXAMPLES_COMPOSITE_NLUNS +# Defines the number of logical units (LUNs) exported by the USB storage +# driver. Each LUN corresponds to one exported block driver (or partition +# of a block driver). May be 1, 2, or 3. Default is 1. +# CONFIG_EXAMPLES_COMPOSITE_DEVMINOR1 +# The minor device number of the block driver for the first LUN. For +# example, N in /dev/mmcsdN. Used for registering the block driver. Default +# is zero. +# CONFIG_EXAMPLES_COMPOSITE_DEVPATH1 +# The full path to the registered block driver. Default is "/dev/mmcsd0" +# CONFIG_EXAMPLES_COMPOSITE_DEVMINOR2 and CONFIG_EXAMPLES_COMPOSITE_DEVPATH2 +# Similar parameters that would have to be provided if CONFIG_EXAMPLES_COMPOSITE_NLUNS +# is 2 or 3. No defaults. +# CONFIG_EXAMPLES_COMPOSITE_DEVMINOR3 and CONFIG_EXAMPLES_COMPOSITE_DEVPATH3 +# Similar parameters that would have to be provided if CONFIG_EXAMPLES_COMPOSITE_NLUNS +# is 3. No defaults. +# +# CONFIG_EXAMPLES_COMPOSITE_TTYUSB - The minor number of the USB serial device. +# Default is zero (corresponding to /dev/ttyUSB0. Default is zero. +# CCONFIG_EXAMPLES_COMPOSITE_SERDEV - The string corresponding to +# CONFIG_EXAMPLES_COMPOSITE_TTYUSB. The default is "/dev/ttyUSB0". +# CONFIG_EXAMPLES_COMPOSITE_BUFSIZE - The size of the serial I/O buffer in +# bytes. Default 256 byters. +# +# If CONFIG_USBDEV_TRACE is enabled (or CONFIG_DEBUG and CONFIG_DEBUG_USB), then +# the example code will also manage the USB trace output. The amount of trace output +# can be controlled using: +# +# CONFIG_EXAMPLES_COMPOSITE_TRACEINIT +# Show initialization events +# CONFIG_EXAMPLES_COMPOSITE_TRACECLASS +# Show class driver events +# CONFIG_EXAMPLES_COMPOSITE_TRACETRANSFERS +# Show data transfer events +# CONFIG_EXAMPLES_COMPOSITE_TRACECONTROLLER +# Show controller events +# CONFIG_EXAMPLES_COMPOSITE_TRACEINTERRUPTS +# Show interrupt-related events. +# +CONFIG_EXAMPLES_COMPOSITE_DEBUGMM=n +CONFIG_EXAMPLES_COMPOSITE_NLUNS=1 +CONFIG_EXAMPLES_COMPOSITE_DEVMINOR1=0 +CONFIG_EXAMPLES_COMPOSITE_DEVPATH1="/dev/mmcsd0" +CONFIG_EXAMPLES_COMPOSITE_TTYUSB=0 +CONFIG_EXAMPLES_COMPOSITE_SERDEV="/dev/ttyUSB0" +CONFIG_EXAMPLES_COMPOSITE_BUFSIZE=256 +CONFIG_EXAMPLES_COMPOSITE_TRACEINIT=n +CONFIG_EXAMPLES_COMPOSITE_TRACECLASS=n +CONFIG_EXAMPLES_COMPOSITE_TRACETRANSFERS=n +CONFIG_EXAMPLES_COMPOSITE_TRACECONTROLLER=n +CONFIG_EXAMPLES_COMPOSITE_TRACEINTERRUPTS=n + +# +# Stack and heap information +# +# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP +# operation from FLASH but must copy initialized .data sections to RAM. +# (Must always =n; the LPC214x always runs from FLASH) +# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH +# but copy themselves entirely into RAM for better performance. +# CONFIG_CUSTOM_STACK - The up_ implementation will handle +# all stack operations outside of the nuttx model. +# CONFIG_STACK_POINTER - The initial stack pointer (arm7tdmi only) +# CONFIG_IDLETHREAD_STACKSIZE - The size of the initial stack. +# This is the thread that (1) performs the inital boot of the system up +# to the point where user_start() is spawned, and (2) there after is the +# IDLE thread that executes only when there is no other thread ready to +# run. +# CONFIG_USERMAIN_STACKSIZE - The size of the stack to allocate +# for the main user thread that begins at the user_start() entry point. +# CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size +# CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size +# CONFIG_HEAP_BASE - The beginning of the heap +# CONFIG_HEAP_SIZE - The size of the heap +# +CONFIG_BOOT_RUNFROMFLASH=n +CONFIG_BOOT_COPYTORAM=n +CONFIG_CUSTOM_STACK=n +CONFIG_STACK_POINTER= +CONFIG_IDLETHREAD_STACKSIZE=2048 +CONFIG_USERMAIN_STACKSIZE=2048 +CONFIG_PTHREAD_STACK_MIN=256 +CONFIG_PTHREAD_STACK_DEFAULT=2048 +CONFIG_HEAP_BASE= +CONFIG_HEAP_SIZE= diff --git a/nuttx/configs/mcu123-lpc214x/composite/ld.script b/nuttx/configs/mcu123-lpc214x/composite/ld.script new file mode 100644 index 0000000000..c97a2222fa --- /dev/null +++ b/nuttx/configs/mcu123-lpc214x/composite/ld.script @@ -0,0 +1,119 @@ +/**************************************************************************** + * configs/mcu123-lpc214x/composite/ld.script + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * 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. + * + ****************************************************************************/ + +/* FLASH: + * The lpc2148 has 512Kb of non-volatile memory beginning at address + * 0x00000000. The OS entry point is via the reset vector at address + * 0x00000000 (default MEMMAP mode assumed) + * + * SRAM: + * The lpc2148 has 32Kb of on-chip static RAM beginning at address + * 0x40000000. The .data section will be relocated from _eronly + * to _sdata at boot time. + */ + +MEMORY +{ + flash (rx) : ORIGIN = 0x00000000, LENGTH = 500K + sram (rw) : ORIGIN = 0x40000000, LENGTH = 32K - 32 +} + +OUTPUT_ARCH(arm) +ENTRY(_stext) +SECTIONS +{ + .text : { + _stext = ABSOLUTE(.); + *(.vectors) + *(.text .text.*) + *(.fixup) + *(.gnu.warning) + *(.rodata .rodata.*) + *(.gnu.linkonce.t.*) + *(.glue_7) + *(.glue_7t) + *(.got) + *(.gcc_except_table) + *(.gnu.linkonce.r.*) + _etext = ABSOLUTE(.); + } > flash + + /* This is where the .data section is relocated for execution out + * FLASH. The .data section will be relocated from _eronly + * to _sdata at boot time. + */ + + _eronly = ABSOLUTE(.); + + .data : { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + _edata = ABSOLUTE(.); + } > sram AT > flash + + .ARM.extab : { + *(.ARM.extab*) + } >sram + + __exidx_start = ABSOLUTE(.); + .ARM.exidx : { + *(.ARM.exidx*) + } >sram + __exidx_end = ABSOLUTE(.); + + .bss : { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + _ebss = ABSOLUTE(.); + } > sram + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } +} diff --git a/nuttx/configs/mcu123-lpc214x/composite/setenv.sh b/nuttx/configs/mcu123-lpc214x/composite/setenv.sh new file mode 100755 index 0000000000..58e78a92d4 --- /dev/null +++ b/nuttx/configs/mcu123-lpc214x/composite/setenv.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# configs/mcu123-lpc2148/composite/setenv.sh +# +# Copyright (C) 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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. +# + +if [ "$_" = "$0" ] ; then + echo "You must source this script, not run it!" 1>&2 + exit 1 +fi + +WD=`pwd` +if [ ! -x "setenv.sh" ]; then + echo "This script must be executed from the top-level NuttX build directory" + exit 1 +fi + +if [ -z "${PATH_ORIG}" ]; then + export PATH_ORIG="${PATH}" +fi + +# This the Cygwin path to the location where I installed the CodeSourcery +# toolchain under windows. You will also have to edit this if you install +# the CodeSourcery toolchain in any other location +#export TOOLCHAIN_BIN="/cygdrive/c/Program Files (x86)/CodeSourcery/Sourcery G++ Lite/bin" + +# This the Cygwin path to the location where I build the buildroot +# toolchain. +export TOOLCHAIN_BIN="${WD}/../misc/buildroot/build_arm_nofpu/staging_dir/bin" + +# This is the Cygwin path to the configuration scripts directory + +export LPC214XSCRIPTS="$WD/configs/mcu123-lpc214x/scripts" + +# Add the path to the toolchain to the PATH varialble +export PATH="${TOOLCHAIN_BIN}:${LPC214XSCRIPTS}:/sbin:/usr/sbin:${PATH_ORIG}" + +echo "PATH : ${PATH}" diff --git a/nuttx/configs/mcu123-lpc214x/nsh/ld.script b/nuttx/configs/mcu123-lpc214x/nsh/ld.script index fed8016994..d6128621b4 100644 --- a/nuttx/configs/mcu123-lpc214x/nsh/ld.script +++ b/nuttx/configs/mcu123-lpc214x/nsh/ld.script @@ -1,8 +1,8 @@ /**************************************************************************** * configs/mcu123-lpc214x/nsh/ld.script * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -89,11 +89,11 @@ SECTIONS *(.ARM.extab*) } >sram + __exidx_start = ABSOLUTE(.); .ARM.exidx : { - __exidx_start = ABSOLUTE(.); *(.ARM.exidx*) - __exidx_end = ABSOLUTE(.); } >sram + __exidx_end = ABSOLUTE(.); .bss : { _sbss = ABSOLUTE(.); diff --git a/nuttx/configs/mcu123-lpc214x/ostest/ld.script b/nuttx/configs/mcu123-lpc214x/ostest/ld.script index fe3db69415..590e490eb8 100644 --- a/nuttx/configs/mcu123-lpc214x/ostest/ld.script +++ b/nuttx/configs/mcu123-lpc214x/ostest/ld.script @@ -1,8 +1,8 @@ /**************************************************************************** * configs/mcu123-lpc214x/ostest/ld.script * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -89,11 +89,11 @@ SECTIONS *(.ARM.extab*) } >sram + __exidx_start = ABSOLUTE(.); .ARM.exidx : { - __exidx_start = ABSOLUTE(.); *(.ARM.exidx*) - __exidx_end = ABSOLUTE(.); } >sram + __exidx_end = ABSOLUTE(.); .bss : { _sbss = ABSOLUTE(.); diff --git a/nuttx/configs/mcu123-lpc214x/src/Makefile b/nuttx/configs/mcu123-lpc214x/src/Makefile index 93071038b1..21838bf39a 100644 --- a/nuttx/configs/mcu123-lpc214x/src/Makefile +++ b/nuttx/configs/mcu123-lpc214x/src/Makefile @@ -1,8 +1,8 @@ ############################################################################ # configs/mcu123-lpc214x/src/Makefile # -# Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -48,13 +48,19 @@ endif ASRCS = AOBJS = $(ASRCS:.S=$(OBJEXT)) CSRCS = up_spi.c up_leds.c + ifeq ($(CONFIG_NSH_ARCHINIT),y) CSRCS += up_nsh.c endif + ifeq ($(CONFIG_USBMSC),y) CSRCS += up_usbmsc.c endif +ifeq ($(CONFIG_USBDEV_COMPOSITE),y) +CSRCS += up_composite.c +endif + COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) diff --git a/nuttx/configs/mcu123-lpc214x/src/up_composite.c b/nuttx/configs/mcu123-lpc214x/src/up_composite.c new file mode 100644 index 0000000000..3540cdb8a9 --- /dev/null +++ b/nuttx/configs/mcu123-lpc214x/src/up_composite.c @@ -0,0 +1,155 @@ +/**************************************************************************** + * configs/mcu123-lpc214x/src/up_composite.c + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Configure and register the LPC214x MMC/SD SPI block driver. + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include +#include +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/* Configuration ************************************************************/ + +#ifndef CONFIG_EXAMPLES_COMPOSITE_DEVMINOR1 +# define CONFIG_EXAMPLES_COMPOSITE_DEVMINOR1 0 +#endif + +/* PORT and SLOT number probably depend on the board configuration */ + +#ifdef CONFIG_ARCH_BOARD_MCU123 +# undef LPC214X_MMCSDSPIPORTNO +# define LPC214X_MMCSDSPIPORTNO 1 +# undef LPC214X_MMCSDSLOTNO +# define LPC214X_MMCSDSLOTNO 0 +#else + /* Add configuration for new LPC214x boards here */ +# error "Unrecognized LPC214x board" +#endif + +/* Debug ********************************************************************/ + +#ifdef CONFIG_CPP_HAVE_VARARGS +# ifdef CONFIG_DEBUG +# define message(...) lib_lowprintf(__VA_ARGS__) +# define msgflush() +# else +# define message(...) printf(__VA_ARGS__) +# define msgflush() fflush(stdout) +# endif +#else +# ifdef CONFIG_DEBUG +# define message lib_lowprintf +# define msgflush() +# else +# define message printf +# define msgflush() fflush(stdout) +# endif +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: composite_archinitialize + * + * Description: + * Perform architecture specific initialization + * + ****************************************************************************/ + +int composite_archinitialize(void) +{ + /* If examples/composite is built as an NSH command, then SD slot should + * already have been initized in nsh_archinitialize() (see up_nsh.c). In + * this case, there is nothing further to be done here. + * + * NOTE: CONFIG_NSH_BUILTIN_APPS is not a fool-proof indication that NSH + * was built. + */ + +#ifndef CONFIG_NSH_BUILTIN_APPS + FAR struct spi_dev_s *spi; + int ret; + + /* Get the SPI port */ + + message("composite_archinitialize: Initializing SPI port %d\n", + LPC214X_MMCSDSPIPORTNO); + + spi = up_spiinitialize(LPC214X_MMCSDSPIPORTNO); + if (!spi) + { + message("composite_archinitialize: Failed to initialize SPI port %d\n", + LPC214X_MMCSDSPIPORTNO); + return -ENODEV; + } + + message("composite_archinitialize: Successfully initialized SPI port %d\n", + LPC214X_MMCSDSPIPORTNO); + + /* Bind the SPI port to the slot */ + + message("composite_archinitialize: Binding SPI port %d to MMC/SD slot %d\n", + LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO); + + ret = mmcsd_spislotinitialize(CONFIG_EXAMPLES_COMPOSITE_DEVMINOR1, LPC214X_MMCSDSLOTNO, spi); + if (ret < 0) + { + message("composite_archinitialize: Failed to bind SPI port %d to MMC/SD slot %d: %d\n", + LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO, ret); + return ret; + } + + message("composite_archinitialize: Successfuly bound SPI port %d to MMC/SD slot %d\n", + LPC214X_MMCSDSPIPORTNO, LPC214X_MMCSDSLOTNO); + +#endif /* CONFIG_NSH_BUILTIN_APPS */ + + return OK; +} diff --git a/nuttx/configs/mcu123-lpc214x/src/up_spi.c b/nuttx/configs/mcu123-lpc214x/src/up_spi.c index 0c32fc6db2..b58c8d6670 100644 --- a/nuttx/configs/mcu123-lpc214x/src/up_spi.c +++ b/nuttx/configs/mcu123-lpc214x/src/up_spi.c @@ -2,8 +2,8 @@ * config/mcu123-lpc214x/src/up_spi.c * arch/arm/src/board/up_spi.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -66,6 +66,7 @@ #include #include #include +#include #include #include diff --git a/nuttx/configs/mcu123-lpc214x/src/up_usbmsc.c b/nuttx/configs/mcu123-lpc214x/src/up_usbmsc.c old mode 100755 new mode 100644 diff --git a/nuttx/configs/mcu123-lpc214x/usbserial/ld.script b/nuttx/configs/mcu123-lpc214x/usbserial/ld.script index 34e22fba64..c73d9bda57 100644 --- a/nuttx/configs/mcu123-lpc214x/usbserial/ld.script +++ b/nuttx/configs/mcu123-lpc214x/usbserial/ld.script @@ -1,8 +1,8 @@ /**************************************************************************** * configs/mcu123-lpc214x/usbserial/ld.script * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -89,11 +89,11 @@ SECTIONS *(.ARM.extab*) } >sram + __exidx_start = ABSOLUTE(.); .ARM.exidx : { - __exidx_start = ABSOLUTE(.); *(.ARM.exidx*) - __exidx_end = ABSOLUTE(.); } >sram + __exidx_end = ABSOLUTE(.); .bss : { _sbss = ABSOLUTE(.); diff --git a/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs b/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs index 6f770095d6..459b3cb258 100644 --- a/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs +++ b/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs @@ -1,8 +1,8 @@ ############################################################################## # configs/mcu123-lpc214x/usbstorage/Make.defs # -# Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved. -# Author: Gregory Nutt +# Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/nuttx/configs/mcu123-lpc214x/usbstorage/ld.script b/nuttx/configs/mcu123-lpc214x/usbstorage/ld.script index 54bb21ee67..41404fa6e3 100644 --- a/nuttx/configs/mcu123-lpc214x/usbstorage/ld.script +++ b/nuttx/configs/mcu123-lpc214x/usbstorage/ld.script @@ -1,8 +1,8 @@ /**************************************************************************** * configs/mcu123-lpc214x/usbstorage/ld.script * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -89,11 +89,11 @@ SECTIONS *(.ARM.extab*) } >sram + __exidx_start = ABSOLUTE(.); .ARM.exidx : { - __exidx_start = ABSOLUTE(.); *(.ARM.exidx*) - __exidx_end = ABSOLUTE(.); } >sram + __exidx_end = ABSOLUTE(.); .bss : { _sbss = ABSOLUTE(.); diff --git a/nuttx/configs/stm3210e-eval/composite/Make.defs b/nuttx/configs/stm3210e-eval/composite/Make.defs index 39f71e4303..a8936b6566 100755 --- a/nuttx/configs/stm3210e-eval/composite/Make.defs +++ b/nuttx/configs/stm3210e-eval/composite/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # configs/stm3210e-eval/composite/Make.defs # -# Copyright (C) 2023 Gregory Nutt. All rights reserved. +# Copyright (C) 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without diff --git a/nuttx/lib/termios/lib_tcsetattr.c b/nuttx/lib/termios/lib_tcsetattr.c index 636fd34618..7868ef219c 100644 --- a/nuttx/lib/termios/lib_tcsetattr.c +++ b/nuttx/lib/termios/lib_tcsetattr.c @@ -119,4 +119,4 @@ int tcsetattr(int fd, int options, FAR const struct termios *termiosp) return ioctl(fd, TCSETS, (unsigned long)termiosp); } return -ENOSYS; -} \ No newline at end of file +}