参考网上论坛给的初始化方式,在Board.c及相关 .h 文件都加了相关config代码,初始化代码如下:
void wdtCallback(UArg handle){
Watchdog_clear((Watchdog_Handle)handle);
}
void wdtInitFxn(void){
Watchdog_Params wp;
Watchdog_Handle watchdog;
Board_initWatchdog();
Watchdog_Params_init(&wp);
wp.callbackFxn = wdtCallback;
wp.debugStallMode = Watchdog_DEBUG_STALL_ON;
wp.resetMode = Watchdog_RESET_ON;
watchdog = Watchdog_open(CC2650_WATCHDOG0, &wp);
Watchdog_setReload(watchdog, 1500000); // 1sec (WDT runs always at 48MHz/32)
}
调用wdtInitFxn进行初始化,会直接跑飞,在线仿真定位到死机的地方,一旦使能看门狗复位功能直接死机,代码如下:
__STATIC_INLINE void
WatchdogResetEnable(void)
{
// Enable the watchdog reset.
HWREGBITW(WDT_BASE + WDT_O_CTL, WDT_CTL_RESEN_BITN) = 1;
}
仿真报错信息:
Tue Jan 08, 2019 11:27:34: Fatal error: Failed to do go: (Error -2134 @ 0x0) Unable to control device execution state. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.48.0) Session aborted!
请教TI工程师,为什么直接写寄存器会死机,求解答,盼复!
user5318699:
顶一下,不能沉
Viki Shi:
协议栈里有watchdog的例程,可以参考一下,路径: C:\ti\simplelink_cc2640r2_sdk_2_20_00_49\examples\rtos\CC2640R2_LAUNCHXL\drivers\watchdog
user5318699:
回复 Viki Shi:
你好 我的协议栈版本是 tirtos_cc13xx_cc26xx_2_21_01_08没有找到watchdog的官例
Yushiang Wang:
回复 user5318699:
想請問是參考哪個例程。最近也碰到問題了
user5318699:
回复 Yushiang Wang:
TI协议栈安装路径里面的 具体哪个文件 不好意思时间久了 忘记了