Quality RTOS & Embedded Software

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




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists