FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2015 Threads] Semaphore Execution timePosted by sindhukrishnan on October 28, 2015 Hello FreeRTOS Team
I use TMS570LC4357 HDK with FreeRTOS, HALCoGen v4.5.1 for Code generation and CCSv6 as IDE.
I use Counting Semaphore to handle an Interrupt task. I've configured the Semaphore queue size as 100 and the waiting time for Semaphore as 1 tick.
When I run the code, the time taken between xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken ); inside the ISR and the if(xSemaphoreTake( xSemaphore, 0x01 ) == pdTRUE) inside the ISR Handler is 880ms. Also I face a Jitter in the task that runs cyclically every 1ms. Does Counting Semaphore execution time take 880ms?
Which of these consume the least exection time in event handling
i) Counting Semaphore
ii) Binary Semaphore
iii) Event Group ?
Semaphore Execution timePosted by rtel on October 28, 2015
When I run the code, the time taken between xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken ); inside the ISR and the if(xSemaphoreTake( xSemaphore, 0x01 ) == pdTRUE) inside the ISR Handler is 880ms
That sounds exceptionally long.
Q1 Are you using the xHigherPriorityTaskWoken parameter to request a context switch inside the ISR?
Q2 Does the task you are unblocking have a priority above the priority of the currently running task (the task the ISR interrupted)?
Which of these consume the least exection time in event handling
Actually the least amount of time will be a direct to task notification, which you can use in exactly the same way as either a binary or counting semaphore. Look at the example code on the following page:
http://www.freertos.org/vTaskNotifyGiveFromISR.html
Regards.
Semaphore Execution timePosted by sindhukrishnan on October 28, 2015 For Q1, yes I did use xHigherPriorityTaskWoken parameter. Is NULL sufficient for use there?
For Q2, the Unblocking task has the highest priority of all tasks.
Semaphore Execution timePosted by rtel on October 28, 2015
yes I did use xHigherPriorityTaskWoken parameter. Is NULL sufficient for use there
No - if you pass in NULL then it means you are not using it. Please read the documentation for the port you are using, and the API documentation for the functions you are using in the interrupts.
Regards.
Semaphore Execution timePosted by sindhukrishnan on October 28, 2015 I use Cortex R5F (TMS570LC4357) and I donot find the documentation for this particular port
Semaphore Execution timePosted by rtel on October 28, 2015 The quick start guide shows you how to locate the documentation:
http://www.freertos.org/FreeRTOS-quick-start-guide.html
although I believe the code TI are shipping is slightly different to
that in the FreeRTOS zip file download.
The web server seems very slow at the moment...hopefully that is a
temporary glitch.
Regards.
Semaphore Execution timePosted by sindhukrishnan on October 28, 2015 I find only Cortex R4F port available in Supported devices in the above link. Will FreeRTOS provide port for Cortex R5F in the near future?
Semaphore Execution timePosted by sindhukrishnan on October 28, 2015 May I know what are the possible conditions that causes Scheduler to Suspend itself when running FreeRTOS code ?
Semaphore Execution timePosted by rtel on October 28, 2015 I'm not sure that, from the perspective of the RTOS, there is a
difference between the two
(http://www.arm.com/products/processors/cortex-r/cortex-r5.php). Would
you disagree? I know WITTENSTEIN have supplied OpenRTOS for both.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|