I’m new to FreeRTOS and eager to learn more about it. I have just joined a project which uses FreeRTOS to perform full-speed USB transfers and some simple user interface tasks.
Now I wish to port a few low data rate tasks from a different MCU into the project, and wonder what is the best approach. The low data rate tasks are typicically receiving a few characters over the UART, interpreting them in a state machine, and then forward some of them to an SPI interface. In previous versions (without the USB) I didn’t mind the program hanging while waiting for this kind of slow data. But it would ruin the USB transfers. My data rates are typically 100kbaud, largest data file to forward from UART to SPI is 2kBytes. Response time is not very critical.
As a beginner, I wonder what is the best approach. Should I simply do the UART transfers in tasks with low priority, assuming the OS will sort things out, or should I rather have tasks blocked while waiting for data, with semaphores, interrupts etc.? Or are there better approaches still? Are there UART functions in FreeRTOS which already support blocking until data ready?
Existing code runs on AVR without FreeRTOS, port will run on AVR32 with FreeRTOS.