Quality RTOS & Embedded Software

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


Loading

Semaphore/vTaskResume - 7.3.0

Posted by Westmoreland Engineering on November 2, 2012
First - Richard - I haven't had a chance to go through the new items in v7.3 - but for the low power additions - anything there specific for the MSP430 in the updated kernel? I will take a look.

2nd question - just a sanity check:
I have a semaphore that is given from an ISR periodically from a Timer IRQ. There is a task that blocks on this - but the task is also resumed asynchronously to, but not necessarily so, by another task.
Question is - if the timer IRQ makes the semaphore available more than once - and the task isn''t resumed - is that a problem? The semaphore is a binary semaphore - the ones preferred to be used from a timer IRQ - correct?

Thanks In Advance,
John

RE: Semaphore/vTaskResume - 7.3.0

Posted by Richard on November 2, 2012
“anything there specific for the MSP430 in the updated kernel”


There is not yet anything specific to the MSP430. There are generic hooks that allow the tickless mode to be used with a little coding on the application site too, as explained here: http://www.freertos.org/low-power-tickless-rtos.html. The Cortex-M ports have a built in implementation, and other ports will do in the future.

“Question is - if the timer IRQ makes the semaphore available more than once - and the task isn''t resumed - is that a problem?”


So, if the task is being resumed, it must have been suspended? Is that correct?

If it is suspended while it is waiting for a semaphore, when it is resumed it will re-check to see if the semaphore is available. If the semaphore is not available then it will block again to wait for it (assuming any specified block time remains). If the semaphore is available it will take it and exit the xSemaphoreTake() function.

If an interrupt 'gives' the semaphore twice while the task is suspended then the task will recognise the semaphore is available when it is resumed, but it won't recognise that the semaphore has been given twice. If you need it to know the semaphore has been given twice then use a counting semaphore.

Whether a binary or counting semaphore is preferred depends on the application.

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