THTTPD works on LPCXpresso

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3514 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2011-04-16 15:43:39 +00:00
parent cfd8e86d24
commit a6ad6f2e57
4 changed files with 68 additions and 106 deletions

View File

@ -151,27 +151,31 @@ GNU Toolchain Options
The NuttX make system has been modified to support the following different
toolchain options.
1. The CodeSourcery GNU toolchain,
2. The devkitARM GNU toolchain,
3. The NuttX buildroot Toolchain (see below).
1. The Code Red GNU toolchain
2. The CodeSourcery GNU toolchain,
3. The devkitARM GNU toolchain,
4. The NuttX buildroot Toolchain (see below).
All testing has been conducted using the NuttX buildroot toolchain. However,
the make system is setup to default to use the devkitARM toolchain. To use
the CodeSourcery or devkitARM toolchain, you simply need add one of the
following configuration options to your .config (or defconfig) file:
All testing has been conducted using the Code Red toolchain and the
make system is setup to default to use the Code Red Linux toolchain. To use
the other toolchain, you simply need add one of the following configuration
options to your .config (or defconfig) file:
CONFIG_LPC17_CODESOURCERYW=y : CodeSourcery under Windows
CONFIG_LPC17_CODESOURCERYL=y : CodeSourcery under Linux
CONFIG_LPC17_DEVKITARM=y : devkitARM under Windows
CONFIG_LPC17_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
CONFIG_LPC17_CODEREDW=n : Code Red toolchain under Windows
CONFIG_LPC17_CODEREDL=y : Code Red toolchain under Linux
If you are not using CONFIG_LPC17_BUILDROOT, then you may also have to modify
the PATH in the setenv.h file if your make cannot find the tools.
You may also have to modify the PATH in the setenv.h file if your make cannot
find the tools.
NOTE: the CodeSourcery (for Windows)and devkitARM are Windows native toolchains.
The CodeSourcey (for Linux) and NuttX buildroot toolchains are Cygwin and/or
Linux native toolchains. There are several limitations to using a Windows based
toolchain in a Cygwin environment. The three biggest are:
NOTE: the CodeSourcery (for Windows), devkitARM, and Code Red (for Windoes)
are Windows native toolchains. The CodeSourcey (for Linux), Code Red (for Linux)
and NuttX buildroot toolchains are Cygwin and/or Linux native toolchains. There
are several limitations to using a Windows based toolchain in a Cygwin
environment. The three biggest are:
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
performed automatically in the Cygwin makefiles using the 'cygpath' utility
@ -220,7 +224,7 @@ Code Red IDE
Makefile Build
--------------
Under Eclipse, it is pretty easy to set up an "empty makefile project" and
Under Linux Eclipse, it is pretty easy to set up an "empty makefile project" and
simply use the NuttX makefile to build the system. That is almost for free
under Linux. Under Windows, you will need to set up the "Cygwin GCC" empty
makefile project in order to work with Windows (Google for "Eclipse Cygwin" -
@ -309,6 +313,12 @@ Code Red IDE
crt_emu_lpc11_13_nxp -wire=hid -pLPC1343 -flash-load=binary.bin -load-base=0x1000
tools/flash.sh
--------------
All of the above steps are automated in the bash script flash.sh that can
be found in the configs/lpcxpresso/tools directory.
NuttX buildroot Toolchain
^^^^^^^^^^^^^^^^^^^^^^^^^
@ -317,7 +327,7 @@ NuttX buildroot Toolchain
different from the default in your PATH variable).
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
SourceForge download site (https://sourceforge.net/project/showfiles.php?group_id=189573).
SourceForge download site (https://sourceforge.net/projects/nuttx/files/).
This GNU toolchain builds and executes in the Linux or Cygwin environment.
1. You must have already configured Nuttx in <some-dir>/nuttx.
@ -348,6 +358,39 @@ NuttX buildroot Toolchain
NOTE: This is an OABI toolchain.
NXFLAT Toolchain
^^^^^^^^^^^^^^^^
If you are *not* using the NuttX buildroot toolchain and you want to use
the NXFLAT tools, then you will still have to build a portion of the buildroot
tools -- just the NXFLAT tools. The buildroot with the NXFLAT tools can
be downloaded from the NuttX SourceForge download site
(https://sourceforge.net/projects/nuttx/files/).
This GNU toolchain builds and executes in the Linux or Cygwin environment.
1. You must have already configured Nuttx in <some-dir>/nuttx.
cd tools
./configure.sh lpcxpresso-lpc1768/<sub-dir>
2. Download the latest buildroot package into <some-dir>
3. unpack the buildroot tarball. The resulting directory may
have versioning information on it like buildroot-x.y.z. If so,
rename <some-dir>/buildroot-x.y.z to <some-dir>/buildroot.
4. cd <some-dir>/buildroot
5. cp configs/cortexm3-defconfig-nxflat .config
6. make oldconfig
7. make
8. Edit setenv.h, if necessary, so that the PATH variable includes
the path to the newly builtNXFLAT binaries.
LEDs
^^^^
@ -604,6 +647,9 @@ Where <subdir> is one of the following:
This builds the THTTPD web server example using the THTTPD and
the apps/examples/thttpd application.
NOTE: You will need to build the NXFLAT toolchain as described
above in order to use this example.
usbstorage:
This configuration directory exercises the USB mass storage
class driver at apps/examples/usbstorage. See apps/examples/README.txt

View File

@ -83,12 +83,14 @@ ifeq ($(WINTOOL),y)
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)/thttpd/ld.script}"
MAXOPTIMIZATION = -O2
NXFLATLDSCRIPT = -T "${shell cygpath -w $(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld}"
else
# Linux/Cygwin-native toolchain
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)/thttpd/ld.script
NXFLATLDSCRIPT = -T"$(TOPDIR)/binfmt/libnxflat/gnu-nxflat.ld"
endif
CC = $(CROSSDEV)gcc
@ -127,7 +129,7 @@ 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
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) $(NXFLATLDSCRIPT) -no-check-sections
LDNXFLATFLAGS = -e main -s 2048
OBJEXT = .o

