Part Number:IWR6843ISK
参照mmwave_sdk_03_05_00_04中的例子,对看门狗 C:\ti\mmwave_sdk_03_05_00_04\packages\ti\drivers\watchdog\test\xwr68xx进行了试验,无论是warm reset还是interrupt都是成功的,但移植到工程中就不行了。具体工程如下C:\ti\mmwave_industrial_toolbox_4_9_0\labs\people_counting\68xx_3D_people_counting。我把看门狗加在mss_main.c文件的main函数里面,如下所示,蓝色是我新加的代码。
对中断模式进行验证,进入while(1)死循环后,把Watchdog_clear屏蔽,程序不会重启,一直处于死循环,事实上,程序不会调用返回函数watchdogCallback。
当然,在该工程中对热重启模式进行验证,也是无法重启的,下面的代码是中断模式。
请问为什么用了与TI例子相同的方法,却不能重启?
main()
{
……
/* Initialize the Task Parameters. */
Task_Params_init(&taskParams);
gMmwMssMCB.taskHandles.initTask = Task_create(Pcount3DDemo_initTask, &taskParams, NULL);
/* Initialize the Task Parameters. */
// Task_Params_init(&taskParams);
taskParams.stackSize = 2*1024;
Task_create(Test_initTask, &taskParams, NULL);//新创建一个任务
/* Start BIOS */
BIOS_start();
return 0;
}
static void Test_initTask()
{
watchdogTest();
return;
}
static int32_t watchdogTest()
{
Watchdog_Handle watchdogHandle;
Watchdog_Params watchdogParams;
Watchdog_ResetMode resetMode;
int32_t errCode = 0;
/* Initializa the Watchdog driver */
Watchdog_init();
/* Initialize the Watchdog driver default parameters */
Watchdog_Params_init(&watchdogParams);
watchdogParams.resetMode = Watchdog_RESET_ON;
watchdogParams.callbackFxn = watchdogCallback;
watchdogParams.debugStallMode = Watchdog_DEBUG_STALL_OFF;
watchdogParams.windowSize = Watchdog_WINDOW_100_PERCENT;
watchdogParams.preloadValue = 20;
watchdogParams.socHandle = socHandle;
watchdogParams.esmHandle = esmHandle;
/* Open the Watchdog driver */
watchdogHandle = Watchdog_open(0, &watchdogParams);
if (watchdogHandle == NULL)
{
System_printf ("Error: Watchdog Driver Open failed\n");
return -1;
}
while (1);//此处为死循环,但确不重启
return 0;
}
void watchdogCallback(Watchdog_Handle handle)
{
gWatchdogInt++;
if (gWatchdogInt < 10)
{
System_printf ("Debug: Watchdog Driver NMI received\n");
//Watchdog_clear(watchdogHandle);//此处屏蔽
}
return;
}
Chris Meng:
你好,
在PPL demo里,去掉和PPL相关的task的创建。你添加的看门狗代码还能正常运行吗?