hemangthakkar wrote on Tuesday, February 21, 2012:
The main function looks like mentioned below
int main(){
……
/* Create timers and tasks*/
xTimer_soft_WD = xTimerCreate((const signed char*)“soft_WD”,
(SOFT_WD_TICKS),
pdTRUE,
(void *) 0,
soft_WD);
xTaskCreate( eth_task,
(signed portCHAR *)“eth_task”,
configMINIMAL_STACK_SIZE * 2.5,
NULL,
tskIDLE_PRIORITY + 1,
ðTaskHndl );
xTaskCreate( ser_task,
(signed portCHAR *)“serial_task”,
configMINIMAL_STACK_SIZE/5,
NULL,
tskIDLE_PRIORITY + 1,
&serTaskHndl );
xTimerStart( xTimer_soft_WD,portMAX_DELAY );
/* Start the scheduler. */
vTaskStartScheduler();
……
Soft_WD timer routine looks like below which basically monitors task and if some task takes too long to finish execution then I am using the below steps to delete task and creating it again. The task create function call is the same which I have used in main function. But, it doesnot work here and system hangs up.
vTaskSuspendAll();
vTaskDelete(ethTaskHndl);
xTaskCreate( eth_task,
(signed portCHAR *)“eth_task”,
configMINIMAL_STACK_SIZE * 2.5,
NULL,
tskIDLE_PRIORITY + 1,
ðTaskHndl );
xTaskResumeAll();