From ec35e939322aa09643fda0260ab19ac8fbfc7b16 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 28 May 2009 20:36:04 +0000 Subject: 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 --- nuttx/arch/arm/src/Makefile | 2 +- nuttx/arch/arm/src/cortexm3/up_hardfault.c | 40 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'nuttx/arch') 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); -- cgit v1.2.3