Changes for clean build of app/ directory with Windows toolchain
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3488 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
f83e71ad07
commit
790ec002c7
@ -114,29 +114,24 @@ 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 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:
|
||||
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:
|
||||
|
||||
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_CODEREDL, then you may also have to modify
|
||||
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.
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
|
||||
performed automatically in the Cygwin makefiles using the 'cygpath' utility
|
||||
@ -183,42 +178,17 @@ 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
|
||||
------------
|
||||
|
||||
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:
|
||||
Here are a few tips before you start that 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
|
||||
@ -232,6 +202,19 @@ Code Red IDE
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/lpc17x/lpc17_vectors.S.
|
||||
|
||||
Using Code Red GNU Tools from Cygwin
|
||||
------------------------------------
|
||||
|
||||
Under Cygwin, the Code Red command line tools (e.g., arm-non-eabi-gcc) cannot
|
||||
be executed because the they only have execut privileges for Administrators. I
|
||||
worked around this by:
|
||||
|
||||
Opening a native Cygwin RXVT as Administrator (Right click, "Run as administrator"),
|
||||
then executing 'chmod 755 *.exe' in the following directories:
|
||||
|
||||
/cygdrive/c/nxp/lpcxpreeso_3.6/bin, and
|
||||
/cygdrive/c/nxp/lpcxpreeso_3.6/Tools/bin
|
||||
|
||||
NuttX buildroot Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
@ -65,12 +65,12 @@ ifeq ($(CONFIG_LPC17_CODEREDW),y)
|
||||
# CodeSourcery under Windows
|
||||
CROSSDEV = arm-none-eabi-
|
||||
WINTOOL = y
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -D__NEWLIB__
|
||||
endif
|
||||
ifeq ($(CONFIG_LPC17_CODEREDL),y)
|
||||
# CodeSourcery under Linux
|
||||
CROSSDEV = arm-none-eabi-
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft -D__NEWLIB__
|
||||
MAXOPTIMIZATION = -O2
|
||||
endif
|
||||
|
||||
|
@ -1,5 +1,40 @@
|
||||
#!/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
|
||||
#
|
||||
@ -18,7 +53,7 @@
|
||||
# -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
|
||||
@ -32,9 +67,21 @@
|
||||
# [ 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user