diff options
author | Harald Welte <laforge@osmocom.org> | 2022-01-26 10:47:52 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2022-03-03 19:06:12 +0100 |
commit | b07131f2a58e8b8253caa8947e331549ca154031 (patch) | |
tree | 13b3f73392d6845766972be8ae9569ac36b2b29a | |
parent | 7783cd7a288bcb455f3a4efad089b663c0750580 (diff) |
HACK: cardem: Don't reset on watchdog, but panic.
This should help debug watchdog triggers. Also reduce the timer to 1s
to hopefully increase the chance of triggering it.
Change-Id: Ie3f47e5612cdf501abff8cb6954600b785b3a3fa
-rw-r--r-- | firmware/apps/cardem/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/firmware/apps/cardem/main.c b/firmware/apps/cardem/main.c index 347ccbd..9e76e05 100644 --- a/firmware/apps/cardem/main.c +++ b/firmware/apps/cardem/main.c @@ -137,6 +137,12 @@ static void check_exec_dbg_cmd(void) board_exec_dbg_cmd(ch); } +#include <osmocom/core/panic.h> +void WDT_IrqHandler(void) +{ + osmo_panic("WDT"); +} + /*------------------------------------------------------------------------------ * Main *------------------------------------------------------------------------------*/ @@ -152,8 +158,9 @@ extern int main(void) led_blink(LED_GREEN, BLINK_ALWAYS_ON); /* Enable watchdog for 2000ms, with no window */ - WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | - (WDT_GetPeriod(2000) << 16) | WDT_GetPeriod(2000)); + WDT_Enable(WDT, WDT_MR_WDFIEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT | + (WDT_GetPeriod(1000) << 16) | WDT_GetPeriod(1000)); + NVIC_EnableIRQ(WDT_IRQn); PIO_InitializeInterrupts(10); |