ARMv7-M/ARMv6-M: Review last PR. Rename CONFIG_DEBUG_HARDFAULT to OHNFIG_DEBUG_HARDFAULT_ALERT for consistency.
This commit is contained in:
parent
382a829657
commit
c14d97a921
@ -744,27 +744,31 @@ config ARCH_ROMPGTABLE
|
|||||||
default n
|
default n
|
||||||
depends on ARCH_USE_MMU
|
depends on ARCH_USE_MMU
|
||||||
---help---
|
---help---
|
||||||
Support a fixed memory mapping use a (read-only) page table in ROM/FLASH.
|
Support a fixed memory mapping use a (read-only) page table in
|
||||||
|
ROM/FLASH.
|
||||||
|
|
||||||
config ARCH_HAVE_HARDFAULT_DEBUG
|
config ARCH_HAVE_HARDFAULT_DEBUG
|
||||||
bool
|
bool
|
||||||
default n
|
default n
|
||||||
|
|
||||||
config DEBUG_HARDFAULT
|
config DEBUG_HARDFAULT_ALERT
|
||||||
bool "Verbose Hard-Fault Debug"
|
bool "Hard-Fault Alert Debug"
|
||||||
default n
|
default n
|
||||||
depends on ARCH_HAVE_HARDFAULT_DEBUG && DEBUG_FEATURES
|
depends on ARCH_HAVE_HARDFAULT_DEBUG && DEBUG_ALERT
|
||||||
---help---
|
---help---
|
||||||
Enables verbose debug output when a hard fault is occurs. This verbose
|
Enables debug alert output to the SYSLOG when a hard fault
|
||||||
output is sometimes helpful when debugging difficult hard fault problems,
|
occurs. This output is sometimes helpful when debugging difficult
|
||||||
but may be more than you typically want to see.
|
hard fault problems.
|
||||||
|
|
||||||
config DEBUG_HARDFAULT_INFO
|
config DEBUG_HARDFAULT_INFO
|
||||||
bool "Hard-Fault Informational Output"
|
bool "Hard-Fault Informational Output"
|
||||||
default n
|
default n
|
||||||
depends on ARCH_HAVE_HARDFAULT_DEBUG && DEBUG_FEATURES && DEBUG_INFO
|
depends on ARCH_HAVE_HARDFAULT_DEBUG && DEBUG_INFO
|
||||||
---help---
|
---help---
|
||||||
Enable hard fault informational output to SYSLOG.
|
Enables informational alert output to the SYSLOG when a hard fault
|
||||||
|
occurs. This output is sometimes helpful when debugging difficult
|
||||||
|
hard fault problems but may be more than you want to see in some
|
||||||
|
cases.
|
||||||
|
|
||||||
config ARCH_HAVE_MEMFAULT_DEBUG
|
config ARCH_HAVE_MEMFAULT_DEBUG
|
||||||
bool
|
bool
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv6-m/up_hardfault.c
|
* arch/arm/src/armv6-m/up_hardfault.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -54,7 +54,7 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_HARDFAULT
|
#ifdef CONFIG_DEBUG_HARDFAULT_ALERT
|
||||||
# define hfalert(format, ...) _alert(format, ##__VA_ARGS__)
|
# define hfalert(format, ...) _alert(format, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
# define hfalert(x...)
|
# define hfalert(x...)
|
||||||
@ -125,21 +125,21 @@ int up_hardfault(int irq, FAR void *context, FAR void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_DEBUG_HARDFAULT)
|
#if defined(CONFIG_DEBUG_HARDFAULT_ALERT)
|
||||||
/* Dump some hard fault info */
|
/* Dump some hard fault info */
|
||||||
|
|
||||||
hfalert("\nHard Fault:\n");
|
hfalert("\nHard Fault:\n");
|
||||||
hfalert(" IRQ: %d regs: %p\n", irq, regs);
|
hfalert(" IRQ: %d regs: %p\n", irq, regs);
|
||||||
hfalert(" PRIMASK: %08x IPSR: %08x\n",
|
hfalert(" PRIMASK: %08x IPSR: %08x\n",
|
||||||
getprimask(), getipsr());
|
getprimask(), getipsr());
|
||||||
hfalert(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
hfalert(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||||
hfalert(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
hfalert(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||||
hfalert(" xPSR: %08x PRIMASK: %08x (saved)\n",
|
hfalert(" xPSR: %08x PRIMASK: %08x (saved)\n",
|
||||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]);
|
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
(void)up_irq_save();
|
(void)up_irq_save();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/armv7-m/up_hardfault.c
|
* arch/arm/src/armv7-m/up_hardfault.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009, 2013, 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2009, 2013, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -59,7 +59,7 @@
|
|||||||
* interfere with context switching!
|
* interfere with context switching!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_DEBUG_HARDFAULT
|
#ifdef CONFIG_DEBUG_HARDFAULT_ALERT
|
||||||
# define hfalert(format, ...) _alert(format, ##__VA_ARGS__)
|
# define hfalert(format, ...) _alert(format, ##__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
# define hfalert(x...)
|
# define hfalert(x...)
|
||||||
@ -71,7 +71,6 @@
|
|||||||
# define hfinfo(x...)
|
# define hfinfo(x...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define INSN_SVC0 0xdf00 /* insn: svc 0 */
|
#define INSN_SVC0 0xdf00 /* insn: svc 0 */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -89,7 +88,7 @@
|
|||||||
|
|
||||||
int up_hardfault(int irq, FAR void *context, FAR void *arg)
|
int up_hardfault(int irq, FAR void *context, FAR void *arg)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_DEBUG_HARDFAULT) || !defined(CONFIG_ARMV7M_USEBASEPRI)
|
#if defined(CONFIG_DEBUG_HARDFAULT_ALERT) || !defined(CONFIG_ARMV7M_USEBASEPRI)
|
||||||
uint32_t *regs = (uint32_t *)context;
|
uint32_t *regs = (uint32_t *)context;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user