Thanks Richard,
I follow your suggestion to check xPortSysTickHandler(), the handler has been triggered by every 1ms after I configure the Systick.
But task/time still not work, my example is very simple as below.
=============================================================
tatic void vTestTask(void *pvParameters)
{
while (1) {
vTaskDelay(1000);
printf("1s for tasks delay !!!\r\n");
//print something for every 1 second
}
}
void vTimerCallback( TimerHandle_t xTimer )
{
//print something in here
printf("20s for timer timeout !!!\r\n");
}
=============================================================
{
xReturn = xTaskCreate(vTestTask, FREERTOS_EXAMPLE_TASK_NAME,
FREERTOS_EXAMPLE_TASK_STACKSIZE /
sizeof(portSTACK_TYPE), (void *)NULL,
FREERTOS_EXAMPLE_TASK_PRIO, NULL);
if ( xReturn != pdPASS )
printf("Create Task Fail, result=%d!!!\r\n", xReturn);
else
printf("Create Task Sus !!!\r\n");
//create timer
xTimers_test = xTimerCreate
( /* Just a text name, not used by the RTOS
kernel. */
"Timer",
/* The timer period in ticks, must be
greater than 0. */
20000, //20 second
/* The timers will auto-reload themselves
when they expire. */
pdTRUE,
/* The ID is used to store a count of the
number of times the timer has expired, which
is initialised to 0. */
( void * ) 0,
/* Each timer calls the same callback when
it expires. */
vTimerCallback
);
if ( xTimers_test != NULL )
{
xTimerStart(xTimers_test,0);
printf("Create Timer Sus !!!\r\n");
}
else
printf("Create Timer Fail !!!\r\n");
}
=============================================================
I has already trace the source of FreeRTOS to look at “xTaskIncrementTick()” function, it seems the return is always pdFALSE.
Could you have any suggestion then I could verify it ? Thanks.