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
This commit is contained in:
Harald Welte
2022-01-26 10:47:52 +01:00
parent 7783cd7a28
commit b07131f2a5

View File

@@ -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);