Quality RTOS & Embedded Software

NOTE:This is a read only archive of threads posted to the FreeRTOS support forum. Use these archive pages to search previous posts. New forum support threads can be started at the FreeRTOS forums.

FreeRTOS Support Archive

The FreeRTOS support forum can be used for active support both from Amazon Web Services and the community. In return for using our software for free, we request you play fair and do your bit to help others! Sign up for an account and 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. Use these archive pages to search previous posts. New forum support threads can be started at the FreeRTOS forums.

UART communication

Hi, i am using the Arduino Uno with the ATMEGA328p microcontroller.
I wanna implement UART communication and i am not sure of the process when using freertos.
Doing uart communcation without freertos is no problem for me but with Freertos i dont know what functions to use.
I have done some reading and i went through the freertos pdfs and saw some examples but i am not very clear on them.
Please it would be great if i got some steps on how to go about it.
Thank you

UART communication

I don’t know how the UART works on the Arduino, but I suspect it will be
a simple uart write function that is not thread safe. If you have
access to the registers and interrupt service routines then you can
create a driver that uses FreeRTOS primitives and therefore allows
readers and writers to block – otherwise you will just have to put a
wrapper around the uart functions to prevent context switches while they
are being used – for example wrap in a
vTaskSuspendAll()/xTaskResumeAll() pair. Ideally just have a single
thread that accesses the UART, and if other threads need to access it to
then have those other threads send their messages to the task that is
allowed to access the UART and have that task actually send them out.