FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [June 2016 Threads] How to Synchronize Multiple tasksPosted 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 tasksPosted by davedoors on June 14, 2016 see http://www.freertos.org/xEventGroupSync.html
How to Synchronize Multiple tasksPosted by mukeshtalks on June 14, 2016 Thanks Dave, Can i use other methods like Binary semaphores, Mutex Etc.
How to Synchronize Multiple tasksPosted 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 tasksPosted 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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|