Add support for Code Red
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3487 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
47d0aa9ddf
commit
704080d547
@ -114,24 +114,29 @@ GNU Toolchain Options
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The devkitARM GNU toolchain,
|
||||
3. The NuttX buildroot Toolchain (see below).
|
||||
4. LPCXpresso Code Red IDE.
|
||||
|
||||
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:
|
||||
the make system is setup to default to use the Code Red toolchain. To use
|
||||
the CodeSourcery, devkitARM, or buildoor 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=y : Code Red under Windows
|
||||
CONFIG_LPC17_CODEREDL=y : Code Red under Linux
|
||||
|
||||
If you are not using CONFIG_LPC17_BUILDROOT, then you may also have to modify
|
||||
If you are not using CONFIG_LPC17_CODEREDL, then 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 Windows) are
|
||||
Windows native toolchains. The CodeSourcey (for Linux), NuttX buildroot and
|
||||
Code Red (for Linux) toolchains are Linux native toolchains (The buildroot may
|
||||
also be built as a Cygwin native toolchain which behaves the same as a Linux
|
||||
native toolchain in that environement). 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
|
||||
@ -178,17 +183,42 @@ Code Red IDE
|
||||
effort will be required to create the project (There is a simple RIDE project
|
||||
in the RIDE subdirectory).
|
||||
|
||||
Code Red IDE
|
||||
------------
|
||||
|
||||
Code Red is a Eclipse-based that is highly tuned from the LPCxxx MCUs. You
|
||||
can download Code Red free at http://lpcxpresso.code-red-tech.com (registration
|
||||
required).
|
||||
|
||||
Execute-Only Build
|
||||
------------------
|
||||
|
||||
You should be able configure Eclipse to simply load the NuttX executable built
|
||||
outside of Code Red: Files->import->C/C++->C/C++ Executable.
|
||||
|
||||
Makefile Build
|
||||
--------------
|
||||
|
||||
Under 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" -
|
||||
there is a lot of help on the internet).
|
||||
|
||||
Import makefile project: Files->import->C/C++ Project->
|
||||
Hmmm.. I don't see the Makefile project in the Code Red menus???
|
||||
|
||||
Cygwin Makefile Build
|
||||
---------------------
|
||||
|
||||
I don't know how to do this
|
||||
|
||||
Native Build
|
||||
------------
|
||||
Here are a few tips before you start that effort:
|
||||
|
||||
I should be possible to build NuttX as a "normal" IDE project. I do not
|
||||
know of anyone who has been successful doing that and I would not recommend
|
||||
trying. But here are a few tips before you start such an effort:
|
||||
|
||||
1) Select the toolchain that you will be using in your .config file
|
||||
2) Start the NuttX build at least one time from the Cygwin command line
|
||||
|
@ -61,6 +61,18 @@ ifeq ($(CONFIG_LPC17_BUILDROOT),y)
|
||||
ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
MAXOPTIMIZATION = -Os
|
||||
endif
|
||||
ifeq ($(CONFIG_LPC17_CODEREDW),y)
|
||||
# CodeSourcery under Windows
|
||||
CROSSDEV = arm-none-eabi-
|
||||
WINTOOL = y
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
endif
|
||||
ifeq ($(CONFIG_LPC17_CODEREDL),y)
|
||||
# CodeSourcery under Linux
|
||||
CROSSDEV = arm-none-eabi-
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
MAXOPTIMIZATION = -O2
|
||||
endif
|
||||
|
||||
ifeq ($(WINTOOL),y)
|
||||
# Windows-native toolchains
|
||||
|
@ -95,7 +95,9 @@ CONFIG_ARCH_DMA=n
|
||||
CONFIG_LPC17_CODESOURCERYW=n
|
||||
CONFIG_LPC17_CODESOURCERYL=n
|
||||
CONFIG_LPC17_DEVKITARM=n
|
||||
CONFIG_LPC17_BUILDROOT=y
|
||||
CONFIG_LPC17_BUILDROOT=n
|
||||
CONFIG_LPC17_CODEREDW=n
|
||||
CONFIG_LPC17_CODEREDL=y
|
||||
|
||||
#
|
||||
# Individual subsystems can be enabled:
|
||||
|
@ -40,7 +40,17 @@ fi
|
||||
if [ -z "${PATH_ORIG}" ]; then export PATH_ORIG="${PATH}"; fi
|
||||
|
||||
WD=`pwd`
|
||||
export BUILDROOT_BIN="${WD}/../buildroot/build_arm_nofpu/staging_dir/bin"
|
||||
export PATH="${BUILDROOT_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||
|
||||
# This is where the buildroot might reside on a Linux or Cygwin system
|
||||
# export TOOLCHAIN_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"
|
||||
|
||||
# This the Cygwin path to the LPCXpresso 3.6 install location under Windows
|
||||
#export TOOLCHAIN_BIN="/cygdrive/c/nxp/lpcxpresso_3.6/Tools/bin"
|
||||
|
||||
# Add the path to the toolchain to the PATH varialble
|
||||
export PATH="${TOOLCHAIN_BIN}:/sbin:/usr/sbin:${PATH_ORIG}"
|
||||
|
||||
echo "PATH : ${PATH}"
|
||||
|
41
configs/lpcxpresso-lpc1768/tools/dfu_util.sh
Executable file
41
configs/lpcxpresso-lpc1768/tools/dfu_util.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
####################################################################################
|
||||
# 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
|
||||
#
|
||||
####################################################################################
|
||||
|
||||
DFU_UTIL=/usr/local/LPCXpresso/bin/dfu-util
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user