configs: Remove some old, redundant, obsolete boilerplate regarding toolchains that has been cloned into most of the board README files.
This commit is contained in:
parent
54f43ea1f1
commit
43a221f308
34 changed files with 15 additions and 7160 deletions
|
@ -22,12 +22,6 @@ Contents
|
|||
- PIO Pin Usage
|
||||
- Rev 2 vs. Rev 3
|
||||
- ITEAD 2.4" TFT with Touch
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- Buttons and LEDs
|
||||
- Serial Consoles
|
||||
- Loading Code
|
||||
|
@ -250,202 +244,6 @@ ITEAD 2.4" TFT with Touch
|
|||
NOTES:
|
||||
- /CS is connected to ground (XPT2046 is always selected)
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
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, ok
|
||||
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, devkitARM or Raisonance GNU toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : Atollic toolchain for Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y : Generic GCC ARM EABI toolchain for Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW=y : Generic GCC ARM EABI toolchain for Windows
|
||||
|
||||
You may also have to modify the PATH environment variable if your make cannot
|
||||
find the tools.
|
||||
|
||||
NOTE about Windows native toolchains
|
||||
------------------------------------
|
||||
|
||||
The CodeSourcery (for Windows), Atollic, and devkitARM toolchains are
|
||||
Windows native toolchains. The CodeSourcery (for Linux), NuttX buildroot,
|
||||
and, perhaps, the generic GCC 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
^^^^
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/sam34,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/sam34/sam_vectors.S. You may need to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by an IDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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.shsam4s-xplained/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toolchain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Buttons and LEDs
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -20,12 +20,6 @@ Contents
|
|||
========
|
||||
|
||||
- STM32F107VCT Pin Usage
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI buildroot Toolchain
|
||||
- NuttX OABI buildroot Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- Cloudctrl-specific Configuration Options
|
||||
- LEDs
|
||||
- Cloudctrl-specific Configuration Options
|
||||
|
@ -167,244 +161,6 @@ PN NAME SIGNAL NOTES
|
|||
19 VSSA VSSA
|
||||
20 VREF- VREF-
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment because the development tools that I used only work under Windows.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain, or
|
||||
5. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
Most testing has been conducted using the CodeSourcery toolchain for Windows and
|
||||
that is the default toolchain in most configurations. To use the Atollic,
|
||||
devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable if your make cannot
|
||||
find the tools.
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains are
|
||||
Windows native toolchains. The CodeSourcery (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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI buildroot Toolchain
|
||||
==============================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 shenzhou/<sub-dir>
|
||||
|
||||
cd ..
|
||||
make context
|
||||
|
||||
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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Edit nuttx/.config to select the buildroot toolchain as described above
|
||||
and below:
|
||||
|
||||
-CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y
|
||||
+CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y
|
||||
|
||||
9. Set the PATH variable so tht it includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
detailed PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
====
|
||||
|
||||
|
@ -844,7 +600,5 @@ Where <subdir> is one of the following:
|
|||
This builds the THTTPD web server example using the THTTPD and
|
||||
the apps/examples/thttpd application.
|
||||
|
||||
NOTE: See note above with regard to the EABI/OABI buildroot
|
||||
toolchains. This example can only be built using the older
|
||||
OABI toolchain due to incompatibilities introduced in later
|
||||
GCC releases.
|
||||
NOTE: This example can only be built using older GCC toolchains
|
||||
due to incompatibilities introduced in later GCC releases.
|
||||
|
|
|
@ -9,155 +9,6 @@ References:
|
|||
Micromint: http://www.micromint.com/
|
||||
Luminary: http://www.luminarymicro.com/
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment because the Luminary FLASH programming application was used for
|
||||
writing to FLASH and this application works only under Windows.
|
||||
|
||||
GNU Toolchain Options
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The NuttX make system has been modified to support the multiple toolchain
|
||||
options including:
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The devkitARM GNU toolchain,
|
||||
3. 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, you simply need to add one of the following
|
||||
configuration options to your .config (or defconfig) file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable 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:
|
||||
|
||||
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
|
||||
performed automatically in the Cygwin makefiles using the 'cygpath' utility
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 eagle100/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
When building the buildroot toolchain, either (1) modify the
|
||||
cortexm3-eabi-defconfig-4.6.3 configuration to use EABI (using
|
||||
'make menuconfig'), or (2) use an exising OABI configuration such
|
||||
as cortexm3-defconfig-4.3.3
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Ethernet-Bootloader
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -7,12 +7,6 @@ Contents
|
|||
^^^^^^^^
|
||||
|
||||
Stellaris EKK-LM3S9B96 Evaluation Kit
|
||||
Development Environment
|
||||
GNU Toolchain Options
|
||||
IDEs
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
NXFLAT Toolchain
|
||||
Stellaris EKK-LM3S9B96 Evaluation Kit Configuration Options
|
||||
Configurations
|
||||
|
||||
|
@ -79,197 +73,6 @@ PIN SIGNAL EVB Function
|
|||
83 PH3/USB0EPEN USB-OTG power switch
|
||||
76 PH4/USB0PFLT Overcurrent input status from USB-OTG power switch
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
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).
|
||||
|
||||
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, you simply need to add one of the following
|
||||
configuration options to your .config (or defconfig) file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable 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:
|
||||
|
||||
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
|
||||
performed automatically in the Cygwin makefiles using the 'cygpath' utility
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
NOTE 3: I recently (i.e., late 2011) tried building with the CodeSourcery Windows
|
||||
toolchain. The code worked but required 40 seconds to boot (or even until the
|
||||
status LED illuminates)!! Know idea why. With the buildroot tools, boot time is
|
||||
a couple of seconds.
|
||||
|
||||
IDEs
|
||||
^^^^
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/lm,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/tiva/tiva_vectors.S.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 ekk-lm3s9b96/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Stellaris EKK-LM3S9B96 Evaluation Kit Configuration Options
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -12,12 +12,6 @@ Contents
|
|||
========
|
||||
|
||||
- Pin Configuration
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- DFU and JTAG
|
||||
- OpenOCD
|
||||
- LEDs
|
||||
|
@ -159,235 +153,6 @@ PIN NAME SIGNAL NOTES
|
|||
99 VSS_3 DGND
|
||||
100 VDD_3 3V3
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment because the CodeSourcery Toolchain.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain, or
|
||||
5. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
Most testing has been conducted using the CodeSourcery toolchain for Windows and
|
||||
that is the default toolchain in most configurations. To use the Atollic,
|
||||
devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable if your make cannot
|
||||
find the tools.
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains are
|
||||
Windows native toolchains. The CodeSourcery (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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. You many have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by an IDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 fire-stm32v2/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
DFU and JTAG
|
||||
============
|
||||
|
||||
|
|
|
@ -7,209 +7,12 @@ HY-MiniSTM32V development board.
|
|||
Contents
|
||||
========
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- ST Bootloader
|
||||
- LEDs
|
||||
- RTC
|
||||
- HY-Mini specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
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. Raisonance GNU toolchain, or
|
||||
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, devkitARM or Raisonance GNU toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable if your make cannot
|
||||
find the tools.
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), devkitARM, and Raisonance toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. You many have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by an IDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 hymini-stm32v/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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 hymini-stm32v/<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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
ST Bootloader
|
||||
=============
|
||||
|
||||
|
|
|
@ -19,12 +19,8 @@ Contents
|
|||
- Connections via the Tower Primary Connector Side A
|
||||
- Connections via the Tower Primary Connector Side B
|
||||
- TWR-SER Serial Board Connection
|
||||
o Development Environment
|
||||
o GNU Toolchain Options
|
||||
o IDEs
|
||||
o NuttX EABI "buildroot" Toolchain
|
||||
o NuttX OABI "buildroot" Toolchain
|
||||
o NXFLAT Toolchain
|
||||
o KwikStik-K40-specific Configuration Options
|
||||
o Configurations
|
||||
|
||||
Kinetis KwikStik-K40 Features:
|
||||
==============================
|
||||
|
@ -148,193 +144,6 @@ Finally, we can conclude that
|
|||
|
||||
UART5 (PTE8/9) is associated with the DB9 connector
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
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).
|
||||
|
||||
All testing has been conducted using the CodeSourcery Windows toolchain. To
|
||||
use the devkitARM or the NuttX GNU toolchain, you simply need to change the
|
||||
the following configuration options to your .config (or defconfig) file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable if your make cannot
|
||||
find the tools.
|
||||
|
||||
NOTE: the CodeSourcery (for Windows) and devkitARM toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/k40,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/kinetis/k40_vectors.S.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M4 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M4 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
This GNU toolchain builds and executes in the Linux or Cygwin environment.
|
||||
|
||||
NOTE: The NuttX toolchain may not include optimizations for Cortex-M4 (ARMv7E-M).
|
||||
|
||||
1. You must have already configured Nuttx in <some-dir>/nuttx.
|
||||
|
||||
cd tools
|
||||
./configure.sh kwikstik-k40/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M4 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
KwikStik-K40-specific Configuration Options
|
||||
============================================
|
||||
|
||||
|
|
|
@ -7,13 +7,6 @@ Contents
|
|||
^^^^^^^^
|
||||
|
||||
Lincoln 60 development board
|
||||
Development Environment
|
||||
GNU Toolchain Options
|
||||
IDEs
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
NXFLAT Toolchain
|
||||
USB Device Controller Functions
|
||||
Lincoln 60 Configuration Options
|
||||
USB Host Configuration
|
||||
Configurations
|
||||
|
@ -54,192 +47,6 @@ Lincoln 60 board
|
|||
The Lincoln 60 has two serial connectors. The serial console defaults
|
||||
to COM1 (UART0).
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
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).
|
||||
|
||||
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:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable 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:
|
||||
|
||||
1. The Windows toolchain cannot follow Cygwin paths. Path conversions are
|
||||
performed automatically in the Cygwin makefiles using the 'cygpath' utility
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
^^^^
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/lpc17xx,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/lpc17x/lpc17_vectors.S.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 lincoln60/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conerntions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Lincoln 60 Configuration Options
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -9,9 +9,6 @@ Contents
|
|||
|
||||
- LPC4330-Xplorer development board
|
||||
- Status
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- Code Red IDE/Tools
|
||||
Booting the LPCLink
|
||||
Using GDB
|
||||
|
@ -19,9 +16,6 @@ Contents
|
|||
Command Line Flash Programming
|
||||
Executing from SPIFI
|
||||
USB DFU Booting
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- Serial Console
|
||||
- FPU
|
||||
- LPC4330-Xplorer Configuration Options
|
||||
|
@ -123,140 +117,6 @@ Status
|
|||
STM32 Ethernet and, as a result, it should be possible to leverage
|
||||
the STM32 Ethernet driver with a little more effort.
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The Code Red GNU toolchain,
|
||||
2. The CodeSourcery GNU toolchain,
|
||||
3. The Atollic Toolchain,
|
||||
4. The devkitARM GNU toolchain,
|
||||
5. 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:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODEREDW=y : Code Red "RedSuite" under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable if your make cannot
|
||||
find the tools.
|
||||
|
||||
NOTE: the Code Red, CodeSourcery (for Windows), Atollic and devkitARM toolchains
|
||||
are Windows native toolchains. The CodeSourcery (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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
Also, the Atollic toolchains are the only toolchains that have built-in support for
|
||||
the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will
|
||||
need to use the Atollic toolchain for now. See the FPU section below for more
|
||||
information.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project .
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/lpc43xx,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/common/up_vectors.S.
|
||||
|
||||
Code Red IDE/Tools
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
@ -450,101 +310,6 @@ Code Red IDE/Tools
|
|||
|
||||
To be provided.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 lpc4330-xplorer/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Serial Console
|
||||
==============
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@ Contents
|
|||
|
||||
- LPC4337-ws development board
|
||||
- Status
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- Code Red IDE/Tools
|
||||
Booting the LPCLink
|
||||
Using GDB
|
||||
|
@ -20,9 +17,6 @@ Contents
|
|||
Command Line Flash Programming
|
||||
Executing from SPIFI
|
||||
USB DFU Booting
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- LED and Pushbuttons
|
||||
- Serial Console
|
||||
- FPU
|
||||
|
@ -119,140 +113,6 @@ Status
|
|||
STM32 Ethernet and, as a result, it should be possible to leverage
|
||||
the STM32 Ethernet driver with a little more effort.
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The Code Red GNU toolchain,
|
||||
2. The CodeSourcery GNU toolchain,
|
||||
3. The Atollic Toolchain,
|
||||
4. The devkitARM GNU toolchain,
|
||||
5. 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:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODEREDW=y : Code Red "RedSuite" under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable if your make cannot
|
||||
find the tools.
|
||||
|
||||
NOTE: the Code Red, CodeSourcery (for Windows), Atollic and devkitARM toolchains
|
||||
are Windows native toolchains. The CodeSourcery (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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
Also, the Atollic toolchains are the only toolchains that have built-in support for
|
||||
the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will
|
||||
need to use the Atollic toolchain for now. See the FPU section below for more
|
||||
information.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project .
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/lpc43xx,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/common/up_vectors.S.
|
||||
|
||||
Code Red IDE/Tools
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
@ -446,101 +306,6 @@ Code Red IDE/Tools
|
|||
|
||||
To be provided.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 LPC4337-ws/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LED and Pushbuttons
|
||||
===================
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@ Contents
|
|||
|
||||
- LPC4357-EVB development board
|
||||
- Status
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- Code Red IDE/Tools
|
||||
Booting the LPCLink
|
||||
Using GDB
|
||||
|
@ -20,9 +17,6 @@ Contents
|
|||
Command Line Flash Programming
|
||||
Executing from SPIFI
|
||||
USB DFU Booting
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- LED and Pushbuttons
|
||||
- Serial Console
|
||||
- FPU
|
||||
|
@ -116,140 +110,6 @@ Status
|
|||
STM32 Ethernet and, as a result, it should be possible to leverage
|
||||
the STM32 Ethernet driver with a little more effort.
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The Code Red GNU toolchain,
|
||||
2. The CodeSourcery GNU toolchain,
|
||||
3. The Atollic Toolchain,
|
||||
4. The devkitARM GNU toolchain,
|
||||
5. 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:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODEREDW=y : Code Red "RedSuite" under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable if your make cannot
|
||||
find the tools.
|
||||
|
||||
NOTE: the Code Red, CodeSourcery (for Windows), Atollic and devkitARM toolchains
|
||||
are Windows native toolchains. The CodeSourcery (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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
Also, the Atollic toolchains are the only toolchains that have built-in support for
|
||||
the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will
|
||||
need to use the Atollic toolchain for now. See the FPU section below for more
|
||||
information.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project .
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/lpc43xx,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/common/up_vectors.S.
|
||||
|
||||
Code Red IDE/Tools
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
@ -443,101 +303,6 @@ Code Red IDE/Tools
|
|||
|
||||
To be provided.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 lpc4357-xplorer/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LED and Pushbuttons
|
||||
===================
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@ Contents
|
|||
|
||||
- LPC4370-Link2 development board
|
||||
- Status
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- Code Red IDE/Tools
|
||||
Booting the LPCLink
|
||||
Using GDB
|
||||
|
@ -20,9 +17,6 @@ Contents
|
|||
Command Line Flash Programming
|
||||
Executing from SPIFI
|
||||
USB DFU Booting
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- LED and Pushbuttons
|
||||
- Serial Console
|
||||
- FPU
|
||||
|
@ -119,140 +113,6 @@ Status
|
|||
STM32 Ethernet and, as a result, it should be possible to leverage
|
||||
the STM32 Ethernet driver with a little more effort.
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The Code Red GNU toolchain,
|
||||
2. The CodeSourcery GNU toolchain,
|
||||
3. The Atollic Toolchain,
|
||||
4. The devkitARM GNU toolchain,
|
||||
5. 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:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODEREDW=y : Code Red "RedSuite" under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
You may also have to modify the PATH environment variable if your make cannot
|
||||
find the tools.
|
||||
|
||||
NOTE: the Code Red, CodeSourcery (for Windows), Atollic and devkitARM toolchains
|
||||
are Windows native toolchains. The CodeSourcery (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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
Also, the Atollic toolchains are the only toolchains that have built-in support for
|
||||
the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will
|
||||
need to use the Atollic toolchain for now. See the FPU section below for more
|
||||
information.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project .
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/lpc43xx,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/common/up_vectors.S.
|
||||
|
||||
Code Red IDE/Tools
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
@ -446,101 +306,6 @@ Code Red IDE/Tools
|
|||
|
||||
To be provided.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 LPC4370-xplorer/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LED and Pushbuttons
|
||||
===================
|
||||
|
||||
|
|
|
@ -8,11 +8,6 @@ Contents
|
|||
^^^^^^^^
|
||||
|
||||
LCPXpresso LPC1115 Board
|
||||
Development Environment
|
||||
GNU Toolchain Options
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
NXFLAT Toolchain
|
||||
Code Red IDE
|
||||
Using OpenOCD
|
||||
LEDs
|
||||
|
@ -60,71 +55,6 @@ LCPXpresso LPC1115 Board
|
|||
P3[25]/MAT0.0/PWM1.2 PAD13
|
||||
P3[26]/STCLK/MAT0.1/PWM1.3 PAD14
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
GNU Toolchain Options
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
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 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_ARMV6M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV6M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV6M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV6M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
CONFIG_ARMV6M_TOOLCHAIN_CODEREDW=n : Code Red toolchain under Windows
|
||||
CONFIG_ARMV6M_TOOLCHAIN_CODEREDL=y : Code Red toolchain under Linux
|
||||
|
||||
You may also have to modify the PATH environment variable if your make cannot
|
||||
find the tools.
|
||||
|
||||
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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
Code Red IDE
|
||||
^^^^^^^^^^^^
|
||||
|
||||
|
@ -231,101 +161,6 @@ Code Red IDE
|
|||
All of the above steps are automated in the bash script flash.sh that can
|
||||
be found in the configs/lpcxpresso/tools directory.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M0 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
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-lpc1115/<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/cortexm0-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv6-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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-lpc1115/<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/cortexm0-defconfig-nxflat .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Using OpenOCD
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -6,200 +6,10 @@ README for NuttX port to the mbed.org LPC1768 board (http://mbed.org/)
|
|||
Contents
|
||||
^^^^^^^^
|
||||
|
||||
Development Environment
|
||||
GNU Toolchain Options
|
||||
IDEs
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
NXFLAT Toolchain
|
||||
USB Device Controller Functions
|
||||
mbed Configuration Options
|
||||
USB Host Configuration
|
||||
Configurations
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
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).
|
||||
|
||||
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:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
^^^^
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/lpc17xx,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/lpc17x/lpc17_vectors.S.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 mbed/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
mbed Configuration Options
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -20,12 +20,6 @@ about this board.
|
|||
Contents
|
||||
========
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- LEDs
|
||||
- PWM
|
||||
- UARTs
|
||||
|
@ -36,235 +30,6 @@ Contents
|
|||
- Mikroe-STM32F4-specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain, or
|
||||
5. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
All testing has been conducted using the CodeSourcery toolchain for Linux. To use
|
||||
the Atollic, devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
Also, the Atollic toolchains are the only toolchains that have built-in support for
|
||||
the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will
|
||||
need to use the Atollic toolchain for now. See the FPU section below for more
|
||||
information.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 mikroe-stm32f4/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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 mikroe-stm32f4/<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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
====
|
||||
|
||||
|
|
|
@ -7,12 +7,6 @@ Contents
|
|||
^^^^^^^^
|
||||
|
||||
Olimex LPC1766-STK development board
|
||||
Development Environment
|
||||
GNU Toolchain Options
|
||||
IDEs
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
NXFLAT Toolchain
|
||||
LEDs
|
||||
Serial Console
|
||||
Using OpenOCD and GDB with an FT2232 JTAG emulator
|
||||
|
@ -163,189 +157,6 @@ Olimex LPC1766-STK development board
|
|||
MISO0 and MOSI0 are join via a 1K ohm resistor so the LCD appears to be
|
||||
write only.
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
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).
|
||||
|
||||
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:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
^^^^
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/lpc17xx,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/lpc17x/lpc17_vectors.S.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 olimex-lpc1766stk/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
^^^^
|
||||
|
||||
|
|
|
@ -8,204 +8,14 @@ ATSAM3U4E MCU running at 96MHz.
|
|||
Contents
|
||||
^^^^^^^^
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- AtmelStudio6.1
|
||||
- AtmelStudio 6.1
|
||||
- LEDs
|
||||
- Serial Console
|
||||
- SAM3U-EK-specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain. Testing was performed
|
||||
using the Cygwin environment.
|
||||
|
||||
GNU Toolchain Options
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
All testing has been conducted using the NuttX buildroot toolchain. To use
|
||||
other toolchains, such as the CodeSourcery, devkitARM, Atollic, or AtmelStudio
|
||||
GNU toolchain, you simply need to add one of the following configuration options
|
||||
to your .config (or defconfig) file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : Atollic toolchain for Windos
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y : Generic GCC ARM EABI toolchain for Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW=y : Generic GCC ARM EABI toolchain for Windows
|
||||
|
||||
NOTE about Windows native toolchains
|
||||
------------------------------------
|
||||
|
||||
The CodeSourcery (for Windows), Atollic, and devkitARM toolchains are
|
||||
Windows native toolchains. The CodeSourcery (for Linux), NuttX buildroot,
|
||||
and, perhaps, the generic GCC 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
^^^^
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/sam34,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/sam34/sam_vectors.S. You may need to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by an IDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 sam3u-ek/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 (and later) GCC toolchain is not compatible
|
||||
with the NXFLAT tools. See the top-level TODO file (under "Binary loaders")
|
||||
for more information about this problem. If you plan to use NXFLAT, please do
|
||||
not use the GCC 4.6.3 toochain; instead use an older toolchain (such as the GCC
|
||||
4.3.3 OABI toolchain discussed below).
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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 sam3u-ek/<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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
AtmelStudio6.1
|
||||
^^^^^^^^^^^^^^
|
||||
AtmelStudio 6.1
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
You can use AtmelStudio6.1 to load and debug code.
|
||||
|
||||
|
|
|
@ -8,12 +8,6 @@ or 120MHz.
|
|||
Contents
|
||||
========
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- Atmel Studio 6.1
|
||||
- Loading Code with J-Link
|
||||
- Loading Code OpenOCD
|
||||
|
@ -29,187 +23,6 @@ Contents
|
|||
- SAM4E-EK-specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
The NuttX make system can be configured to support the various different
|
||||
toolchain options. All testing has been conducted using the NuttX buildroot
|
||||
toolchain. To use alternative toolchain, you simply need to add change of
|
||||
the following configuration options to your .config (or defconfig) file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : Atollic toolchain for Windos
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y : Generic GCC ARM EABI toolchain for Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW=y : Generic GCC ARM EABI toolchain for Windows
|
||||
|
||||
NOTE about Windows native toolchains
|
||||
------------------------------------
|
||||
|
||||
There are basically three kinds of GCC toolchains that can be used:
|
||||
|
||||
1. A Linux native toolchain in a Linux environment,
|
||||
2. The buildroot Cygwin tool chain built in the Cygwin environment,
|
||||
3. A Windows native toolchain.
|
||||
|
||||
There are several limitations to using a Windows based toolchain (#3) 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 but you might easily find some new path problems. If so, check
|
||||
out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic
|
||||
links are used in Nuttx (e.g., include/arch). The make system works
|
||||
around these problems for the Windows tools by copying directories
|
||||
instead of linking them. But this can also cause some confusion for
|
||||
you: For example, you may edit a file in a "linked" directory and find
|
||||
that your changes had no effect. That is because you are building the
|
||||
copy of the file in the "fake" symbolic directory. If you use a
|
||||
Windows toolchain, you should get in the habit of making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/sam34,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/sam34/sam_vectors.S. You may need to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by an IDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 sam4e-ek/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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 sam4e-ek/<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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Atmel Studio 6.1
|
||||
================
|
||||
|
||||
|
|
|
@ -19,12 +19,6 @@ Contents
|
|||
^^^^^^^^
|
||||
|
||||
- Modules
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- LEDs
|
||||
- Serial Consoles
|
||||
- SAM4L Xplained Pro-specific Configuration Options
|
||||
|
@ -180,198 +174,6 @@ Modules
|
|||
A prototyping board with logic on board (other than power-related logic).
|
||||
There is no built-in support for the PROTO1 module.
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
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, ok
|
||||
4. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
All testing has been conducted using the NuttX buildroot toolchain. To use
|
||||
the CodeSourcery, devkitARM or Raisonance GNU toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : Atollic toolchain for Windos
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y : Generic GCC ARM EABI toolchain for Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW=y : Generic GCC ARM EABI toolchain for Windows
|
||||
|
||||
NOTE about Windows native toolchains
|
||||
------------------------------------
|
||||
|
||||
The CodeSourcery (for Windows), Atollic, and devkitARM toolchains are
|
||||
Windows native toolchains. The CodeSourcery (for Linux), NuttX buildroot,
|
||||
and, perhaps, the generic GCC 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
^^^^
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/sam34,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/sam34/sam_vectors.S. You may need to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by an IDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 sam4l-xplained/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
^^^^
|
||||
There are three LEDs on board the SAM4L Xplained Pro board: The EDBG
|
||||
|
|
|
@ -22,12 +22,6 @@ Contents
|
|||
^^^^^^^^
|
||||
|
||||
- PIO Muliplexing
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- Buttons and LEDs
|
||||
- Serial Consoles
|
||||
- SAM4S Xplained-specific Configuration Options
|
||||
|
@ -69,206 +63,6 @@ PIO Muliplexing
|
|||
PA30 J4.5 PC30 SMC_A12
|
||||
PA31 J1.5 PC31 SMC_A13
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Several possibile development enviorments may be use:
|
||||
|
||||
- Linux or OSX native
|
||||
- Cygwin unders Windows
|
||||
- MinGW + MSYS under Windows
|
||||
- Windows native (with GNUMake from GNUWin32).
|
||||
|
||||
All testing has been performed using Cygwin under Windows.
|
||||
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems.
|
||||
|
||||
GNU Toolchain Options
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The NuttX make system has been modified to support the several different
|
||||
toolchain options.
|
||||
|
||||
All testing has been conducted using the NuttX buildroot toolchain. To use
|
||||
the CodeSourcery, devkitARM or Raisonance GNU toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : Atollic toolchain for Windos
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y : Generic GCC ARM EABI toolchain for Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW=y : Generic GCC ARM EABI toolchain for Windows
|
||||
|
||||
If you are not using CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT, then you may also
|
||||
have to modify the PATH environment variable if your make cannot find the
|
||||
tools.
|
||||
|
||||
NOTE about Windows native toolchains
|
||||
------------------------------------
|
||||
|
||||
The CodeSourcery (for Windows), Atollic, and devkitARM toolchains are
|
||||
Windows native toolchains. The CodeSourcery (for Linux), NuttX buildroot,
|
||||
and, perhaps, the generic GCC 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: Older CodeSourcery toolchains (2009q1) do not work with default
|
||||
optimization level of -Os (See Make.defs). It will work with -O0, -O1, or
|
||||
-O2, but not with -Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
^^^^
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project (There is a simple RIDE project
|
||||
in the RIDE subdirectory).
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/sam34,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/sam34/sam_vectors.S. You may need to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 sam4s-xplained-pro/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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 sam4s-xplained-pro/<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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Buttons and LEDs
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -22,12 +22,6 @@ Contents
|
|||
^^^^^^^^
|
||||
|
||||
- PIO Muliplexing
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- Buttons and LEDs
|
||||
- Serial Consoles
|
||||
- SAM4S Xplained-specific Configuration Options
|
||||
|
@ -69,201 +63,6 @@ PIO Muliplexing
|
|||
PA30 J4.5 PC30 SMC_A12
|
||||
PA31 J1.5 PC31 SMC_A13
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Several possibile development enviorments may be use:
|
||||
|
||||
- Linux or OSX native
|
||||
- Cygwin unders Windows
|
||||
- MinGW + MSYS under Windows
|
||||
- Windows native (with GNUMake from GNUWin32).
|
||||
|
||||
All testing has been performed using Cygwin under Windows.
|
||||
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems.
|
||||
|
||||
GNU Toolchain Options
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The NuttX make system has been modified to support the several different
|
||||
toolchain options.
|
||||
|
||||
All testing has been conducted using the NuttX buildroot toolchain. To use
|
||||
the CodeSourcery, devkitARM or Raisonance GNU toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : Atollic toolchain for Windos
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y : Generic GCC ARM EABI toolchain for Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIW=y : Generic GCC ARM EABI toolchain for Windows
|
||||
|
||||
NOTE about Windows native toolchains
|
||||
------------------------------------
|
||||
|
||||
The CodeSourcery (for Windows), Atollic, and devkitARM toolchains are
|
||||
Windows native toolchains. The CodeSourcery (for Linux), NuttX buildroot,
|
||||
and, perhaps, the generic GCC 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: Older CodeSourcery toolchains (2009q1) do not work with default
|
||||
optimization level of -Os (See Make.defs). It will work with -O0, -O1, or
|
||||
-O2, but not with -Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
^^^^
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/sam34,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/sam34/sam_vectors.S. You may need to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by an IDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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.shsam4s-xplained/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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 sam4s-xplained/<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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Buttons and LEDs
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -37,12 +37,6 @@ Contents
|
|||
========
|
||||
|
||||
- STM32F107VCT Pin Usage
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI buildroot Toolchain
|
||||
- NuttX OABI buildroot Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- Shenzhou-specific Configuration Options
|
||||
- LEDs
|
||||
- Shenzhou-specific Configuration Options
|
||||
|
@ -184,240 +178,6 @@ PN NAME SIGNAL NOTES
|
|||
19 VSSA VSSA
|
||||
20 VREF- VREF-
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment because the development tools that I used only work under Windows.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain, or
|
||||
5. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
Most testing has been conducted using the CodeSourcery toolchain for Windows and
|
||||
that is the default toolchain in most configurations. To use the Atollic,
|
||||
devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains are
|
||||
Windows native toolchains. The CodeSourcery (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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI buildroot Toolchain
|
||||
==============================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 shenzhou/<sub-dir>
|
||||
|
||||
cd ..
|
||||
make context
|
||||
|
||||
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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Edit nuttx/.config to select the buildroot toolchain as described above
|
||||
and below:
|
||||
|
||||
-CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y
|
||||
+CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y
|
||||
|
||||
9. Make sure that the PATH variable includes the path to the newly built binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
detailed PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
====
|
||||
|
||||
|
@ -857,7 +617,5 @@ Where <subdir> is one of the following:
|
|||
This builds the THTTPD web server example using the THTTPD and
|
||||
the apps/examples/thttpd application.
|
||||
|
||||
NOTE: See note above with regard to the EABI/OABI buildroot
|
||||
toolchains. This example can only be built using the older
|
||||
OABI toolchain due to incompatibilities introduced in later
|
||||
GCC releases.
|
||||
NOTE: This example can only be built using the older toolchains
|
||||
due to incompatibilities introduced in later GCC releases.
|
||||
|
|
|
@ -25,12 +25,6 @@ This README discusses issues unique to NuttX configurations for the Spark Core b
|
|||
Contents
|
||||
========
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- Hardware
|
||||
- Core Pin out
|
||||
- LEDs
|
||||
|
@ -40,246 +34,6 @@ Contents
|
|||
- Spark -specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain, or
|
||||
5. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
All testing has been conducted using the CodeSourcery toolchain for Linux.
|
||||
To use the Atollic, devkitARM, Raisonance GNU, or NuttX buildroot toolchain,
|
||||
you simply need to add one of the following configuration options to your
|
||||
.config (or defconfig) file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=n : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=n : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=n : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
Also, the Atollic toolchains are the only toolchains that have built-in support for
|
||||
the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will
|
||||
need to use the Atollic toolchain for now. See the FPU section below for more
|
||||
information.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Using Sourcery CodeBench from http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/overview
|
||||
Download and install the latest version (as of this writting it was
|
||||
sourceryg++-2013.05-64-arm-none-eabi)
|
||||
|
||||
Import the project from git.
|
||||
File->import->Git-URI, then import a Exiting code as a Makefile progject
|
||||
from the working directory the git clone was done to.
|
||||
|
||||
Select the Sourcery CodeBench for ARM EABI. N.B. You must do one command line
|
||||
build, before the make will work in CodeBench.
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 stm32_tiny/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
DFU and JTAG
|
||||
============
|
||||
|
||||
|
|
|
@ -7,12 +7,6 @@ STMicro STM3210E-EVAL development board.
|
|||
Contents
|
||||
========
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- DFU and JTAG
|
||||
- OpenOCD
|
||||
- LEDs
|
||||
|
@ -22,194 +16,6 @@ Contents
|
|||
- STM3210E-EVAL-specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
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. Raisonance GNU toolchain, or
|
||||
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, devkitARM or Raisonance GNU toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), devkitARM, and Raisonance toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. You may have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by an IDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 stm3210e-eval/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
DFU and JTAG
|
||||
============
|
||||
|
||||
|
|
|
@ -7,15 +7,8 @@ STMicro STM3220G-EVAL development board.
|
|||
Contents
|
||||
========
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- STM3220G-EVAL-specific Configuration Options
|
||||
- LEDs
|
||||
- Ethernet
|
||||
- LEDs
|
||||
- PWM
|
||||
- CAN
|
||||
- FSMC SRAM
|
||||
|
@ -23,260 +16,6 @@ Contents
|
|||
- STM3220G-EVAL-specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Linux, OS X or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment because the Raisonance R-Link emulatator and some RIDE7 development tools
|
||||
were used and those tools works only under Windows.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain,
|
||||
5. The NuttX buildroot Toolchain (see below), or
|
||||
6. Any generic arm-none-eabi GNU toolchain.
|
||||
|
||||
Most testing has been conducted using the CodeSourcery toolchain for Windows and
|
||||
that is the default toolchain in most configurations. To use the Atollic
|
||||
devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL : Generic arm-none-eabi toolchain
|
||||
|
||||
The toolchain may also be set using the kconfig-mconf utility (make menuconfig)
|
||||
or by passing CONFIG_ARMV7M_TOOLCHAIN=<toolchain> to make, where <toolchain> is one
|
||||
of CODESOURCERYW, CODESOURCERYL, ATOLLOC, DEVKITARM, RAISONANCE, BUILDROOT or
|
||||
GNU_EABI as described above.
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
Generic arm-none-eabi GNU Toolchain
|
||||
-----------------------------------
|
||||
There are a number of toolchain projects providing support for the Cortex-M
|
||||
class processors, including:
|
||||
|
||||
GCC ARM Embedded
|
||||
https://developer.arm.com/open-source/gnu-toolchain/gnu-rm
|
||||
|
||||
Thumb2 Newlib Toolchain
|
||||
https://github.com/EliasOenal/TNT
|
||||
|
||||
Summon ARM Toolchain
|
||||
https://github.com/esden/summon-arm-toolchain
|
||||
|
||||
Yagarto
|
||||
http://www.yagarto.de
|
||||
|
||||
Others exist for various Linux distributions, MacPorts, etc. Any version
|
||||
based on GCC 4.6.3 or later should work.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 stm3220g-eval/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Ethernet
|
||||
========
|
||||
|
||||
|
|
|
@ -7,15 +7,8 @@ STMicro STM32140G-EVAL development board.
|
|||
Contents
|
||||
========
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- STM3240G-EVAL-specific Configuration Options
|
||||
- LEDs
|
||||
- Ethernet
|
||||
- LEDs
|
||||
- PWM
|
||||
- CAN
|
||||
- FPU
|
||||
|
@ -24,239 +17,6 @@ Contents
|
|||
- STM3240G-EVAL-specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment because the Raisonance R-Link emulatator and some RIDE7 development tools
|
||||
were used and those tools works only under Windows.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain, or
|
||||
5. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
Most testing has been conducted using the CodeSourcery toolchain for Windows and
|
||||
that is the default toolchain in most configurations (FPU-related testing has
|
||||
been performed with the Atollic toolchain for windows. To use the Atollic,
|
||||
devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains are
|
||||
Windows native toolchains. The CodeSourcery (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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
Also, the Atollic toolchains are the only toolchains that have built-in support for
|
||||
the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will
|
||||
need to use the Atollic toolchain for now. See the FPU section below for more
|
||||
information.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include paths: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 stm3240g-eval/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
Ethernet
|
||||
========
|
||||
|
||||
|
|
|
@ -11,12 +11,6 @@ is (always ?) bundled with a nRF24L01 wireless communication module.
|
|||
Contents
|
||||
========
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- LEDs
|
||||
- PWM
|
||||
- UARTs
|
||||
|
@ -24,235 +18,6 @@ Contents
|
|||
- STM32 Tiny -specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain, or
|
||||
5. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
All testing has been conducted using the CodeSourcery toolchain for Windows. To use
|
||||
the Atollic, devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
Also, the Atollic toolchains are the only toolchains that have built-in support for
|
||||
the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will
|
||||
need to use the Atollic toolchain for now. See the FPU section below for more
|
||||
information.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 stm32_tiny/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
====
|
||||
|
||||
|
|
|
@ -7,12 +7,6 @@ STMicro STM32F3Discovery development board.
|
|||
Contents
|
||||
========
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- LEDs
|
||||
- Serial Console
|
||||
- FPU
|
||||
|
@ -20,235 +14,6 @@ Contents
|
|||
- STM32F3Discovery-specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain, or
|
||||
5. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
All testing has been conducted using the CodeSourcery toolchain for Windows. To use
|
||||
the Atollic, devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
Also, the Atollic toolchains are the only toolchains that have built-in support for
|
||||
the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will
|
||||
need to use the Atollic toolchain for now. See the FPU section below for more
|
||||
information.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 STM32F3Discovery/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
====
|
||||
|
||||
|
|
|
@ -23,12 +23,6 @@ Contents
|
|||
|
||||
- Status
|
||||
- GPIO Pin Usage
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- LEDs
|
||||
- Serial Console
|
||||
- Debugging
|
||||
|
@ -185,235 +179,6 @@ GPIO Pin Usage
|
|||
LCD_SEG43/LCD_COM7
|
||||
----- --------------------- -------------------------------- ----------------
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain, or
|
||||
5. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
All testing has been conducted using the CodeSourcery toolchain for Windows. To use
|
||||
the Atollic, devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
Also, the Atollic toolchains are the only toolchains that have built-in support for
|
||||
the FPU in these configurations. If you plan to use the Cortex-M4 FPU, you will
|
||||
need to use the Atollic toolchain for now. See the FPU section below for more
|
||||
information.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 stm32ldiscovery/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
====
|
||||
|
||||
|
|
|
@ -7,241 +7,11 @@ STM32VLDiscovery (Value Line Discovery) board.
|
|||
Contents
|
||||
========
|
||||
|
||||
- Development Environment
|
||||
- GNU Toolchain Options
|
||||
- IDEs
|
||||
- NuttX EABI "buildroot" Toolchain
|
||||
- NuttX OABI "buildroot" Toolchain
|
||||
- NXFLAT Toolchain
|
||||
- LEDs
|
||||
- UARTs
|
||||
- "STMicro STM32F100RC generic" specific Configuration Options
|
||||
- Configurations
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
Toolchain Configurations
|
||||
------------------------
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The CodeSourcery GNU toolchain,
|
||||
2. The Atollic Toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. Raisonance GNU toolchain, or
|
||||
5. The NuttX buildroot Toolchain (see below).
|
||||
|
||||
All testing has been conducted using the CodeSourcery toolchain for Windows. To use
|
||||
the Atollic, devkitARM, Raisonance GNU, or NuttX buildroot toolchain, you simply need to
|
||||
add one of the following configuration options to your .config (or defconfig)
|
||||
file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_RAISONANCE=y : Raisonance RIDE7 under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Raisonance toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
The CodeSourcery Toolchain (2009q1)
|
||||
-----------------------------------
|
||||
The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
The Atollic "Pro" and "Lite" Toolchain
|
||||
--------------------------------------
|
||||
One problem that I had with the Atollic toolchains is that the provide a gcc.exe
|
||||
and g++.exe in the same bin/ file as their ARM binaries. If the Atollic bin/ path
|
||||
appears in your PATH variable before /usr/bin, then you will get the wrong gcc
|
||||
when you try to build host executables. This will cause to strange, uninterpretable
|
||||
errors build some host binaries in tools/ when you first make.
|
||||
|
||||
The Atollic "Lite" Toolchain
|
||||
----------------------------
|
||||
The free, "Lite" version of the Atollic toolchain does not support C++ nor
|
||||
does it support ar, nm, objdump, or objdcopy. If you use the Atollic "Lite"
|
||||
toolchain, you will have to set:
|
||||
|
||||
CONFIG_HAVE_CXX=n
|
||||
|
||||
In order to compile successfully. Otherwise, you will get errors like:
|
||||
|
||||
"C++ Compiler only available in TrueSTUDIO Professional"
|
||||
|
||||
The make may then fail in some of the post link processing because of some of
|
||||
the other missing tools. The Make.defs file replaces the ar and nm with
|
||||
the default system x86 tool versions and these seem to work okay. Disable all
|
||||
of the following to avoid using objcopy:
|
||||
|
||||
CONFIG_RRLOAD_BINARY=n
|
||||
CONFIG_INTELHEX_BINARY=n
|
||||
CONFIG_MOTOROLA_SREC=n
|
||||
CONFIG_RAW_BINARY=n
|
||||
|
||||
devkitARM
|
||||
---------
|
||||
The devkitARM toolchain includes a version of MSYS make. Make sure that the
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/stm32,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 stm32vldiscovery/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
====
|
||||
|
||||
|
|
|
@ -9,12 +9,6 @@ Contents
|
|||
========
|
||||
|
||||
On-Board GPIO Usage
|
||||
Development Environment
|
||||
GNU Toolchain Options
|
||||
IDEs
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
NXFLAT Toolchain
|
||||
LEDs
|
||||
Serial Console
|
||||
USB Device Controller Functions
|
||||
|
@ -334,195 +328,6 @@ Using OpenOCD and GDB with an FT2232 JTAG emulator
|
|||
2. Reset will restart the processor after loading code.
|
||||
3. The 'monitor' command can be abbreviated as just 'mon'.
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
GNU Toolchain Options
|
||||
=====================
|
||||
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
1. The NuttX buildroot Toolchain (default, see below),
|
||||
2. The CodeSourcery GNU toolchain,
|
||||
3. The devkitARM GNU toolchain,
|
||||
4. The Atollic toolchain, or
|
||||
5. The Code Red toolchain
|
||||
|
||||
All testing has been conducted using the Buildroot toolchain for Cygwin/Linux.
|
||||
To use a different toolchain, you simply need to add one of the following
|
||||
configuration options to your .config (or defconfig) file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows or Cygwin
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : The Atollic toolchain under Windows or Cygwin
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODEREDW=y : The Code Red toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODEREDL=y : The Code Red toolchain under Linux
|
||||
|
||||
CONFIG_ARMV7M_OABI_TOOLCHAIN=y : If you use an older, OABI buildroot toolchain
|
||||
|
||||
NOTE: the CodeSourcery (for Windows), Atollic, devkitARM, and Code Red (for Windows)
|
||||
toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include paths: You will need include/, arch/arm/src/tiva,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/tiva/tiva_vectors.S.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M3 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
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 tm4c123g-launchpad/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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 tm4c123g-launchpad/<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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
====
|
||||
The TM4C123G has a single RGB LED. If CONFIG_ARCH_LEDS is defined, then
|
||||
|
|
|
@ -20,12 +20,8 @@ Contents
|
|||
- Connections via the Tower Primary Connector Side B
|
||||
- TWR-SER Serial Board Connection
|
||||
o LEDs
|
||||
o Development Environment
|
||||
o GNU Toolchain Options
|
||||
o IDEs
|
||||
o NuttX EABI "buildroot" Toolchain
|
||||
o NuttX OABI "buildroot" Toolchain
|
||||
o NXFLAT Toolchain
|
||||
o TWR-K60N512-specific Configuration Options
|
||||
o Configurations
|
||||
|
||||
Kinetis TWR-K60N512 Features:
|
||||
=============================
|
||||
|
@ -285,190 +281,6 @@ as follows:
|
|||
on a small proportion of the time.
|
||||
*** LED2 may also flicker normally if signals are processed.
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
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).
|
||||
|
||||
All testing has been conducted using the CodeSourcery Windows toolchain. To
|
||||
use the devkitARM or the NuttX GNU toolchain, you simply need to change the
|
||||
the following configuration options to your .config (or defconfig) file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows) and devkitARM toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/k40,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/kinetis/k40_vectors.S.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M4 GCC toolchain (if
|
||||
different from the default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M4 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
This GNU toolchain builds and executes in the Linux or Cygwin environment.
|
||||
|
||||
NOTE: The NuttX toolchain may not include optimizations for Cortex-M4 (ARMv7E-M).
|
||||
|
||||
1. You must have already configured Nuttx in <some-dir>/nuttx.
|
||||
|
||||
cd tools
|
||||
./configure.sh twr-k60n512/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M4 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
TWR-K60N512-specific Configuration Options
|
||||
==========================================
|
||||
|
||||
|
|
|
@ -22,12 +22,8 @@ Contents
|
|||
- Connections via the Tower Primary Connector Side B
|
||||
- TWR-SER Serial Board Connection
|
||||
o LEDs
|
||||
o Development Environment
|
||||
o GNU Toolchain Options
|
||||
o IDEs
|
||||
o NuttX EABI "buildroot" Toolchain
|
||||
o NuttX OABI "buildroot" Toolchain
|
||||
o NXFLAT Toolchain
|
||||
o TWR-K64F120M-specific Configuration Options
|
||||
o Configurations
|
||||
|
||||
Kinetis TWR-K64F120M Features:
|
||||
=============================
|
||||
|
@ -413,191 +409,6 @@ as follows:
|
|||
illuminated on a small proportion of the time.
|
||||
*** LED3 may even glow faintlier then LED2 while signals are processed.
|
||||
|
||||
Development Environment
|
||||
=======================
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Linux
|
||||
environment.
|
||||
|
||||
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).
|
||||
|
||||
All testing has been conducted using the CodeSourcery Windows toolchain. To
|
||||
use the devkitARM or the NuttX GNU toolchain, you simply need to change the
|
||||
the following configuration options to your .config (or defconfig) file:
|
||||
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_IARL=y : IAR
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin
|
||||
CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL=y : GCC (default)
|
||||
|
||||
NOTE: the CodeSourcery (for Windows) and devkitARM toolchains 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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
IDEs
|
||||
====
|
||||
|
||||
NuttX is built using command-line make. It can be used with an IDE, but some
|
||||
effort will be required to create the project.
|
||||
|
||||
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).
|
||||
|
||||
Native Build
|
||||
------------
|
||||
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
|
||||
before trying to create your project. This is necessary to create
|
||||
certain auto-generated files and directories that will be needed.
|
||||
3) Set up include pathes: You will need include/, arch/arm/src/k40,
|
||||
arch/arm/src/common, arch/arm/src/armv7-m, and sched/.
|
||||
4) All assembly files need to have the definition option -D __ASSEMBLY__
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/kinetis/k40_vectors.S.
|
||||
|
||||
NuttX EABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH environment variable should
|
||||
be modified to point to the correct path to the Cortex-M4 GCC toolchain.
|
||||
|
||||
If you have no Cortex-M4 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/buildroot/downloads/).
|
||||
This GNU toolchain builds and executes in the Linux or Cygwin environment.
|
||||
|
||||
NOTE: The NuttX toolchain may not include optimizations for Cortex-M4 (ARMv7E-M).
|
||||
|
||||
1. You must have already configured Nuttx in <some-dir>/nuttx.
|
||||
|
||||
cd tools
|
||||
./configure.sh twr-k64f120m/<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-eabi-defconfig-4.6.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that the PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
details PLUS some special instructions that you will need to follow if you are
|
||||
building a Cortex-M4 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: Unfortunately, the 4.6.3 EABI toolchain is not compatible with the
|
||||
the NXFLAT tools. See the top-level TODO file (under "Binary loaders") for
|
||||
more information about this problem. If you plan to use NXFLAT, please do not
|
||||
use the GCC 4.6.3 EABI toochain; instead use the GCC 4.3.3 OABI toolchain.
|
||||
See instructions below.
|
||||
|
||||
NuttX OABI "buildroot" Toolchain
|
||||
================================
|
||||
|
||||
The older, OABI buildroot toolchain is also available. To use the OABI
|
||||
toolchain:
|
||||
|
||||
1. When building the buildroot toolchain, either (1) modify the cortexm3-eabi-defconfig-4.6.3
|
||||
configuration to use EABI (using 'make menuconfig'), or (2) use an exising OABI
|
||||
configuration such as cortexm3-defconfig-4.3.3
|
||||
|
||||
2. Modify the Make.defs file to use the OABI conventions:
|
||||
|
||||
+CROSSDEV = arm-nuttx-elf-
|
||||
+ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft
|
||||
+NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-gotoff.ld -no-check-sections
|
||||
-CROSSDEV = arm-nuttx-eabi-
|
||||
-ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft
|
||||
-NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
|
||||
|
||||
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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
TWR-K64F120M-specific Configuration Options
|
||||
==========================================
|
||||
|
||||
|
|
|
@ -8,9 +8,6 @@ Contents
|
|||
^^^^^^^^
|
||||
|
||||
ZKit-ARM LPC1769 Board
|
||||
Development Environment
|
||||
GNU Toolchain Options
|
||||
NuttX buildroot Toolchain
|
||||
LEDs
|
||||
ZKit-ARM Configuration Options
|
||||
Configurations
|
||||
|
@ -139,147 +136,6 @@ USB Device
|
|||
P1.25/MCOA1/MAT1.1 | LCD-RST LCD Reset (RSTB) - Resets Everything in LCD
|
||||
----------------------------+--------------- -------------------------------------------
|
||||
|
||||
Development Environment
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Either Linux or Cygwin on Windows can be used for the development environment.
|
||||
The source has been built only using the GNU toolchain (see below). Other
|
||||
toolchains will likely cause problems. Testing was performed using the Cygwin
|
||||
environment.
|
||||
|
||||
GNU Toolchain Options
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The NuttX make system has been modified to support the following different
|
||||
toolchain options.
|
||||
|
||||
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 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_ARMV7M_TOOLCHAIN_CODESOURCERYW=y : CodeSourcery under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=y : CodeSourcery under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=y : devkitARM under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y : NuttX buildroot under Linux or Cygwin (default)
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODEREDW=y : Code Red toolchain under Windows
|
||||
CONFIG_ARMV7M_TOOLCHAIN_CODEREDL=y : Code Red toolchain under Linux
|
||||
CONFIG_ARMV7M_TOOLCHAIN_ATOLLIC=y : The Atollic toolchain
|
||||
|
||||
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
|
||||
but you might easily find some new path problems. If so, check out 'cygpath -w'
|
||||
|
||||
2. Windows toolchains cannot follow Cygwin symbolic links. Many symbolic links
|
||||
are used in Nuttx (e.g., include/arch). The make system works around these
|
||||
problems for the Windows tools by copying directories instead of linking them.
|
||||
But this can also cause some confusion for you: For example, you may edit
|
||||
a file in a "linked" directory and find that your changes had no effect.
|
||||
That is because you are building the copy of the file in the "fake" symbolic
|
||||
directory. If you use a Windows toolchain, you should get in the habit of
|
||||
making like this:
|
||||
|
||||
make clean_context all
|
||||
|
||||
An alias in your .bashrc file might make that less painful.
|
||||
|
||||
NOTE 1: The CodeSourcery toolchain (2009q1) does not work with default optimization
|
||||
level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
|
||||
-Os.
|
||||
|
||||
NOTE 2: The devkitARM toolchain includes a version of MSYS make. Make sure that
|
||||
the paths to Cygwin's /bin and /usr/bin directories appear BEFORE the devkitARM
|
||||
path or will get the wrong version of make.
|
||||
|
||||
NuttX buildroot Toolchain
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
A GNU GCC-based toolchain is assumed. The PATH variable should be modified to
|
||||
point to the correct path to the Cortex-M3 GCC toolchain (if different from the
|
||||
default in your PATH variable).
|
||||
|
||||
If you have no Cortex-M3 toolchain, one can be downloaded from the NuttX
|
||||
Bitbucket download site (https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
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 zkit-arm-1769/<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-4.3.3 .config
|
||||
|
||||
6. make oldconfig
|
||||
|
||||
7. make
|
||||
|
||||
8. Make sure that your PATH variable includes the path to the newly built
|
||||
binaries.
|
||||
|
||||
See the file configs/README.txt in the buildroot source tree. That has more
|
||||
detailed PLUS some special instructions that you will need to follow if you
|
||||
are building a Cortex-M3 toolchain for Cygwin under Windows.
|
||||
|
||||
NOTE: The cortexm3-defconfig-4.3.3 produces an older-style is OABI toolchain.
|
||||
There is another configuration, cortexm3-eabi-defconfig-4.6.3, that will
|
||||
build a newer, EABI, toolchain. Unfortunately, the 4.6.3 EABI toolchain is
|
||||
not compatible with the NXFLAT tools. See the top-level TODO file (under
|
||||
"Binary loaders") for more information about this problem. If you plan to
|
||||
use NXFLAT, please do not use the GCC 4.6.3 EABI toochain; instead use the
|
||||
GCC 4.3.3 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 Bitbucket download site
|
||||
(https://bitbucket.org/nuttx/nuttx/downloads/).
|
||||
|
||||
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 zkit-arm-1769/<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. Make sure that the PATH variable includes the path to the newly built
|
||||
NXFLAT binaries.
|
||||
|
||||
LEDs
|
||||
^^^^
|
||||
|
||||
|
|
Loading…
Reference in a new issue