diff --git a/arch/renesas/src/rx65n/Kconfig b/arch/renesas/src/rx65n/Kconfig index 269895caadb2e..e553f5f971441 100644 --- a/arch/renesas/src/rx65n/Kconfig +++ b/arch/renesas/src/rx65n/Kconfig @@ -149,7 +149,7 @@ config RX65N_CMT0 config RX65N_CMT1 bool "CMT1" default n - depends on BOARD_CRASHDUMP && RX65N_SBRAM && RX65N_SAVE_CRASHDUMP + depends on BOARD_CRASHDUMP_CUSTOM && RX65N_SBRAM && RX65N_SAVE_CRASHDUMP config RX65N_CMT2 bool "CMT2" @@ -170,7 +170,7 @@ config RX65N_IRQ_GROUP config RX65N_SBRAM bool "SBRAM" default n - depends on BOARD_CRASHDUMP + depends on BOARD_CRASHDUMP_CUSTOM config RX65N_SAVE_CRASHDUMP bool "SBRAM Save Crashdump" @@ -541,7 +541,7 @@ config RX65N_CMT0 config RX65N_CMT1 bool "CMT1" default n - depends on BOARD_CRASHDUMP && RX65N_SBRAM && RX65N_SAVE_CRASHDUMP + depends on BOARD_CRASHDUMP_CUSTOM && RX65N_SBRAM && RX65N_SAVE_CRASHDUMP config RX65N_CMT2 bool "CMT2" @@ -562,7 +562,7 @@ config RX65N_IRQ_GROUP config RX65N_SBRAM bool "SBRAM" default n - depends on BOARD_CRASHDUMP + depends on BOARD_CRASHDUMP_CUSTOM config RX65N_SAVE_CRASHDUMP bool "SBRAM Save Crashdump" diff --git a/boards/Kconfig b/boards/Kconfig index a982aa8e799c4..ccaae55b2fe93 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -4728,6 +4728,12 @@ config BOARD_COREDUMP_MTDDEV ---help--- Enable save coredump to mtd device when crash. +config BOARD_CRASHDUMP_CUSTOM + bool "Enable Core Dump with custom method" + ---help--- + Enable save coredump with custom method. only work with + board_crashdump api. + config BOARD_CRASHDUMP_NONE bool "No Board level crash dump" diff --git a/include/nuttx/board.h b/include/nuttx/board.h index 33053a2f93cd9..d3430d2b3cb64 100644 --- a/include/nuttx/board.h +++ b/include/nuttx/board.h @@ -820,7 +820,7 @@ int board_button_irq(int id, xcpt_t irqhandler, FAR void *arg); * ****************************************************************************/ -#ifdef CONFIG_BOARD_CRASHDUMP +#ifdef CONFIG_BOARD_CRASHDUMP_CUSTOM struct tcb_s; void board_crashdump(uintptr_t sp, FAR struct tcb_s *tcb, FAR const char *filename, int lineno, diff --git a/sched/misc/assert.c b/sched/misc/assert.c index 28ff5496977cb..b23072c59ab3e 100644 --- a/sched/misc/assert.c +++ b/sched/misc/assert.c @@ -765,15 +765,14 @@ static void dump_fatal_info(FAR struct tcb_s *rtcb, usbtrace_enumerate(assert_tracecallback, NULL); #endif -#ifdef CONFIG_BOARD_CRASHDUMP - board_crashdump(up_getsp(), rtcb, filename, linenum, msg, regs); -#endif - -#ifndef CONFIG_BOARD_CRASHDUMP_NONE /* Flush previous SYSLOG data before possible long time coredump */ syslog_flush(); +#ifdef CONFIG_BOARD_CRASHDUMP_CUSTOM + board_crashdump(up_getsp(), rtcb, filename, linenum, msg, regs); +#elif !defined(CONFIG_BOARD_CRASHDUMP_NONE) + /* Dump core information */ # ifdef CONFIG_BOARD_COREDUMP_FULL