In my system I'm using the UART as a debuger/verbose tool. (For productions/testing when the target isn't connected via JTAG).
I'm using Free RTOS.
My UART task is regularly sending messages out over the UART about the state of the system (e.g. "Application Started", "Battery Level = 3v" etc...) However I also want the UART task to respond to incoming chars/strings. E.g. If the '?' character is received by the uC I want it to respond with (for example) the software version number.
I'm sending strings over the UART using UART_RTOS_Send()
However I can't find a way to receive data without (in effect) polling.
The example at \boards\frdmkl43z\rtos_examples\freertos_uart basically just echos out any received characters, rather than sending and receiving interdependently. Digging a little deeper, UART_RTOS_Receive() calls UART_TransferReceiveNonBlocking() which in itself doesn't block the task, however the next line xEventGroupWaitBits() is called - this blocks the task until something is received.
In pseudo-code I want the uart tasl to do somethign along the lines of:
(Other tasks send messages to this task to transmit things over the UART)
// Now send that message out over the UART
// Can't use UART_RTOS_Receive() as that blocks the task
process_that_string(); // This may include sending something back over UART
Am I missing something or going about this completely the wrong way?