Quality RTOS & Embedded Software

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


Loading

Semaphore Execution time

Posted 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 time

Posted 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 time

Posted 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 time

Posted 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 time

Posted by sindhukrishnan on October 28, 2015

I use Cortex R5F (TMS570LC4357) and I donot find the documentation for this particular port


Semaphore Execution time

Posted 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 time

Posted 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 time

Posted 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 time

Posted 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.


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


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner