2023-06-26: Inter-Thread Communication Discussion
Problem Definition
We use FreeRTOS & the STM32 HAL. We have multiple managers that run on FreeRTOS tasks.
Each manager needs to communicate with other managers.
e.g. Path manager determines where to go, attitude manager controls the motors. How do we get path manager to tell attitude manager what to do?
What managers need to communicate with each other?
PM - AM
TM - PM
TM - AM
SM - AM
SF - AM
SF - PM
All managers will likely need to communicate with all other managers at some point
What are the different types of data that need to go between these managers?
Type 1) All data must be processed
Type 2) Most recent data must be processed
How do we get data between these managers?
Do what is simple. Implement a queue (research what the appropriate interface freertos provides) when all data must be processed. Design the appropriate one-off interface for most recent data (again, research the appropriate interface provided by freertos)
Potential Solutions
https://freertos.org/Inter-Task-Communication.html
Queues, Notifications, Messages, Mutexes, etc.
Â