laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/simtrace2/+/28329 )


Change subject: HACK: cardem: Don't reset on watchdog, but panic.
......................................................................

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
---
M firmware/apps/cardem/main.c
1 file changed, 9 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/29/28329/1

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 @@
        board_exec_dbg_cmd(ch);
 }

+#include <osmocom/core/panic.h>
+void WDT_IrqHandler(void)
+{
+       osmo_panic("WDT");
+}
+
 
/*------------------------------------------------------------------------------
  *        Main
  
*------------------------------------------------------------------------------*/
@@ -152,8 +158,9 @@
        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);


--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/28329
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ie3f47e5612cdf501abff8cb6954600b785b3a3fa
Gerrit-Change-Number: 28329
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-MessageType: newchange

Reply via email to