Quality RTOS & Embedded Software

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


Loading

Send broadcast message or semaphore post ...

Posted by debugasm on December 14, 2013

Hi,

is there a way to send a "broadcast message" through a queue or "semaphore post" to more than one recipient at the same time, without sending the message to a single recipient with loop (for() or while()) ?

Thanks very much.

debugasm


Send broadcast message or semaphore post ...

Posted by rtel on December 14, 2013

You can't do that using a semaphore, but you can using the new event groups implementation. Event groups are not in the current release, but can be obtained from SVN. See https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/include/event_groups.h for documentation.

Regards.


Send broadcast message or semaphore post ...

Posted by debugasm on December 14, 2013

Just what I needed for use multi-bit syncronize, like as uC-OS-xxx.

For send a message broadcast to multiple "message queue", there is something ?

Thanks very much.

debugasm


Send broadcast message or semaphore post ...

Posted by rtel on December 14, 2013

Not directly, but you can create the same effect using event bits to have tasks wait on an event signally a post to a queue, then have each task peek the queue to get the message. You can use the queue overwrite function to have a single message in the queue that is updated by a writer.

The logic of broadcasting a message implies the message is copied individually to every task that is waiting, which is a lengthy and non-deterministic operation (FreeRTOS does not allow lengthy or non-deterministic operations). Without that (just copying the message to a single place) it would create logic problems for the application writer - what would happen if the tasks waiting for the message were of different priorities and the low priority tasks didn't get a chance to run before the message was updated? Etc. One day we may figure out small and deterministic ways of implementing these things without doing things like walking lists with interrupts disabled (or other such thing that is banned from the FreeRTOS implementation) and then provide it in the main code, but I can't say when that will be. Software timers and event bits have similar problems (anything basically that has to service a list of non-determinant length), but we are happy with the solutions we came up with for those, so there is no reason why we would not eventually do the same for broadcast messages. [you are able to do the opposite - that is - have a task wait for messages on multiple queues]

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