summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-06-11 14:47:03 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-06-11 14:47:03 +0000
commit94a04f9e5a37e615bc7f8809a055ed98ea36a19b (patch)
tree78aebf6ed7c5d6f6b9b81f7f81d33b71810593e1
parent3ad84ca396bbfad20398f519d4493111c2bf63a6 (diff)
downloadnuttx-94a04f9e5a37e615bc7f8809a055ed98ea36a19b.tar.gz
nuttx-94a04f9e5a37e615bc7f8809a055ed98ea36a19b.tar.bz2
nuttx-94a04f9e5a37e615bc7f8809a055ed98ea36a19b.zip
Add support for Windows GCC to lpc2148 and str711
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1875 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/ChangeLog2
-rw-r--r--nuttx/Documentation/NuttX.html54
-rw-r--r--nuttx/arch/arm/src/lpc214x/lpc214x_head.S5
-rw-r--r--nuttx/configs/eagle100/README.txt3
-rw-r--r--nuttx/configs/eagle100/httpd/ld.script1
-rw-r--r--nuttx/configs/eagle100/nettest/ld.script1
-rw-r--r--nuttx/configs/eagle100/nsh/ld.script1
-rw-r--r--nuttx/configs/eagle100/ostest/ld.script1
-rw-r--r--nuttx/configs/mcu123-lpc214x/README.txt104
-rw-r--r--nuttx/configs/mcu123-lpc214x/nsh/Make.defs55
-rw-r--r--nuttx/configs/mcu123-lpc214x/nsh/defconfig5
-rw-r--r--nuttx/configs/mcu123-lpc214x/nsh/ld.script66
-rw-r--r--nuttx/configs/mcu123-lpc214x/ostest/Make.defs55
-rw-r--r--nuttx/configs/mcu123-lpc214x/ostest/defconfig3
-rw-r--r--nuttx/configs/mcu123-lpc214x/ostest/ld.script69
-rw-r--r--nuttx/configs/mcu123-lpc214x/src/Makefile11
-rw-r--r--nuttx/configs/mcu123-lpc214x/usbserial/Make.defs55
-rw-r--r--nuttx/configs/mcu123-lpc214x/usbserial/defconfig5
-rw-r--r--nuttx/configs/mcu123-lpc214x/usbserial/ld.script71
-rw-r--r--nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs55
-rw-r--r--nuttx/configs/mcu123-lpc214x/usbstorage/defconfig5
-rw-r--r--nuttx/configs/mcu123-lpc214x/usbstorage/ld.script71
-rw-r--r--nuttx/configs/olimex-strp711/README.txt75
-rw-r--r--nuttx/configs/olimex-strp711/nsh/Make.defs55
-rw-r--r--nuttx/configs/olimex-strp711/nsh/ld.script31
-rw-r--r--nuttx/configs/olimex-strp711/ostest/Make.defs53
-rw-r--r--nuttx/configs/olimex-strp711/ostest/ld.script31
-rw-r--r--nuttx/configs/olimex-strp711/src/Makefile9
28 files changed, 738 insertions, 214 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index fe47dc264..bc2b579bf 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -770,3 +770,5 @@
* Fixed build of LM3X6918 using the CodeSourcery Windows native toolchain. There
were lots of issues with Cygwin paths and Cygwin symbolic links. These changes
may work with the devarmKIT as well, but that remains untested.
+ * The NXP LPC2148 and STR711 targets can now also be built using the CodeSourcery
+ or devkitARM Windows native toolchains.
diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html
index 7cb216ee9..66c3ecdae 100644
--- a/nuttx/Documentation/NuttX.html
+++ b/nuttx/Documentation/NuttX.html
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
- <p>Last Updated: June 09, 2009</p>
+ <p>Last Updated: June 11, 2009</p>
</td>
</tr>
</table>
@@ -784,6 +784,14 @@
support. A verified NuttShell <a href="NuttShell.html">(NSH)</a>
configuration is also available.
</p>
+ <p>
+ <b>Development Environments:</b>
+ 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU toolchain, or 3) Cygwin
+ with Windows native toolchain (CodeSourcery or devkitARM). A DIY toolchain for Linux
+ or Cygwin is provided by the NuttX
+ <a href="http://sourceforge.net/project/showfiles.php?group_id=189573&package_id=224585">buildroot</a>
+ package.
+ </p>
</td>
</tr>
<tr>
@@ -807,7 +815,15 @@
is fully functional with interrupt driven serial console. An SPI driver is available
but untested (because the Olimex card slot appears to accept only MMC cards; I have
only SD cards). Additional features are needed: USB driver, MMC integration, to name two.
- </p>
+ </p>
+ <p>
+ <b>Development Environments:</b>
+ 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU toolchain, or 3) Cygwin
+ with Windows native toolchain (CodeSourcery or devkitARM). A DIY toolchain for Linux
+ or Cygwin is provided by the NuttX
+ <a href="http://sourceforge.net/project/showfiles.php?group_id=189573&package_id=224585">buildroot</a>
+ package.
+ </p>
</td>
</tr>
<tr>
@@ -877,6 +893,14 @@
There are working configurations the NuttX OS test, to run the <a href="NuttShell.html">NuttShell
(NSH)</a>, the NuttX networking test, and the uIP web server.
</p>
+ <p>
+ <b>Development Environments:</b>
+ 1) Linux with native Linux GNU toolchain, 2) Cygwin with Cygwin GNU toolchain, or 3) Cygwin
+ with Windows native toolchain (CodeSourcery or devkitARM). A DIY toolchain for Linux
+ or Cygwin is provided by the NuttX
+ <a href="http://sourceforge.net/project/showfiles.php?group_id=189573&package_id=224585">buildroot</a>
+ package.
+ </p>
</td>
</tr>
@@ -1216,11 +1240,29 @@ m68k, m68hc11, m68hc12, and SuperH ports.</blockquote>
specific directories in place.
These copied directories make work a little more complex, but otherwise work well.
</p>
+ <li>
+ <b>Dependencies</b>
+ NuttX uses the GCC compiler's <code>-M</code> option to generate make dependencies. These
+ dependencies are retained in files called <code>Make.deps</code> throughout the system.
+ For compilers other than GCC, there is no support for making dependencies in this way.
+ For Windows native GCC compilers, the generated dependencies are windows paths and not
+ directly usable in the Cygwin make. By default, dependencies are surpressed for these
+ compilers as well.
+ </li>
+ <p><small>
+ NOTE: dependencies are suppress by setting the make variable <code>MKDEPS</code> to point
+ to the do-nothing dependency script, <code>tools/mknulldeps.sh</code>.
+ Dependencies can be enabled for the Windows native GCC compilers by setting
+ <code>MKDEPS</code> to point to <code>$(TOPDIR)/tools/mkdeps.sh --winpaths $(TOPDIR)</code>.
+ </small></p>
</ul>
<p>
- At present, only the Zilog Z16F, z8Encore, and eZ80Acclaim ports use a native Windows toolchain
- (the Zilog ZDS-II toolchain).
- </p.
+ At present, only the Zilog Z16F, z8Encore, and eZ80Acclaim ports use a non-GCC native Windows
+ toolchain(the Zilog ZDS-II toolchain).
+ Support for Windows native GCC toolchains (CodeSourcery and devkitARM) is currently implemented
+ for the NXP LPC214x, STMicro STR71x, and Luminary LMS6918 ARM ports.
+ (but could easily be extended to any other GCC-based platform with a small effort).
+ </p>
</td>
</tr>
@@ -1440,6 +1482,8 @@ nuttx-0.4.8 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
* Fixed build of LM3X6918 using the CodeSourcery Windows native toolchain. There
were lots of issues with Cygwin paths and Cygwin symbolic links. These changes
may work with the devarmKIT as well, but that remains untested.
+ * The NXP LPC2148 and STR711 targets can now also be built using the CodeSourcery
+ or devkitARM Windows native toolchains.
pascal-0.1.3 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_head.S b/nuttx/arch/arm/src/lpc214x/lpc214x_head.S
index 042262ca9..bf8948f19 100644
--- a/nuttx/arch/arm/src/lpc214x/lpc214x_head.S
+++ b/nuttx/arch/arm/src/lpc214x/lpc214x_head.S
@@ -571,8 +571,6 @@ __start:
/* Copy system .data sections to new home in RAM. */
-#ifdef CONFIG_BOOT_RUNFROMFLASH
-
adr r3, LC2
ldmia r3, {r0, r1, r2}
@@ -581,7 +579,6 @@ __start:
cmp r1, r2
blt 1b
-#endif
/* Perform early serial initialization */
mov fp, #0
@@ -615,11 +612,9 @@ LC0: .long _sbss
.long _ebss
.long _ebss+CONFIG_IDLETHREAD_STACKSIZE-4
-#ifdef CONFIG_BOOT_RUNFROMFLASH
LC2: .long _eronly /* Where .data defaults are stored in FLASH */
.long _sdata /* Where .data needs to reside in SDRAM */
.long _edata
-#endif
.size __start, .-__start
/* This global variable is unsigned long g_heapbase and is
diff --git a/nuttx/configs/eagle100/README.txt b/nuttx/configs/eagle100/README.txt
index 5875c208e..c2aa55c5c 100644
--- a/nuttx/configs/eagle100/README.txt
+++ b/nuttx/configs/eagle100/README.txt
@@ -28,7 +28,8 @@ GNU Toolchain Options
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 CodeSource GNU toolchain, you simply need to build the system as follows:
+ the CodeSourcery or devkitARM GNU toolchain, you simply need to build the
+ system as follows:
make # Will build for the devkitARM toolchain
make CROSSDEV=arm-eabi- # Will build for the devkitARM toolchain
diff --git a/nuttx/configs/eagle100/httpd/ld.script b/nuttx/configs/eagle100/httpd/ld.script
index 920dd0b07..40b2681f4 100644
--- a/nuttx/configs/eagle100/httpd/ld.script
+++ b/nuttx/configs/eagle100/httpd/ld.script
@@ -56,7 +56,6 @@ SECTIONS
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
diff --git a/nuttx/configs/eagle100/nettest/ld.script b/nuttx/configs/eagle100/nettest/ld.script
index cea96a8cf..6ed7a76c0 100644
--- a/nuttx/configs/eagle100/nettest/ld.script
+++ b/nuttx/configs/eagle100/nettest/ld.script
@@ -56,7 +56,6 @@ SECTIONS
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
diff --git a/nuttx/configs/eagle100/nsh/ld.script b/nuttx/configs/eagle100/nsh/ld.script
index c5c3ea75c..c4067e923 100644
--- a/nuttx/configs/eagle100/nsh/ld.script
+++ b/nuttx/configs/eagle100/nsh/ld.script
@@ -56,7 +56,6 @@ SECTIONS
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
diff --git a/nuttx/configs/eagle100/ostest/ld.script b/nuttx/configs/eagle100/ostest/ld.script
index b8e78afb5..49eb7d8cf 100644
--- a/nuttx/configs/eagle100/ostest/ld.script
+++ b/nuttx/configs/eagle100/ostest/ld.script
@@ -56,7 +56,6 @@ SECTIONS
*(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
*(.rodata .rodata.*)
*(.gnu.linkonce.t.*)
*(.glue_7)
diff --git a/nuttx/configs/mcu123-lpc214x/README.txt b/nuttx/configs/mcu123-lpc214x/README.txt
index 65c7c454f..b1622b3ef 100644
--- a/nuttx/configs/mcu123-lpc214x/README.txt
+++ b/nuttx/configs/mcu123-lpc214x/README.txt
@@ -1,6 +1,110 @@
README
^^^^^^
+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
+^^^^^^^^^^^^^^^^^^^^^
+
+ The NuttX make system has been modified to support the following different
+ toolchain options.
+
+ 1. The NuttX buildroot Toolchain (see below).
+ 2. The CodeSourcery GNU toolchain,
+ 3. The devkitARM GNU toolchain, or
+
+ All testing has been conducted using the NuttX buildroot toolchain. To use
+ the CodeSourcery or devkitARM GNU toolchain, you simply need to build the
+ system as follows:
+
+ make # Will build for the NuttX buildroot toolchain
+ make CROSSDEV=arm-eabi- # Will build for the devkitARM toolchain
+ make CROSSDEV=arm-none-eabi- # Will build for the CodeSourcery toolchain
+ make CROSSDEV=arm-elf- # Will build for the NuttX buildroot toolchain
+
+ Of course, hard coding this CROSS_COMPILE value in Make.defs file will save
+ some repetitive typing.
+
+ NOTE: the CodeSourcery and devkitARM toolchains are Windows native toolchains.
+ The NuttX buildroot toolchain is a Cygwin toolchain. 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 not 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; make CROSSDEV=arm-none-eabi-
+
+ An alias in your .bashrc file might make that less painful.
+
+ 3. Dependencies are not made when using Windows versions of the GCC. This is
+ because the dependencies are generated using Windows pathes which do not
+ work with the Cygwin make.
+
+ Support has been added for making dependencies with the CodeSourcery toolchain.
+ That support can be enabled by modifying your Make.defs file as follows:
+
+ - MKDEP = $(TOPDIR)/tools/mknulldeps.sh
+ + MKDEP = $(TOPDIR)/tools/mkdeps.sh --winpaths "$(TOPDIR)"
+
+ If you have problems with the dependency build (for example, if you are not
+ building on C:), then you may need to modify tools/mkdeps.sh
+
+ NOTE: The CodeSourcery toolchain (2009q1) may not work with default optimization
+ level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
+ -Os.
+
+NuttX buildroot Toolchain
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ A GNU GCC-based toolchain is assumed. The files */setenv.sh 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
+ SourceForge download site (https://sourceforge.net/project/showfiles.php?group_id=189573).
+ This GNU toolchain builds and executes in the 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-defconfig-4.3.3 .config
+
+ 6. make oldconfig
+
+ 7. make
+
+ 8. Edit setenv.h, if necessary, so 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.
+
Toolchain
^^^^^^^^^
diff --git a/nuttx/configs/mcu123-lpc214x/nsh/Make.defs b/nuttx/configs/mcu123-lpc214x/nsh/Make.defs
index b306fb1c8..57f621ef7 100644
--- a/nuttx/configs/mcu123-lpc214x/nsh/Make.defs
+++ b/nuttx/configs/mcu123-lpc214x/nsh/Make.defs
@@ -1,7 +1,7 @@
##############################################################################
# configs/mcu123-lpc214x/nsh/Make.defs
#
-# Copyright (C) 2008 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -35,8 +35,15 @@
include ${TOPDIR}/.config
+# The default value for CROSSDEV can be overridden from the make command line:
+# make -- Will build for the NuttX buildroot toolchain
+# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
+# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
+# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain
+
CROSSDEV = arm-elf-
CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
@@ -58,23 +65,41 @@ endif
ifeq ("${CONFIG_DEBUG}","y")
ARCHOPTIMIZATION = -g
else
- ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce \
- -fomit-frame-pointer
+ ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ifeq ($(ARCHCCMAJOR),4)
- ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft -fno-builtin
+ ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft
else
- ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float -fno-builtin
+ ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float
endif
+
+ifeq ($(CROSSDEV),arm-elf-)
+ MKDEP = $(TOPDIR)/tools/mkdeps.sh
+ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script
+else
+ WINTOOL = y
+ DIRLINK = $(TOPDIR)/tools/winlink.sh
+ DIRUNLINK = $(TOPDIR)/tools/unlink.sh
+ MKDEP = $(TOPDIR)/tools/mknulldeps.sh
+ ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
+ ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script}"
+endif
+
+ARCHCFLAGS = -fno-builtin
+ARCHCXXFLAGS = -fno-builtin -fno-exceptions
ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
ARCHDEFINES =
-ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
-ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
@@ -82,7 +107,10 @@ OBJEXT = .o
LIBEXT = .a
EXEEXT =
-ifeq ("${CONFIG_DEBUG}","y")
+ifneq ($(CROSSDEV),arm-elf-)
+ LDFLAGS += -nostartfiles -nodefaultlibs
+endif
+ifeq ($(CONFIG_DEBUG),y)
LDFLAGS += -g
endif
@@ -96,6 +124,11 @@ define COMPILE
@$(CC) -c $(CFLAGS) $1 -o $2
endef
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
@@ -110,10 +143,8 @@ define CLEAN
@rm -f *.o *.a
endef
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
-
HOSTCC = gcc
HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
+HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
diff --git a/nuttx/configs/mcu123-lpc214x/nsh/defconfig b/nuttx/configs/mcu123-lpc214x/nsh/defconfig
index 23366a1ea..f7a65c730 100644
--- a/nuttx/configs/mcu123-lpc214x/nsh/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/nsh/defconfig
@@ -1,7 +1,7 @@
############################################################################
# configs/mcu123-lpc214x/nsh/defconfig
#
-# Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -577,6 +577,7 @@ CONFIG_EXAMPLES_NSH_MMCSDMINOR=0
#
# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
# operation from FLASH but must copy initialized .data sections to RAM.
+# (Must always =n; the LPC214x always runs from FLASH)
# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
# but copy themselves entirely into RAM for better performance.
# CONFIG_CUSTOM_STACK - The up_ implementation will handle
@@ -594,7 +595,7 @@ CONFIG_EXAMPLES_NSH_MMCSDMINOR=0
# CONFIG_HEAP_BASE - The beginning of the heap
# CONFIG_HEAP_SIZE - The size of the heap
#
-CONFIG_BOOT_RUNFROMFLASH=y
+CONFIG_BOOT_RUNFROMFLASH=n
CONFIG_BOOT_COPYTORAM=n
CONFIG_CUSTOM_STACK=n
CONFIG_STACK_POINTER=
diff --git a/nuttx/configs/mcu123-lpc214x/nsh/ld.script b/nuttx/configs/mcu123-lpc214x/nsh/ld.script
index 849f8492e..dfc44db5e 100644
--- a/nuttx/configs/mcu123-lpc214x/nsh/ld.script
+++ b/nuttx/configs/mcu123-lpc214x/nsh/ld.script
@@ -1,7 +1,7 @@
/****************************************************************************
* configs/mcu123-lpc214x/nsh/ld.script
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,59 +33,75 @@
*
****************************************************************************/
+/* FLASH:
+ * The lpc2148 has 512Kb of non-volatile memory beginning at address
+ * 0x00000000. The OS entry point is via the reset vector at address
+ * 0x00000000 (default MEMMAP mode assumed)
+ *
+ * SRAM:
+ * The lpc2148 has 32Kb of on-chip static RAM beginning at address
+ * 0x40000000. The .data section will be relocated from _eronly
+ * to _sdata at boot time.
+ */
+
MEMORY
{
- flash (rx) : ORIGIN = 0, LENGTH = 500K
- ram (rw) : ORIGIN = 0x40000000, LENGTH = 32K - 32
+ flash (rx) : ORIGIN = 0x00000000, LENGTH = 500K
+ sram (rw) : ORIGIN = 0x40000000, LENGTH = 32K - 32
}
OUTPUT_ARCH(arm)
ENTRY(_stext)
SECTIONS
{
- /* The lpc2148 has 512Kb of non-volatile memory beginning at address
- * 0x00000000. The OS entry point is via the reset vector at address
- * 0x00000000 (default MEMMAP mode assumed)
- */
-
.text : {
_stext = ABSOLUTE(.);
- *(.text)
+ *(.vectors)
+ *(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
- *(.rodata.str1.4)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
- *(.got) /* Global offset table */
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
} > flash
- _eronly = ABSOLUTE(.); /* This is where the .data section
- * is relocated for execution out
- * FLASH */
- /* The lpc2148 has 32Kb of on-chip static RAM beginning at address
- * 0x40000000. The .data section will be relocated from _eronly
+ /* This is where the .data section is relocated for execution out
+ * FLASH. The .data section will be relocated from _eronly
* to _sdata at boot time.
*/
+ _eronly = ABSOLUTE(.);
+
.data : {
_sdata = ABSOLUTE(.);
- *(.data)
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
- } >ram AT>flash
+ } > sram AT > flash
+
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >sram
+
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } >sram
- . = ALIGN(32 / 8);
- .bss : { /* BSS */
+ .bss : {
_sbss = ABSOLUTE(.);
- *(.bss)
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
- }
+ } > sram
- . = ALIGN(32 / 8);
- /* Stabs debugging sections. */
+ /* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
diff --git a/nuttx/configs/mcu123-lpc214x/ostest/Make.defs b/nuttx/configs/mcu123-lpc214x/ostest/Make.defs
index f1c6bb7ca..1d5ededb0 100644
--- a/nuttx/configs/mcu123-lpc214x/ostest/Make.defs
+++ b/nuttx/configs/mcu123-lpc214x/ostest/Make.defs
@@ -1,7 +1,7 @@
##############################################################################
# configs/mcu123-lpc214x/ostest/Make.defs
#
-# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+# Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -35,8 +35,15 @@
include ${TOPDIR}/.config
+# The default value for CROSSDEV can be overridden from the make command line:
+# make -- Will build for the NuttX buildroot toolchain
+# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
+# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
+# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain
+
CROSSDEV = arm-elf-
CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
@@ -58,23 +65,41 @@ endif
ifeq ("${CONFIG_DEBUG}","y")
ARCHOPTIMIZATION = -g
else
- ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce \
- -fomit-frame-pointer
+ ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ifeq ($(ARCHCCMAJOR),4)
- ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft -fno-builtin
+ ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft
else
- ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float -fno-builtin
+ ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float
endif
+
+ifeq ($(CROSSDEV),arm-elf-)
+ MKDEP = $(TOPDIR)/tools/mkdeps.sh
+ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
+else
+ WINTOOL = y
+ DIRLINK = $(TOPDIR)/tools/winlink.sh
+ DIRUNLINK = $(TOPDIR)/tools/unlink.sh
+ MKDEP = $(TOPDIR)/tools/mknulldeps.sh
+ ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
+ ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}"
+endif
+
+ARCHCFLAGS = -fno-builtin
+ARCHCXXFLAGS = -fno-builtin -fno-exceptions
ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
ARCHDEFINES =
-ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
-ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
@@ -82,7 +107,10 @@ OBJEXT = .o
LIBEXT = .a
EXEEXT =
-ifeq ("${CONFIG_DEBUG}","y")
+ifneq ($(CROSSDEV),arm-elf-)
+ LDFLAGS += -nostartfiles -nodefaultlibs
+endif
+ifeq ($(CONFIG_DEBUG),y)
LDFLAGS += -g
endif
@@ -96,6 +124,11 @@ define COMPILE
@$(CC) -c $(CFLAGS) $1 -o $2
endef
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
@@ -110,10 +143,8 @@ define CLEAN
@rm -f *.o *.a
endef
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
-
HOSTCC = gcc
HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
+HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
diff --git a/nuttx/configs/mcu123-lpc214x/ostest/defconfig b/nuttx/configs/mcu123-lpc214x/ostest/defconfig
index 142023777..98f9f34b1 100644
--- a/nuttx/configs/mcu123-lpc214x/ostest/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/ostest/defconfig
@@ -563,6 +563,7 @@ CONFIG_EXAMPLES_NSH_MMCSDMINOR=0
#
# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
# operation from FLASH but must copy initialized .data sections to RAM.
+# (Must always =n; the LPC214x always runs from FLASH)
# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
# but copy themselves entirely into RAM for better performance.
# CONFIG_CUSTOM_STACK - The up_ implementation will handle
@@ -580,7 +581,7 @@ CONFIG_EXAMPLES_NSH_MMCSDMINOR=0
# CONFIG_HEAP_BASE - The beginning of the heap
# CONFIG_HEAP_SIZE - The size of the heap
#
-CONFIG_BOOT_RUNFROMFLASH=y
+CONFIG_BOOT_RUNFROMFLASH=n
CONFIG_BOOT_COPYTORAM=n
CONFIG_CUSTOM_STACK=n
CONFIG_STACK_POINTER=
diff --git a/nuttx/configs/mcu123-lpc214x/ostest/ld.script b/nuttx/configs/mcu123-lpc214x/ostest/ld.script
index 04e381b8b..344fdd6d1 100644
--- a/nuttx/configs/mcu123-lpc214x/ostest/ld.script
+++ b/nuttx/configs/mcu123-lpc214x/ostest/ld.script
@@ -33,52 +33,75 @@
*
****************************************************************************/
+/* FLASH:
+ * The lpc2148 has 512Kb of non-volatile memory beginning at address
+ * 0x00000000. The OS entry point is via the reset vector at address
+ * 0x00000000 (default MEMMAP mode assumed)
+ *
+ * SRAM:
+ * The lpc2148 has 32Kb of on-chip static RAM beginning at address
+ * 0x40000000. The .data section will be relocated from _eronly
+ * to _sdata at boot time.
+ */
+
+MEMORY
+{
+ flash (rx) : ORIGIN = 0x00000000, LENGTH = 500K
+ sram (rw) : ORIGIN = 0x40000000, LENGTH = 32K - 32
+}
+
OUTPUT_ARCH(arm)
ENTRY(_stext)
SECTIONS
{
- /* The lpc2148 has 512Kb of non-volatile memory beginning at address
- * 0x00000000. The OS entry point is via the reset vector at address
- * 0x00000000 (default MEMMAP mode assumed)
- */
-
- . = 0x00000000;
.text : {
_stext = ABSOLUTE(.);
- *(.text)
+ *(.vectors)
+ *(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
- *(.rodata.str1.4)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
- *(.got) /* Global offset table */
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
- }
- _eronly = ABSOLUTE(.); /* This is where the .data section
- * is relocated for execution out
- * FLASH */
+ } > flash
- /* The lpc2148 has 32Kb of on-chip static RAM beginning at address
- * 0x40000000. The .data section will be relocated from _eronly
+ /* This is where the .data section is relocated for execution out
+ * FLASH. The .data section will be relocated from _eronly
* to _sdata at boot time.
*/
- . = 0x40000000;
+ _eronly = ABSOLUTE(.);
+
.data : {
_sdata = ABSOLUTE(.);
- *(.data)
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
- }
+ } > sram AT > flash
+
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >sram
- .bss : { /* BSS */
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } >sram
+
+ .bss : {
_sbss = ABSOLUTE(.);
- *(.bss)
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
- }
- /* Stabs debugging sections. */
+ } > sram
+
+ /* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
diff --git a/nuttx/configs/mcu123-lpc214x/src/Makefile b/nuttx/configs/mcu123-lpc214x/src/Makefile
index 2dbb86362..ab71e0cce 100644
--- a/nuttx/configs/mcu123-lpc214x/src/Makefile
+++ b/nuttx/configs/mcu123-lpc214x/src/Makefile
@@ -1,7 +1,7 @@
############################################################################
# configs/mcu123-lpc214x/src/Makefile
#
-# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
+# Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -36,7 +36,14 @@
-include $(TOPDIR)/Make.defs
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
-CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/arm -I$(TOPDIR)/sched
+ifeq ($(WINTOOL),y)
+ CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
+ -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
+ -I "${shell cygpath -w $(ARCH_SRCDIR)/arm}" \
+ -I "${shell cygpath -w $(ARCH_SRCDIR)/sched}"
+else
+ CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/arm -I$(TOPDIR)/sched
+endif
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
diff --git a/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs b/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs
index c2888512f..8df0be010 100644
--- a/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs
+++ b/nuttx/configs/mcu123-lpc214x/usbserial/Make.defs
@@ -1,7 +1,7 @@
##############################################################################
# configs/mcu123-lpc214x/usbserial/Make.defs
#
-# Copyright (C) 2008 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -35,8 +35,15 @@
include ${TOPDIR}/.config
+# The default value for CROSSDEV can be overridden from the make command line:
+# make -- Will build for the NuttX buildroot toolchain
+# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
+# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
+# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain
+
CROSSDEV = arm-elf-
CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
@@ -58,23 +65,41 @@ endif
ifeq ("${CONFIG_DEBUG}","y")
ARCHOPTIMIZATION = -g
else
- ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce \
- -fomit-frame-pointer
+ ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ifeq ($(ARCHCCMAJOR),4)
- ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft -fno-builtin
+ ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft
else
- ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float -fno-builtin
+ ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float
endif
+
+ifeq ($(CROSSDEV),arm-elf-)
+ MKDEP = $(TOPDIR)/tools/mkdeps.sh
+ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbserial/ld.script
+else
+ WINTOOL = y
+ DIRLINK = $(TOPDIR)/tools/winlink.sh
+ DIRUNLINK = $(TOPDIR)/tools/unlink.sh
+ MKDEP = $(TOPDIR)/tools/mknulldeps.sh
+ ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
+ ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbserial/ld.script}"
+endif
+
+ARCHCFLAGS = -fno-builtin
+ARCHCXXFLAGS = -fno-builtin -fno-exceptions
ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
ARCHDEFINES =
-ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
-ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbserial/ld.script
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
@@ -82,7 +107,10 @@ OBJEXT = .o
LIBEXT = .a
EXEEXT =
-ifeq ("${CONFIG_DEBUG}","y")
+ifneq ($(CROSSDEV),arm-elf-)
+ LDFLAGS += -nostartfiles -nodefaultlibs
+endif
+ifeq ($(CONFIG_DEBUG),y)
LDFLAGS += -g
endif
@@ -96,6 +124,11 @@ define COMPILE
@$(CC) -c $(CFLAGS) $1 -o $2
endef
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
@@ -110,10 +143,8 @@ define CLEAN
@rm -f *.o *.a
endef
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
-
HOSTCC = gcc
HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
+HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
diff --git a/nuttx/configs/mcu123-lpc214x/usbserial/defconfig b/nuttx/configs/mcu123-lpc214x/usbserial/defconfig
index 7760edbe5..60bf4e5ae 100644
--- a/nuttx/configs/mcu123-lpc214x/usbserial/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/usbserial/defconfig
@@ -1,7 +1,7 @@
############################################################################
# configs/mcu123-lpc214x/usbserial/defconfig
#
-# Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -584,6 +584,7 @@ CONFIG_EXAMPLES_USBSERIAL_ONLYBIG=n
#
# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
# operation from FLASH but must copy initialized .data sections to RAM.
+# (Must always =n; the LPC214x always runs from FLASH)
# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
# but copy themselves entirely into RAM for better performance.
# CONFIG_CUSTOM_STACK - The up_ implementation will handle
@@ -601,7 +602,7 @@ CONFIG_EXAMPLES_USBSERIAL_ONLYBIG=n
# CONFIG_HEAP_BASE - The beginning of the heap
# CONFIG_HEAP_SIZE - The size of the heap
#
-CONFIG_BOOT_RUNFROMFLASH=y
+CONFIG_BOOT_RUNFROMFLASH=n
CONFIG_BOOT_COPYTORAM=n
CONFIG_CUSTOM_STACK=n
CONFIG_STACK_POINTER=
diff --git a/nuttx/configs/mcu123-lpc214x/usbserial/ld.script b/nuttx/configs/mcu123-lpc214x/usbserial/ld.script
index d16b9e8e1..bcfb4c738 100644
--- a/nuttx/configs/mcu123-lpc214x/usbserial/ld.script
+++ b/nuttx/configs/mcu123-lpc214x/usbserial/ld.script
@@ -1,7 +1,7 @@
/****************************************************************************
* configs/mcu123-lpc214x/usbserial/ld.script
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,52 +33,75 @@
*
****************************************************************************/
+/* FLASH:
+ * The lpc2148 has 512Kb of non-volatile memory beginning at address
+ * 0x00000000. The OS entry point is via the reset vector at address
+ * 0x00000000 (default MEMMAP mode assumed)
+ *
+ * SRAM:
+ * The lpc2148 has 32Kb of on-chip static RAM beginning at address
+ * 0x40000000. The .data section will be relocated from _eronly
+ * to _sdata at boot time.
+ */
+
+MEMORY
+{
+ flash (rx) : ORIGIN = 0x00000000, LENGTH = 500K
+ sram (rw) : ORIGIN = 0x40000000, LENGTH = 32K - 32
+}
+
OUTPUT_ARCH(arm)
ENTRY(_stext)
SECTIONS
{
- /* The lpc2148 has 512Kb of non-volatile memory beginning at address
- * 0x00000000. The OS entry point is via the reset vector at address
- * 0x00000000 (default MEMMAP mode assumed)
- */
-
- . = 0x00000000;
.text : {
_stext = ABSOLUTE(.);
- *(.text)
+ *(.vectors)
+ *(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
- *(.rodata.str1.4)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
- *(.got) /* Global offset table */
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
- }
- _eronly = ABSOLUTE(.); /* This is where the .data section
- * is relocated for execution out
- * FLASH */
+ } > flash
- /* The lpc2148 has 32Kb of on-chip static RAM beginning at address
- * 0x40000000. The .data section will be relocated from _eronly
+ /* This is where the .data section is relocated for execution out
+ * FLASH. The .data section will be relocated from _eronly
* to _sdata at boot time.
*/
- . = 0x40000000;
+ _eronly = ABSOLUTE(.);
+
.data : {
_sdata = ABSOLUTE(.);
- *(.data)
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
- }
+ } > sram AT > flash
+
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >sram
- .bss : { /* BSS */
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } >sram
+
+ .bss : {
_sbss = ABSOLUTE(.);
- *(.bss)
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
- }
- /* Stabs debugging sections. */
+ } > sram
+
+ /* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
diff --git a/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs b/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs
index 224a7739c..bdde83ef5 100644
--- a/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs
+++ b/nuttx/configs/mcu123-lpc214x/usbstorage/Make.defs
@@ -1,7 +1,7 @@
##############################################################################
# configs/mcu123-lpc214x/usbstorage/Make.defs
#
-# Copyright (C) 2008 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -35,8 +35,15 @@
include ${TOPDIR}/.config
+# The default value for CROSSDEV can be overridden from the make command line:
+# make -- Will build for the NuttX buildroot toolchain
+# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
+# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
+# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain
+
CROSSDEV = arm-elf-
CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
@@ -58,23 +65,41 @@ endif
ifeq ("${CONFIG_DEBUG}","y")
ARCHOPTIMIZATION = -g
else
- ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce \
- -fomit-frame-pointer
+ ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ifeq ($(ARCHCCMAJOR),4)
- ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft -fno-builtin
+ ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft
else
- ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float -fno-builtin
+ ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float
endif
+
+ifeq ($(CROSSDEV),arm-elf-)
+ MKDEP = $(TOPDIR)/tools/mkdeps.sh
+ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbstorage/ld.script
+else
+ WINTOOL = y
+ DIRLINK = $(TOPDIR)/tools/winlink.sh
+ DIRUNLINK = $(TOPDIR)/tools/unlink.sh
+ MKDEP = $(TOPDIR)/tools/mknulldeps.sh
+ ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
+ ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbstorage/ld.script}"
+endif
+
+ARCHCFLAGS = -fno-builtin
+ARCHCXXFLAGS = -fno-builtin -fno-exceptions
ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
ARCHDEFINES =
-ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
-ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/usbstorage/ld.script
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
@@ -82,7 +107,10 @@ OBJEXT = .o
LIBEXT = .a
EXEEXT =
-ifeq ("${CONFIG_DEBUG}","y")
+ifneq ($(CROSSDEV),arm-elf-)
+ LDFLAGS += -nostartfiles -nodefaultlibs
+endif
+ifeq ($(CONFIG_DEBUG),y)
LDFLAGS += -g
endif
@@ -96,6 +124,11 @@ define COMPILE
@$(CC) -c $(CFLAGS) $1 -o $2
endef
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
@@ -110,10 +143,8 @@ define CLEAN
@rm -f *.o *.a
endef
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
-
HOSTCC = gcc
HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
+HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
diff --git a/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig b/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig
index 99750003d..8394375a6 100644
--- a/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig
+++ b/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig
@@ -1,7 +1,7 @@
############################################################################
# configs/mcu123-lpc214x/usbstorage/defconfig
#
-# Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -626,6 +626,7 @@ CONFIG_EXAMPLES_USBSTRG_TRACEINTERRUPTS=n
#
# CONFIG_BOOT_RUNFROMFLASH - Some configurations support XIP
# operation from FLASH but must copy initialized .data sections to RAM.
+# (Must always =n; the LPC214x always runs from FLASH)
# CONFIG_BOOT_COPYTORAM - Some configurations boot in FLASH
# but copy themselves entirely into RAM for better performance.
# CONFIG_CUSTOM_STACK - The up_ implementation will handle
@@ -643,7 +644,7 @@ CONFIG_EXAMPLES_USBSTRG_TRACEINTERRUPTS=n
# CONFIG_HEAP_BASE - The beginning of the heap
# CONFIG_HEAP_SIZE - The size of the heap
#
-CONFIG_BOOT_RUNFROMFLASH=y
+CONFIG_BOOT_RUNFROMFLASH=n
CONFIG_BOOT_COPYTORAM=n
CONFIG_CUSTOM_STACK=n
CONFIG_STACK_POINTER=
diff --git a/nuttx/configs/mcu123-lpc214x/usbstorage/ld.script b/nuttx/configs/mcu123-lpc214x/usbstorage/ld.script
index a32980fde..2236cd7ca 100644
--- a/nuttx/configs/mcu123-lpc214x/usbstorage/ld.script
+++ b/nuttx/configs/mcu123-lpc214x/usbstorage/ld.script
@@ -1,7 +1,7 @@
/****************************************************************************
* configs/mcu123-lpc214x/usbstorage/ld.script
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -33,52 +33,75 @@
*
****************************************************************************/
+/* FLASH:
+ * The lpc2148 has 512Kb of non-volatile memory beginning at address
+ * 0x00000000. The OS entry point is via the reset vector at address
+ * 0x00000000 (default MEMMAP mode assumed)
+ *
+ * SRAM:
+ * The lpc2148 has 32Kb of on-chip static RAM beginning at address
+ * 0x40000000. The .data section will be relocated from _eronly
+ * to _sdata at boot time.
+ */
+
+MEMORY
+{
+ flash (rx) : ORIGIN = 0x00000000, LENGTH = 500K
+ sram (rw) : ORIGIN = 0x40000000, LENGTH = 32K - 32
+}
+
OUTPUT_ARCH(arm)
ENTRY(_stext)
SECTIONS
{
- /* The lpc2148 has 512Kb of non-volatile memory beginning at address
- * 0x00000000. The OS entry point is via the reset vector at address
- * 0x00000000 (default MEMMAP mode assumed)
- */
-
- . = 0x00000000;
.text : {
_stext = ABSOLUTE(.);
- *(.text)
+ *(.vectors)
+ *(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
- *(.rodata.str1.4)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
- *(.got) /* Global offset table */
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
- }
- _eronly = ABSOLUTE(.); /* This is where the .data section
- * is relocated for execution out
- * FLASH */
+ } > flash
- /* The lpc2148 has 32Kb of on-chip static RAM beginning at address
- * 0x40000000. The .data section will be relocated from _eronly
+ /* This is where the .data section is relocated for execution out
+ * FLASH. The .data section will be relocated from _eronly
* to _sdata at boot time.
*/
- . = 0x40000000;
+ _eronly = ABSOLUTE(.);
+
.data : {
_sdata = ABSOLUTE(.);
- *(.data)
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
- }
+ } > sram AT > flash
+
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >sram
- .bss : { /* BSS */
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } >sram
+
+ .bss : {
_sbss = ABSOLUTE(.);
- *(.bss)
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
- }
- /* Stabs debugging sections. */
+ } > sram
+
+ /* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
diff --git a/nuttx/configs/olimex-strp711/README.txt b/nuttx/configs/olimex-strp711/README.txt
index fd918b037..c9b4482b2 100644
--- a/nuttx/configs/olimex-strp711/README.txt
+++ b/nuttx/configs/olimex-strp711/README.txt
@@ -57,14 +57,81 @@ Olimex STR-P711
Jumpers
STNBY Will pull pin 23 /STDBY low
-Toolchain
-^^^^^^^^^
+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
+^^^^^^^^^^^^^^^^^^^^^
+
+ The NuttX make system has been modified to support the following different
+ toolchain options.
+
+ 1. The NuttX buildroot Toolchain (see below).
+ 2. The CodeSourcery GNU toolchain,
+ 3. The devkitARM GNU toolchain, or
+
+ All testing has been conducted using the NuttX buildroot toolchain. To use
+ the CodeSourcery or devkitARM GNU toolchain, you simply need to build the
+ system as follows:
+
+ make # Will build for the NuttX buildroot toolchain
+ make CROSSDEV=arm-eabi- # Will build for the devkitARM toolchain
+ make CROSSDEV=arm-none-eabi- # Will build for the CodeSourcery toolchain
+ make CROSSDEV=arm-elf- # Will build for the NuttX buildroot toolchain
+
+ Of course, hard coding this CROSS_COMPILE value in Make.defs file will save
+ some repetitive typing.
+
+ NOTE: the CodeSourcery and devkitARM toolchains are Windows native toolchains.
+ The NuttX buildroot toolchain is a Cygwin toolchain. 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 not 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; make CROSSDEV=arm-none-eabi-
+
+ An alias in your .bashrc file might make that less painful.
+
+ 3. Dependencies are not made when using Windows versions of the GCC. This is
+ because the dependencies are generated using Windows pathes which do not
+ work with the Cygwin make.
+
+ Support has been added for making dependencies with the CodeSourcery toolchain.
+ That support can be enabled by modifying your Make.defs file as follows:
+
+ - MKDEP = $(TOPDIR)/tools/mknulldeps.sh
+ + MKDEP = $(TOPDIR)/tools/mkdeps.sh --winpaths "$(TOPDIR)"
+
+ If you have problems with the dependency build (for example, if you are not
+ building on C:), then you may need to modify tools/mkdeps.sh
+
+ NOTE: The CodeSourcery toolchain (2009q1) may not work with default optimization
+ level of -Os (See Make.defs). It will work with -O0, -O1, or -O2, but not with
+ -Os.
+
+NuttX buildroot Toolchain
+^^^^^^^^^^^^^^^^^^^^^^^^^
A GNU GCC-based toolchain is assumed. The files */setenv.sh should
- be modified to point to the correct path to the SH toolchain (if
+ be modified to point to the correct path to the ARM toolchain (if
different from the default).
- If you have no SH toolchain, one can be downloaded from the NuttX
+ If you have no ARM toolchain, one can be downloaded from the NuttX
SourceForge download site (https://sourceforge.net/project/showfiles.php?group_id=189573).
1. You must have already configured Nuttx in <some-dir>nuttx.
diff --git a/nuttx/configs/olimex-strp711/nsh/Make.defs b/nuttx/configs/olimex-strp711/nsh/Make.defs
index d3c96b5de..bb6d5dace 100644
--- a/nuttx/configs/olimex-strp711/nsh/Make.defs
+++ b/nuttx/configs/olimex-strp711/nsh/Make.defs
@@ -1,7 +1,7 @@
##############################################################################
# configs/olimex-strp711/nsh/Make.defs
#
-# Copyright (C) 2009 Gregory Nutt. All rights reserved.
+# Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@@ -35,8 +35,15 @@
include ${TOPDIR}/.config
+# The default value for CROSSDEV can be overridden from the make command line:
+# make -- Will build for the NuttX buildroot toolchain
+# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
+# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
+# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain
+
CROSSDEV = arm-elf-
CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
@@ -58,23 +65,41 @@ endif
ifeq ("${CONFIG_DEBUG}","y")
ARCHOPTIMIZATION = -g
else
- ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce \
- -fomit-frame-pointer
+ ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ifeq ($(ARCHCCMAJOR),4)
- ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft -fno-builtin
+ ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft
else
- ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float -fno-builtin
+ ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float
endif
+
+ifeq ($(CROSSDEV),arm-elf-)
+ MKDEP = $(TOPDIR)/tools/mkdeps.sh
+ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script
+else
+ WINTOOL = y
+ DIRLINK = $(TOPDIR)/tools/winlink.sh
+ DIRUNLINK = $(TOPDIR)/tools/unlink.sh
+ MKDEP = $(TOPDIR)/tools/mknulldeps.sh
+ ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
+ ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script}"
+endif
+
+ARCHCFLAGS = -fno-builtin
+ARCHCXXFLAGS = -fno-builtin -fno-exceptions
ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
ARCHDEFINES =
-ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
-ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/nsh/ld.script
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
@@ -82,7 +107,10 @@ OBJEXT = .o
LIBEXT = .a
EXEEXT =
-ifeq ("${CONFIG_DEBUG}","y")
+ifneq ($(CROSSDEV),arm-elf-)
+ LDFLAGS += -nostartfiles -nodefaultlibs
+endif
+ifeq ($(CONFIG_DEBUG),y)
LDFLAGS += -g
endif
@@ -96,6 +124,11 @@ define COMPILE
@$(CC) -c $(CFLAGS) $1 -o $2
endef
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
@@ -110,10 +143,8 @@ define CLEAN
@rm -f *.o *.a
endef
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
-
HOSTCC = gcc
HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
+HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
diff --git a/nuttx/configs/olimex-strp711/nsh/ld.script b/nuttx/configs/olimex-strp711/nsh/ld.script
index 8d99adce6..34c7a4edb 100644
--- a/nuttx/configs/olimex-strp711/nsh/ld.script
+++ b/nuttx/configs/olimex-strp711/nsh/ld.script
@@ -1,7 +1,7 @@
/****************************************************************************
* configs/olimex-strp711/nsh/ld.script
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -60,14 +60,16 @@ SECTIONS
.text : {
_stext = ABSOLUTE(.);
*(.vectors)
- *(.text)
+ *(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
- *(.rodata.str1.*)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
- *(.got) /* Global offset table */
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
} > flash
@@ -80,18 +82,29 @@ SECTIONS
.data : {
_sdata = ABSOLUTE(.);
- *(.data)
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram AT > flash
- .bss : { /* BSS */
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >sram
+
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } >sram
+
+ .bss : {
_sbss = ABSOLUTE(.);
- *(.bss)
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
} > sram
- /* Stabs debugging sections. */
+
+ /* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
diff --git a/nuttx/configs/olimex-strp711/ostest/Make.defs b/nuttx/configs/olimex-strp711/ostest/Make.defs
index f33c444fe..56a973b57 100644
--- a/nuttx/configs/olimex-strp711/ostest/Make.defs
+++ b/nuttx/configs/olimex-strp711/ostest/Make.defs
@@ -35,8 +35,15 @@
include ${TOPDIR}/.config
+# The default value for CROSSDEV can be overridden from the make command line:
+# make -- Will build for the NuttX buildroot toolchain
+# make CROSSDEV=arm-eabi- -- Will build for the devkitARM toolchain
+# make CROSSDEV=arm-none-eabi- -- Will build for the CodeSourcery toolchain
+# make CROSSDEV=arm-elf- -- Will build for the NuttX buildroot toolchain
+
CROSSDEV = arm-elf-
CC = $(CROSSDEV)gcc
+CXX = $(CROSSDEV)g++
CPP = $(CROSSDEV)gcc -E
LD = $(CROSSDEV)ld
AR = $(CROSSDEV)ar rcs
@@ -58,23 +65,41 @@ endif
ifeq ("${CONFIG_DEBUG}","y")
ARCHOPTIMIZATION = -g
else
- ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce \
- -fomit-frame-pointer
+ ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif
ifeq ($(ARCHCCMAJOR),4)
- ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft -fno-builtin
+ ARCHCPUFLAGS = -mcpu=arm7tdmi -mfloat-abi=soft
else
- ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float -fno-builtin
+ ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float
endif
+
+ifeq ($(CROSSDEV),arm-elf-)
+ MKDEP = $(TOPDIR)/tools/mkdeps.sh
+ ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
+ ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx
+ ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
+else
+ WINTOOL = y
+ DIRLINK = $(TOPDIR)/tools/winlink.sh
+ DIRUNLINK = $(TOPDIR)/tools/unlink.sh
+ MKDEP = $(TOPDIR)/tools/mknulldeps.sh
+ ARCHINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}"
+ ARCHXXINCLUDES = -I. -isystem "${shell cygpath -w $(TOPDIR)/include}" -isystem "${shell cygpath -w $(TOPDIR)/include/cxx}"
+ ARCHSCRIPT = -T "${shell cygpath -w $(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script}"
+endif
+
+ARCHCFLAGS = -fno-builtin
+ARCHCXXFLAGS = -fno-builtin -fno-exceptions
ARCHPICFLAGS = -fpic
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
+ARCHWARNINGSXX = -Wall -Wshadow
ARCHDEFINES =
-ARCHINCLUDES = -I. -isystem $(TOPDIR)/include
-ARCHSCRIPT = -T$(TOPDIR)/configs/$(CONFIG_ARCH_BOARD)/ostest/ld.script
-CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
+CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
$(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) -pipe
+CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \
+ $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) -pipe
CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES)
AFLAGS = $(CFLAGS) -D__ASSEMBLY__
@@ -82,7 +107,10 @@ OBJEXT = .o
LIBEXT = .a
EXEEXT =
-ifeq ("${CONFIG_DEBUG}","y")
+ifneq ($(CROSSDEV),arm-elf-)
+ LDFLAGS += -nostartfiles -nodefaultlibs
+endif
+ifeq ($(CONFIG_DEBUG),y)
LDFLAGS += -g
endif
@@ -96,6 +124,11 @@ define COMPILE
@$(CC) -c $(CFLAGS) $1 -o $2
endef
+define COMPILEXX
+ @echo "CXX: $1"
+ @$(CXX) -c $(CXXFLAGS) $1 -o $2
+endef
+
define ASSEMBLE
@echo "AS: $1"
@$(CC) -c $(AFLAGS) $1 -o $2
@@ -110,10 +143,8 @@ define CLEAN
@rm -f *.o *.a
endef
-MKDEP = $(TOPDIR)/tools/mkdeps.sh
-
HOSTCC = gcc
HOSTINCLUDES = -I.
-HOSTCFLAGS = -Wall -wstrict-prototypes -Wshadow -g -pipe
+HOSTCFLAGS = -Wall -Wstrict-prototypes -Wshadow -g -pipe
HOSTLDFLAGS =
diff --git a/nuttx/configs/olimex-strp711/ostest/ld.script b/nuttx/configs/olimex-strp711/ostest/ld.script
index 053b9938d..d19e51e82 100644
--- a/nuttx/configs/olimex-strp711/ostest/ld.script
+++ b/nuttx/configs/olimex-strp711/ostest/ld.script
@@ -1,7 +1,7 @@
/****************************************************************************
* configs/olimex-strp711/ostest/ld.script
*
- * Copyright (C) 2008 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -60,14 +60,16 @@ SECTIONS
.text : {
_stext = ABSOLUTE(.);
*(.vectors)
- *(.text)
+ *(.text .text.*)
*(.fixup)
*(.gnu.warning)
- *(.rodata)
- *(.rodata.str1.*)
+ *(.rodata .rodata.*)
+ *(.gnu.linkonce.t.*)
*(.glue_7)
*(.glue_7t)
- *(.got) /* Global offset table */
+ *(.got)
+ *(.gcc_except_table)
+ *(.gnu.linkonce.r.*)
_etext = ABSOLUTE(.);
} > flash
@@ -80,18 +82,29 @@ SECTIONS
.data : {
_sdata = ABSOLUTE(.);
- *(.data)
+ *(.data .data.*)
+ *(.gnu.linkonce.d.*)
CONSTRUCTORS
_edata = ABSOLUTE(.);
} > sram AT > flash
- .bss : { /* BSS */
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } >sram
+
+ .ARM.exidx : {
+ *(.ARM.exidx*)
+ } >sram
+
+ .bss : {
_sbss = ABSOLUTE(.);
- *(.bss)
+ *(.bss .bss.*)
+ *(.gnu.linkonce.b.*)
*(COMMON)
_ebss = ABSOLUTE(.);
} > sram
- /* Stabs debugging sections. */
+
+ /* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
diff --git a/nuttx/configs/olimex-strp711/src/Makefile b/nuttx/configs/olimex-strp711/src/Makefile
index a46c97c84..6d61f5a0c 100644
--- a/nuttx/configs/olimex-strp711/src/Makefile
+++ b/nuttx/configs/olimex-strp711/src/Makefile
@@ -36,7 +36,14 @@
-include $(TOPDIR)/Make.defs
ARCH_SRCDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src
-CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/arm -I$(TOPDIR)/sched
+ifeq ($(WINTOOL),y)
+ CFLAGS += -I "${shell cygpath -w $(ARCH_SRCDIR)/chip}" \
+ -I "${shell cygpath -w $(ARCH_SRCDIR)/common}" \
+ -I "${shell cygpath -w $(ARCH_SRCDIR)/arm}" \
+ -I "${shell cygpath -w $(ARCH_SRCDIR)/sched}"
+else
+ CFLAGS += -I$(ARCH_SRCDIR)/chip -I$(ARCH_SRCDIR)/common -I$(ARCH_SRCDIR)/arm -I$(TOPDIR)/sched
+endif
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))