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

How to Synchronize Multiple tasks

Posted by mukeshtalks on June 14, 2016

Hi,

I am working on FreeRtos Version 7.6. My application is Solar inverter based on STM32f3 CortexM4f3 Controller. Kernel tick is 1ms. I have created 4 tasks: 1. Task for Battery Charging Using Solar 2. Task for Inverter Control 3. Task for HMI(LCD and Keypad) 4. Task for Serial Communication. Wait for Que to receive data from USART interrupt.

Here i have kept the Task1, 2 and 4 at lowest priority (2), and Task 3 is at highest Priority(3) but there is a task delay of 4 Seconds so that other task get chance to run. Now i am facing the issue the task are not synchronised and not working properly. I need to Synchnorize them. I need help in uderstanding the the different and best option for synchronizing the task.

Regards, Mukesh


How to Synchronize Multiple tasks

Posted by davedoors on June 14, 2016

see http://www.freertos.org/xEventGroupSync.html


How to Synchronize Multiple tasks

Posted by mukeshtalks on June 14, 2016

Thanks Dave, Can i use other methods like Binary semaphores, Mutex Etc.


How to Synchronize Multiple tasks

Posted by rtel on June 14, 2016

I don't think the description of your problem is detailed enough to say, nor do you say why you would favour another method over xEventGroupSync().

xEventGroupSync() is designed specifically to synchronise more than two tasks at once. If you only want to synchronise two tasks at any time then you could use any of the communication mechanisms.


How to Synchronize Multiple tasks

Posted by mukeshtalks on June 14, 2016

Hi, Thnaks for your quic reply. Actually My application is using FreeRTOS Ver 7.6, Which i dont want to change to latest version at this movement because project is almost at end state and dont know the side effects of upgrading the RTOS version and don't have time as well. In this version xEventGroupSync() is not there if i am not wrong. I thing by syncronizing two of my major task Task 1 and task 2 (As mentioned Above) i feel My major problems can be solved but I need to try.

My Problem is both tasks 1 & 2 are running at the same priroity at kernel tick (1ms). But sometime both are executing at every 1ms and some time One of the task take more time to execute. Because of this My close lopp written in both the tasks are not working. I also share the structure b/w both task using mutex to avoid memory corruption.

Can you please suggest the simplest way to overcome this situation.


[ 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