scheduling semaphore and vTaskDelayUntil
Posted by
e12 on July 12, 2016
I have question about freertos schedulings I’m using iar compiler and stm32f427
scheduling method is preemptive, I‘m using the hal library and the contents of FreeRTOSConfig.h are as follows:
~~~
define configUSE_PREEMPTION 1
define configUSEIDLEHOOK 0
define configUSETICKHOOK 0
define configCPUCLOCKHZ ( SystemCoreClock )
define configTICKRATEHZ ((TickType_t)1000)
define configMAX_PRIORITIES ( 30 )
define configMINIMALSTACKSIZE ((uint16_t)128)
define configTOTALHEAPSIZE ((size_t)30720)
define configMAXTASKNAME_LEN ( 30 )
define configUSETRACEFACILITY 1
define configUSE16BIT_TICKS 0
define configIDLESHOULDYIELD 1 // Updated 2016.06.17
define configUSE_MUTEXES 1
define configQUEUEREGISTRYSIZE 8
define configCHECKFORSTACK_OVERFLOW 2
define configUSERECURSIVEMUTEXES 1
define configUSEMALLOCFAILED_HOOK 1
define configUSECOUNTINGSEMAPHORES 1
define configUSETASKNOTIFICATIONS 1 // Updated 2016.06.17
define configUSETICKLESSIDLE 0 // Updated 2016.06.17
define configNUMTHREADLOCALSTORAGEPOINTERS 3
define configUSESTATSFORMATTING_FUNCTIONS 1
~~~
Current Task are defined as follows:
~~~
void TaskCreate(void)
{
xTaskCreate( ISS2OFPRunTask, “taskISS2OFP”, configMINIMALSTACKSIZE2, NULL, 19, NULL );
xTaskCreate( OFP2CLAW_Run_Task, “task_OFP2CLAW”, configMINIMAL_STACK_SIZE, NULL, 18, NULL );
xTaskCreate( CLAW_Run_Task, “task_CLAW”, configMINIMAL_STACK_SIZE2, NULL, 17, NULL );
xTaskCreate( CLAW2OFPRunTask, “taskCLAW2OFP”, configMINIMALSTACK_SIZE, NULL, 16, NULL );
xTaskCreate( OFP2GCSRunTask, “taskOFP2GCS”, configMINIMALSTACK_SIZE*2, NULL, 13, NULL );
xTaskCreate( SDcardRecodeQueueTask, “SDcardRecodeQueue”, configMINIMALSTACKSIZE*2, NULL, 11, NULL );
xTaskCreate( OFP2FDRRunTask, “taskOFP2FDR”, configMINIMALSTACKSIZE*6, NULL, 10, NULL );
xTaskCreate( SYSTEMProcess10msTask, “SYSTEMProcess10ms”, configMINIMALSTACKSIZE*2, NULL, 7, NULL );
xTaskCreate( SYSTEMProcess1msTask, “SYSTEMProcess1ms”, configMINIMALSTACKSIZE*2, NULL, 6, NULL );
}
~~~
there are several task using semaphore like, ISS2OFPRunTask, OFP2CLAWRunTask, CLAWRunTask, CLAW2OFPRunTask on the other hand there are some task using vTaskDelayUntil like SDcardRecodeQueueTask, OFP2GCSRunTask, GCS2OFPRunTask, SYSTEMProcess1msTask, SYSTEMProcess10ms_Task
My question this, can I use vTaskDelayUntil and semaphore task at the same time?
is there any problem with scheduling?
scheduling semaphore and vTaskDelayUntil
Posted by
rtel on July 12, 2016
There are no interdependencies between different features – all the API
functions work as documented. For example, if a task calls vTaskDelay(
100 ) then it will enter the Blocked state and leave the Blocked state
100 ticks later, whether or not the task is using any other feature of
the OS. Likewise if a task calls xSemaphoreTake( semaphore_handle, 100
) when the semaphore is not available it will enter the blocked state
until either the semaphore becomes available or 100 ticks pass without
the semaphore becoming available (it times out) no matter what other API
function the task is using.