This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Hi Team,
We are using the AM2634-Q1 control card and have enabled all six UARTs in our application, which is based on the UART Hello World example. We have some queries regarding UART functionality:
Semaphore Handling in UART:
In all the UART examples, each UART has a dedicated task that gets blocked by a semaphore and waits for the callback function to release it. The semaphore is then locked again during read or write operations.
Since this approach requires six separate tasks for six UART peripherals, does this method consume CPU memory or other resources during the waiting period?
Looking forward to your insights.
Hi,
1. Since we are creating 6 different FreeRTOS tasks, it will indeed consume system resources such as Stack memory, FreeRTOS Kernel objects such as semaphores and tasks, Each task will have its own stack memory, task switching overhead based on interrupts etc. During the waiting period, when semaphore has been blocked, there won't be any CPU usage but there will be memory usage for the Task created (task stack, PCB stack and semaphore object memory)
2. You can try to create a single task running multiple UART instances (one task to handle 6 UART instances), maintain a queue where all UART Callbacks push received data/events and a single task waits on the queue and processes UART data/events sequentially (depends on your application design)
Regards,
Shaunak