develop FreeRTOS project where two tasks need to write to the same UART peripheral
@Middleware & OS
Hello Guys, I was asked to develop FreeRTOS project where two tasks need to write to the same UART peripheral, while Implementing mutual exclusion using a mutex to prevent data corruption
Please can anyone help me with this
13 Replies
My 2 cents, take it out leave it: It seems many people are lately using freertos to do things which may not require using an rtos. If you can at all justify it, go for a non-rtos design first.
I agree with the sentiment above, do you need RTOS for this, couldnt a busy flag work here?
A busy flag could but my organization is more interested in implementing RTOS in each of their designs
this should help https://www.digikey.co.za/en/maker/projects/introduction-to-rtos-solution-to-part-6-freertos-mutex-example/c6e3581aa2204f1380e83a9b4c3807a6
DigiKey
Introduction to RTOS - Solution to Part 6 (FreeRTOS Mutex Example)
Example of using mutexes in FreeRTOS
Also writes to a sensor so should almost be drop in
Thanks, I really appreciate this, am using a vxworks
I haven't used that one before
Funny vxWorks is from Wind River
that is the code that became Zephyr if you are interested
check it out it may be more similar than you think
I will go through the documentation you sent my and try implementing.
This would be very helpful, I would do that now, thanks once again
check this out too it may help https://docs.zephyrproject.org/latest/kernel/services/synchronization/mutexes.html