Ti专家,
您们好。我们的基本调试环境为:芯片:TM4C129xNCZAD; CCS: 6.0.1.00040 ; 编译器版本: ARM Compiler Tools 5.1.6
系统休眠:使用watchdog 1作为系统休眠时的唤醒中断源,系统休眠模式为Deep-Sleep,下面是设置代码:
/*code begin*/
watchdog设置:
Types_FreqHz SystemClk;
WatchdogIntRegister(WATCHDOG0_BASE | WATCHDOG1_BASE,WatchdogIntHandler);
 
 /* Enable the peripherals used by app.*/
 SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);
 SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG1);
 while(!Drv_WatchDog1WriteCmp());     /*wait for watchdog1 write complete*/
/* Enable the watchdog interrupt.*/
 IntEnable(INT_WATCHDOG);
BIOS_getCpuFreq(&SystemClk);
/* Set the period of the watchdog timer.*/
 WatchdogReloadSet(WATCHDOG0_BASE, SystemClk.lo);
/* Disable reset generation from the watchdog timer.*/
 WatchdogResetDisable(WATCHDOG0_BASE);
 WatchdogResetDisable(WATCHDOG1_BASE);
 while(!Drv_WatchDog1WriteCmp());    /*wait for watchdog1 write complete*/
System_printf("enable the watchdog!\n");
/* Enable the watchdog timer.*/
 WatchdogEnable(WATCHDOG0_BASE);
休眠设置:
 /*在睡眠模式下关闭所有外设*/
 SysCtlPeripheralClockGating(true);
/*设置Deep-Sleep下的时钟源*/
 SysCtlDeepSleepClockConfigSet(2,SYSCTL_DSLP_OSC_INT30 | SYSCTL_DSLP_MOSC_PD);
/*在深睡眠模式下使能watch dog 1*/
 SysCtlPeripheralDeepSleepEnable(SYSCTL_PERIPH_WDOG1);
进入休眠的处理:
/*set the watchdong 1 time*/
 WatchdogReloadSet(WATCHDOG1_BASE, sleepTime);
while(!Drv_WatchDog1WriteCmp()); /*wait for watchdog1 write complete*/
/*选择LFIOSC作为系统休眠时的ALT时钟源*/
 DRV_setAltClkMode(APP_ALTCLK_LFIOSC);
/*使能WDG1*/
 WatchdogEnable(WATCHDOG1_BASE);
 while(!Drv_WatchDog1WriteCmp());    /*wait for watchdog1 write complete*/
/*系统进入Deep-Sleep*/
 SysCtlDeepSleep();
/*code end*/
使用XDS100V2仿真器调试,系统进入休眠后,watchdog1不能唤醒系统,暂停仿真器,出现如下图所示的内容:
再次点击仿真器运行,console出现如下所示的提示:
CORTEX_M4_0: Can't Run Target CPU: (Error -1268 @ 0x1090001) Device is locked up in Hard Fault or in NMI. 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 5.1.507.0)
请ti的专家帮忙看一下,上面的watchdog 1设置是否正确,以及引起该问题的原因和解决方法?
谢谢。
 
				 
		 
					
