diff options
-rw-r--r-- | common/system.c | 17 | ||||
-rw-r--r-- | core/cortex-m/watchdog.c | 3 |
2 files changed, 5 insertions, 15 deletions
diff --git a/common/system.c b/common/system.c index b26d35e1d2..b2982b12d0 100644 --- a/common/system.c +++ b/common/system.c @@ -759,19 +759,12 @@ void system_common_pre_init(void) #ifdef CONFIG_SOFTWARE_PANIC /* - * Log panic cause if watchdog caused reset and panic cause - * was not already logged. This must happen before calculating - * jump_data address because it might change panic pointer. + * Log panic cause if watchdog caused reset. This + * must happen before calculating jump_data address + * because it might change panic pointer. */ - if (system_get_reset_flags() & EC_RESET_FLAG_WATCHDOG) { - uint32_t reason; - uint32_t info; - uint8_t exception; - - panic_get_reason(&reason, &info, &exception); - if (reason != PANIC_SW_WATCHDOG) - panic_set_reason(PANIC_SW_WATCHDOG, 0, 0); - } + if (system_get_reset_flags() & EC_RESET_FLAG_WATCHDOG) + panic_set_reason(PANIC_SW_WATCHDOG, 0, 0); #endif /* diff --git a/core/cortex-m/watchdog.c b/core/cortex-m/watchdog.c index 3e62b5f4c5..0727863e7d 100644 --- a/core/cortex-m/watchdog.c +++ b/core/cortex-m/watchdog.c @@ -25,9 +25,6 @@ void __keep watchdog_trace(uint32_t excep_lr, uint32_t excep_sp) stack = (uint32_t *)psp; } - panic_set_reason(PANIC_SW_WATCHDOG, stack[6], - (excep_lr & 0xf) == 1 ? 0xff : task_get_current()); - panic_printf("### WATCHDOG PC=%08x / LR=%08x / pSP=%08x ", stack[6], stack[5], psp); if ((excep_lr & 0xf) == 1) |