sharing UART for multiple tasks.
Posted: Wed Jul 31, 2024 8:26 am
Hi there,
I'm developing a device for data logging purpose. It mostly performs 2 FreeRTOS tasks. Firstly, forward all the packets received at UART2 to UART1 and vice versa (High priority). Secondly, send requests of its own to gather data for logging register values via UART1 (lower priority). As you can see, UART1 must be shared for both of these tasks. Moreover, maintain a robust concurrency. I have tried Mutexes, Semaphores, Queue, sometime with ISR (most of these introduces latency in data logging task). Semaphores seems to achieve this but is not flawless. Please suggest a best approach for achieving this.
I'm developing a device for data logging purpose. It mostly performs 2 FreeRTOS tasks. Firstly, forward all the packets received at UART2 to UART1 and vice versa (High priority). Secondly, send requests of its own to gather data for logging register values via UART1 (lower priority). As you can see, UART1 must be shared for both of these tasks. Moreover, maintain a robust concurrency. I have tried Mutexes, Semaphores, Queue, sometime with ISR (most of these introduces latency in data logging task). Semaphores seems to achieve this but is not flawless. Please suggest a best approach for achieving this.