void wdtInitFxn()
{
Watchdog_Params wp;
Watchdog_Handle watchdog;
Watchdog_Params_init(&wp);
wp.callbackFxn = wdtCallback;
wp.debugStallMode = Watchdog_DEBUG_STALL_ON;
wp.resetMode = Watchdog_RESET_ON;
watchdog = Watchdog_open(Board_WATCHDOG0, &wp);
Watchdog_setReload(watchdog, 1000); // 1sec (WDT runs always at 48MHz/32)
}
运行这句的时候 Watchdog_setReload(watchdog, 1000); // 1sec (WDT runs always at 48MHz/32) 报The processor has escalated a configurable-priority exception to HardFault.
Eggsy Pang:
Watchdog_setReload(watchdog, 1500000);这才是1s
user5159541:
回复 Eggsy Pang:
150000 的时候也是一样 后来改成1000 还是这样
Eggsy Pang:
回复 user5159541:
我这边是可以成功的:// Call watchdog init functionsWatchdog_init();Watchdog_Params params;params.callbackFxn= (Watchdog_Callback)watchdogCallback;params.resetMode= Watchdog_RESET_ON;params.debugStallMode = Watchdog_DEBUG_STALL_ON;watchdogHandle= Watchdog_open(Board_WATCHDOG0, ¶ms);//1 seconds. Watchdog_setReload(watchdogHandle, 150000);
user5159541:
回复 Eggsy Pang:
Thu Mar 22, 2018 11:27:05: HardFault exception.
Thu Mar 22, 2018 11:27:05: The processor has escalated a configurable-priority exception to HardFault.
Thu Mar 22, 2018 11:27:05:A bus fault has occurred on an instruction prefetch.
Thu Mar 22, 2018 11:27:05:
Thu Mar 22, 2018 11:27:05: Exception occured at: 0x7b153466
Thu Mar 22, 2018 11:27:05:
Thu Mar 22, 2018 11:27:05: See the call stack for more information.
我这直接报异常
user5159541:
回复 user5159541:
if (watchdog == NULL) {
return;}
加了一个判断 结果发现 watchdog 是NULL 没初始化成功
Eggsy Pang:
回复 user5159541:
你没有调用
Watchdog_init();
user5159541:
回复 Eggsy Pang:
void wdtInitFxn(){Watchdog_init();Watchdog_Params wp;Watchdog_Handle watchdog;Watchdog_Params_init(&wp);wp.callbackFxn= wdtCallback;wp.debugStallMode = Watchdog_DEBUG_STALL_OFF ;wp.resetMode= Watchdog_RESET_OFF;watchdog = Watchdog_open(Board_WATCHDOG0, &wp); if (watchdog == NULL) {return; }Watchdog_setReload(watchdog, 1500000); // 1sec (WDT runs always at 48MHz/32)}
结果还是一样
user5159541:
回复 user5159541:
watchdog非空了 貌似 ok了 但是一初始化好以后,仿真器就不能工作了 ?是这样的吗?
user5159541:
回复 user5159541:
WATCHDOG已经可以工作了 但是出现新的问题 蓝牙在连接状态下会经常断开连接
Eggsy Pang:
回复 user5159541:
开门狗改大一点啊,连接需要时间啊 Watchdog_setReload(watchdog, 5*1500000); // 5sec