Skip to content

Commit

Permalink
coredump: add BOARD_CRASHDUMP_CUSTOM support
Browse files Browse the repository at this point in the history
For only board specific crashdump and no syslog/blk/mtd coredump

Change-Id: I8938a781fbe6bf7daf1fb76a5a29ba10458adcff
Signed-off-by: buxiasen <[email protected]>
  • Loading branch information
jasonbu committed Nov 29, 2024
1 parent dcbda73 commit d88b500
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
8 changes: 4 additions & 4 deletions arch/renesas/src/rx65n/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion include/nuttx/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 4 additions & 5 deletions sched/misc/assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d88b500

Please sign in to comment.