diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-05-28 20:36:04 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-05-28 20:36:04 +0000 |
commit | ec35e939322aa09643fda0260ab19ac8fbfc7b16 (patch) | |
tree | 1877a1da3eea4f510ee7f6e234619ced5fd69a78 | |
parent | de8741ffd56f55f277b0842be8600d893ed43a18 (diff) | |
download | px4-nuttx-ec35e939322aa09643fda0260ab19ac8fbfc7b16.tar.gz px4-nuttx-ec35e939322aa09643fda0260ab19ac8fbfc7b16.tar.bz2 px4-nuttx-ec35e939322aa09643fda0260ab19ac8fbfc7b16.zip |
Add support for CodeSourcery and devkitARM toolchains
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1832 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/ChangeLog | 9 | ||||
-rw-r--r-- | nuttx/Documentation/NuttX.html | 9 | ||||
-rw-r--r-- | nuttx/Makefile | 6 | ||||
-rw-r--r-- | nuttx/TODO | 6 | ||||
-rw-r--r-- | nuttx/arch/arm/src/Makefile | 2 | ||||
-rw-r--r-- | nuttx/arch/arm/src/cortexm3/up_hardfault.c | 40 | ||||
-rw-r--r-- | nuttx/configs/eagle100/README.txt | 28 | ||||
-rw-r--r-- | nuttx/configs/eagle100/httpd/Make.defs | 20 | ||||
-rw-r--r-- | nuttx/configs/eagle100/nettest/Make.defs | 20 | ||||
-rw-r--r-- | nuttx/configs/eagle100/nsh/Make.defs | 20 | ||||
-rw-r--r-- | nuttx/configs/eagle100/ostest/Make.defs | 20 |
11 files changed, 135 insertions, 45 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 7aed46af7..222129763 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -738,10 +738,13 @@ calculation based on CSD settings, inappropriate timeouts, odd code that looks like a bad search and replace. Also needs support for SDHC ver 2.x. New MMC/SD is largely redesigned and probably non-functional in the first check-in. - * drivers/mmcsd: Changes verified on 4Gb Kingston SHDC card. Still having - issues with 2Gb SanDisk SDC card. + * drivers/mmcsd: Changes verified on 4Gb Kingston microSHDC card and on a 2Gb + SanDisk microSDC card on the Eagle100 platform. * fs/fat: With the 4Gb card, the first tests of FAT32 were (finally) performed. - Found a correct a problem that prevented use of FAT32: It was not updating + Found and corrected a problem that prevented use of FAT32: It was not updating the sector cache before checking the FAT32 FSINFO sector. + * configs/eagle100/*/Make.defs: Added configuration options that should make + it possible to build NuttX for the Eagle100 using CodeSourcery 2009q1 toolchain + and the devkitARM GNU toolchain. diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index 05a6ca377..107e2d774 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -1428,11 +1428,14 @@ nuttx-0.4.7 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> calculation based on CSD settings, inappropriate timeouts, odd code that looks like a bad search and replace. Also needs support for SDHC ver 2.x. New MMC/SD is largely redesigned and probably non-functional in the first check-in. - * drivers/mmcsd: Changes verified on 4Gb Kingston SHDC card. Still having - issues with 2Gb SanDisk SDC card. + * drivers/mmcsd: Changes verified on 4Gb Kingston microSHDC card and on a 2Gb + SanDisk microSDC card on the Eagle100 platform. * fs/fat: With the 4Gb card, the first tests of FAT32 were (finally) performed. - Found a correct a problem that prevented use of FAT32: It was not updating + Found and corrected a problem that prevented use of FAT32: It was not updating the sector cache before checking the FAT32 FSINFO sector. + * configs/eagle100/*/Make.defs: Added configuration options that should make + it possible to build NuttX for the Eagle100 using CodeSourcery 2009q1 toolchain + and the devkitARM GNU toolchain. pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> diff --git a/nuttx/Makefile b/nuttx/Makefile index d72aa48b8..d448b2a82 100644 --- a/nuttx/Makefile +++ b/nuttx/Makefile @@ -144,7 +144,7 @@ endif BIN = nuttx$(EXEEXT) all: $(BIN) -.PHONY: clean context clean_context distclean +.PHONY: context clean_context check_context subdir_clean clean subdir_distclean distclean # Build the mkconfig tool used to create include/nuttx/config.h tools/mkconfig: @@ -268,7 +268,7 @@ subdir_clean: @$(MAKE) -C tools -f Makefile.mkconfig TOPDIR="$(TOPDIR)" clean @$(MAKE) -C mm -f Makefile.test TOPDIR="$(TOPDIR)" clean -clean: subdir_clean +clean: subdir_clean clean_context @rm -f $(BIN) nuttx.* mm_test *.map *~ subdir_distclean: @@ -278,7 +278,7 @@ subdir_distclean: fi \ done -distclean: clean subdir_distclean clean_context +distclean: clean subdir_distclean @rm -f Make.defs setenv.sh .config diff --git a/nuttx/TODO b/nuttx/TODO index 6f3c9f809..3e3ea0944 100644 --- a/nuttx/TODO +++ b/nuttx/TODO @@ -538,6 +538,12 @@ o ARM/LM3S6918 (arch/arm/src/lm3s/) Status: Open Priority: Low + Description: Should terminate SSI/SPI transfer if an Rx FIFO overrun occurs. + Right now, if an Rx FIFO overrun occurs, the SSI driver hangs. + Status: Open + Priority: Medium, If the transfer is properly tuned, then there should not + be any Rx FIFO overruns. + o pjrc-8052 / MCS51 (arch/pjrc-8051/) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/nuttx/arch/arm/src/Makefile b/nuttx/arch/arm/src/Makefile index cf85c741b..2c5526f9d 100644 --- a/nuttx/arch/arm/src/Makefile +++ b/nuttx/arch/arm/src/Makefile @@ -66,7 +66,7 @@ LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS)))) BOARDDIR = $(TOPDIR)/arch/$(CONFIG_ARCH)/src/board -LIBGCC = ${shell $(CC) -print-libgcc-file-name} +LIBGCC = "${shell $(CC) -print-libgcc-file-name}" VPATH = chip:common:$(ARCH_SUBDIR) diff --git a/nuttx/arch/arm/src/cortexm3/up_hardfault.c b/nuttx/arch/arm/src/cortexm3/up_hardfault.c index fdd405130..0e637552a 100644 --- a/nuttx/arch/arm/src/cortexm3/up_hardfault.c +++ b/nuttx/arch/arm/src/cortexm3/up_hardfault.c @@ -90,26 +90,6 @@ int up_hardfault(int irq, FAR void *context) uint16 *pc; uint16 insn; - /* Dump some hard fault info */ - -#ifdef DEBUG_HARDFAULTS - lldbg("Hard Fault:\n"); - lldbg(" IRQ: %d regs: %p\n", irq, regs); - lldbg(" BASEPRI: %08x PRIMASK: %08x IPSR: %08x\n", - getbasepri(), getprimask(), getipsr()); - lldbg(" CFAULTS: %08x HFAULTS: %08x DFAULTS: %08x BFAULTADDR: %08x AFAULTS: %08x\n", - getreg32(NVIC_CFAULTS), getreg32(NVIC_HFAULTS), - getreg32(NVIC_DFAULTS), getreg32(NVIC_BFAULT_ADDR), - getreg32(NVIC_AFAULTS)); - lldbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], - regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); - lldbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", - regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], - regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); - lldbg(" PSR=%08x\n", regs[REG_XPSR]); -#endif - /* Get the value of the program counter where the fault occurred */ pc = (uint16*)regs[REG_PC] - 1; @@ -134,6 +114,26 @@ int up_hardfault(int irq, FAR void *context) } } + /* Dump some hard fault info */ + +#ifdef DEBUG_HARDFAULTS + lldbg("\nHard Fault:\n"); + lldbg(" IRQ: %d regs: %p\n", irq, regs); + lldbg(" BASEPRI: %08x PRIMASK: %08x IPSR: %08x\n", + getbasepri(), getprimask(), getipsr()); + lldbg(" CFAULTS: %08x HFAULTS: %08x DFAULTS: %08x BFAULTADDR: %08x AFAULTS: %08x\n", + getreg32(NVIC_CFAULTS), getreg32(NVIC_HFAULTS), + getreg32(NVIC_DFAULTS), getreg32(NVIC_BFAULT_ADDR), + getreg32(NVIC_AFAULTS)); + lldbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3], + regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]); + lldbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n", + regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11], + regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]); + lldbg(" PSR=%08x\n", regs[REG_XPSR]); +#endif + (void)irqsave(); dbg("PANIC!!! Hard fault: %08x\n", getreg32(NVIC_HFAULTS)); PANIC(OSERR_UNEXPECTEDISR); diff --git a/nuttx/configs/eagle100/README.txt b/nuttx/configs/eagle100/README.txt index 4182582bd..36be86359 100644 --- a/nuttx/configs/eagle100/README.txt +++ b/nuttx/configs/eagle100/README.txt @@ -16,12 +16,34 @@ Development Environment environment because the Luminary FLASH programming application was used for writing to FLASH and this application works only under Windows. -Toolchain -^^^^^^^^^ +GNU Toolchain Options +^^^^^^^^^^^^^^^^^^^^^ + + The NuttX make system has been modified to support the following different + toolchain options. + + 1. The CodeSourcery GNU toolchain, + 2. The devkitARM GNU toolchain, or + 3. The NuttX buildroot Toolchain (see below). + + All testing has been conducted using the NuttX buildroot toolchain. However, + the make system is setup to default to use the devkitARM toolchain. To use + the CodeSource 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 + 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. + +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). + 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). diff --git a/nuttx/configs/eagle100/httpd/Make.defs b/nuttx/configs/eagle100/httpd/Make.defs index 393f93687..cf8e2e98d 100644 --- a/nuttx/configs/eagle100/httpd/Make.defs +++ b/nuttx/configs/eagle100/httpd/Make.defs @@ -35,7 +35,13 @@ include ${TOPDIR}/.config -CROSSDEV = arm-elf- +# The default value for CROSSDEV can be overridden from the make command line: +# make -- Will build for the devkitARM 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-eabi- CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ CPP = $(CROSSDEV)gcc -E @@ -59,7 +65,12 @@ else ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer endif -ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft +ifeq ($(CROSSDEV),arm-elf-) + ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif + ARCHDEFINES = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -78,7 +89,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 diff --git a/nuttx/configs/eagle100/nettest/Make.defs b/nuttx/configs/eagle100/nettest/Make.defs index c858d506a..420e639a1 100644 --- a/nuttx/configs/eagle100/nettest/Make.defs +++ b/nuttx/configs/eagle100/nettest/Make.defs @@ -35,7 +35,13 @@ include ${TOPDIR}/.config -CROSSDEV = arm-elf- +# The default value for CROSSDEV can be overridden from the make command line: +# make -- Will build for the devkitARM 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-eabi- CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ CPP = $(CROSSDEV)gcc -E @@ -59,7 +65,12 @@ else ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer endif -ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft +ifeq ($(CROSSDEV),arm-elf-) + ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif + ARCHDEFINES = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -78,7 +89,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 diff --git a/nuttx/configs/eagle100/nsh/Make.defs b/nuttx/configs/eagle100/nsh/Make.defs index df915ca59..385694db8 100644 --- a/nuttx/configs/eagle100/nsh/Make.defs +++ b/nuttx/configs/eagle100/nsh/Make.defs @@ -35,7 +35,13 @@ include ${TOPDIR}/.config -CROSSDEV = arm-elf- +# The default value for CROSSDEV can be overridden from the make command line: +# make -- Will build for the devkitARM 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-eabi- CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ CPP = $(CROSSDEV)gcc -E @@ -59,7 +65,12 @@ else ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer endif -ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft +ifeq ($(CROSSDEV),arm-elf-) + ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif + ARCHDEFINES = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -78,7 +89,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 diff --git a/nuttx/configs/eagle100/ostest/Make.defs b/nuttx/configs/eagle100/ostest/Make.defs index dd785a726..ee7ba8735 100644 --- a/nuttx/configs/eagle100/ostest/Make.defs +++ b/nuttx/configs/eagle100/ostest/Make.defs @@ -35,7 +35,13 @@ include ${TOPDIR}/.config -CROSSDEV = arm-elf- +# The default value for CROSSDEV can be overridden from the make command line: +# make -- Will build for the devkitARM 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-eabi- CC = $(CROSSDEV)gcc CXX = $(CROSSDEV)g++ CPP = $(CROSSDEV)gcc -E @@ -59,7 +65,12 @@ else ARCHOPTIMIZATION = -Os -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer endif -ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft +ifeq ($(CROSSDEV),arm-elf-) + ARCHCPUFLAGS = -mtune=cortex-m3 -march=armv7-m -mfloat-abi=soft +else + ARCHCPUFLAGS = -mcpu=cortex-m3 -mthumb -mfloat-abi=soft +endif + ARCHDEFINES = ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHXXINCLUDES = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx @@ -78,7 +89,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 |