Add support for Windows GCC to lpc2148 and str711
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1875 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
e12e66cdf1
commit
81e5eff925
|
@ -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.
|
||||
|
|
|
@ -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 <spudmonkey@racsa.co.cr>
|
|||
* 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 <spudmonkey@racsa.co.cr>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -56,7 +56,6 @@ SECTIONS
|
|||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
|
|
|
@ -56,7 +56,6 @@ SECTIONS
|
|||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
|
|
|
@ -56,7 +56,6 @@ SECTIONS
|
|||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
|
|
|
@ -56,7 +56,6 @@ SECTIONS
|
|||
*(.text .text.*)
|
||||
*(.fixup)
|
||||
*(.gnu.warning)
|
||||
*(.rodata)
|
||||
*(.rodata .rodata.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7)
|
||||
|
|
|
@ -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
|
||||
^^^^^^^^^
|
||||
|
||||
|
|
|
@ -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 =
|
||||
|
||||
|
|
|
@ -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=
|
||||
|
|
|
@ -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
|
||||
|
||||
. = ALIGN(32 / 8);
|
||||
.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
|
||||
|
||||
. = ALIGN(32 / 8);
|
||||
/* Stabs debugging sections. */
|
||||
/* Stabs debugging sections. */
|
||||
.stab 0 : { *(.stab) }
|
||||
.stabstr 0 : { *(.stabstr) }
|
||||
.stab.excl 0 : { *(.stab.excl) }
|
||||
|
|
|
@ -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 =
|
||||
|
||||
|
|
|
@ -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=
|
||||
|
|
|
@ -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
|
||||
|
||||
.bss : { /* BSS */
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} >sram
|
||||
|
||||
.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) }
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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 =
|
||||
|
||||
|
|
|
@ -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=
|
||||
|
|
|
@ -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
|
||||
|
||||
.bss : { /* BSS */
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} >sram
|
||||
|
||||
.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) }
|
||||
|
|
|
@ -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 =
|
||||
|
||||
|
|
|
@ -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=
|
||||
|
|
|
@ -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
|
||||
|
||||
.bss : { /* BSS */
|
||||
.ARM.extab : {
|
||||
*(.ARM.extab*)
|
||||
} >sram
|
||||
|
||||
.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) }
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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 =
|
||||
|
||||
|
|
|
@ -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) }
|
||||
|
|
|
@ -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 =
|
||||
|
||||
|
|
|
@ -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) }
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue