summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/cortexm3/up_hardfault.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/arm/src/cortexm3/up_hardfault.c')
-rw-r--r--nuttx/arch/arm/src/cortexm3/up_hardfault.c40
1 files changed, 20 insertions, 20 deletions
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);