Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

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( OFP2CLAWRunTask, "taskOFP2CLAW", configMINIMALSTACKSIZE, NULL, 18, NULL ); xTaskCreate( CLAWRunTask, "taskCLAW", configMINIMALSTACKSIZE2, 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.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS