|
@@ -13,6 +13,7 @@
|
|
|
#include "slpman_ec616.h"
|
|
|
#include "plat_config.h"
|
|
|
#include "debug_log.h"
|
|
|
+#include "os_exception.h"
|
|
|
#if (WDT_FEATURE_ENABLE==1)
|
|
|
#include "wdt_ec616.h"
|
|
|
#define WDT_TIMEOUT_VALUE (20) // in unit of second, shall be less than 256s
|
|
@@ -152,7 +153,28 @@ void BSP_WdtInit(void)
|
|
|
wdtConfig.timeoutValue = 32768U;
|
|
|
WDT_Init(&wdtConfig);
|
|
|
}
|
|
|
-
|
|
|
+void NMI_Handler()
|
|
|
+{
|
|
|
+ ECOMM_TRACE(UNILOG_PLA_APP, enter_NMI_handler, P_ERROR, 0, "WDT timeout!!! Enter NMI Handler!!!");
|
|
|
+ // If we have been in exception handler excecution, we shall resume it.
|
|
|
+ if(is_in_excep_handler())
|
|
|
+ {
|
|
|
+ WDT_Stop();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(BSP_GetPlatConfigItemValue(PLAT_CONFIG_ITEM_FAULT_ACTION) == EXCEP_OPTION_SILENT_RESET)
|
|
|
+ {
|
|
|
+ ResetReasonWrite(RESET_REASON_WDT);
|
|
|
+ EC_SystemReset();
|
|
|
+ while(1);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ EC_ASSERT(0, 0, 0, 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
#endif
|
|
|
/*
|
|
|
* custom board related init
|