View File

@ -42,7 +42,9 @@ if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi
WD=`pwd`
# This is where the buildroot might reside on a Linux or Cygwin system
# export TOOLCHAIN_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
# A minimal buildroot version with the NXFLAT tools is always required
# for this configuration in order to buildthe THTTPD CGI programs
export BUILDROOT_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
# This is the default install location for Code Red on Linux
export TOOLCHAIN_BIN="/usr/local/LPCXpresso/tools/bin"
@ -54,6 +56,6 @@ export TOOLCHAIN_BIN="/usr/local/LPCXpresso/tools/bin"
export LPCTOOL_DIR="${WD}/configs/lpcxpresso-lpc1768/tools"
# Add the path to the toolchain to the PATH varialble
export PATH="${TOOLCHAIN_BIN}:${LPCTOOL_DIR}:/sbin:/usr/sbin:${PATH_ORIG}"
export PATH="${TOOLCHAIN_BIN}:${LPCTOOL_DIR}:${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
echo "PATH : ${PATH}"

View File

@ -1,88 +0,0 @@
#!/bin/bash
####################################################################################
# dfu_util.sh
#
# Copyright (C) 2011 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# 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.
#
####################################################################################
# On Linux, the program dfu_utils is included in the Code Red installation:
#
# dfu-util - (C) 2007-2008 by OpenMoko Inc.
# This program is Free Software and has ABSOLUTELY NO WARRANTY
#
# You need to specify one of -D or -U
# Usage: dfu-util [options] ...
# -h --help Print this help message
# -V --version Print the version number
# -l --list List the currently attached DFU capable USB devices
# -d --device vendor:product Specify Vendor/Product ID of DFU device
# -p --path bus-port. ... .port Specify path to DFU device
# -c --cfg config_nr Specify the Configuration of DFU device
# -i --intf intf_nr Specify the DFU Interface number
# -a --alt alt Specify the Altsetting of the DFU Interface
# by name or by number
# -t --transfer-size Specify the number of bytes per USB Transfer
# -U --upload file Read firmware from device into <file>
# -D --download file Write firmware from <file> into device
# -R --reset Issue USB Reset signalling once we're finished
#
# Example:
#
# /usr/local/LPCXpresso/bin/Flash$ dfu-util -l
# dfu-util - (C) 2007-2008 by OpenMoko Inc.
# This program is Free Software and has ABSOLUTELY NO WARRANTY
#
# Found Runtime: [0x0471:0xdf55] devnum=3, cfg=0, intf=0, alt=0, name="UNDEFINED"
#
# dmesg:
# [ 1.472016] usb 1-3: new high speed USB device using ehci_hcd and address 3
# [ 1.604784] usb 1-3: configuration #1 chosen from 1 choice
#
####################################################################################
# In the windows installation, a program called DFUAPP.exe is provided.
#
# DFUAPP.exe /s gui : Will only the DFU app in GUI mode
####################################################################################
# This is the default install location for dfu_util on Linux
DFU_UTIL=/usr/local/LPCXpresso/bin/dfu-util
# This is the default install location for DFUAPP.exe on Windows (note that this
# path could change with the Code Red version number
DFUAPP=/cygdrive/c/nxp/lpcxpresso_3.6/bin/DFUAPP.exe
# The binary to download:
NUTTX=/home/patacongo/projects/nuttx/nuttx/trunk/nuttx/nuttx
#${DFU_UTIL} -d nxp:lpc1768 -p 1-3 -c 0 -i 0 -a 0 -D ${NUTTX} -R
${DFU_UTIL} -d nxp:lpc1768 -D ${NUTTX} -R