Hi, Drugo,
Regarding your question, it seems that you want to use FreeRTOS and do not want to use the uart driver in SDK2.0, of course, it is okay. For the example code located at:
C:\Freescale\SDK2.0_K64F\boards\frdmk64f\rtos_examples\freertos_uart\kds
The freertos_uart examples is based on the example without OS located at:
C:\Freescale\SDK2.0_K64F\boards\frdmk64f\driver_examples\uart\interrupt_ring_buffer_transfer\kds
This is the mechanism of interrupt_ring_buffer_transfer example, first of all, the uart is initialized, a callback functioin is installed, then call the sender() or receiver() function. The example uses interrupt mechanism to transfer data, in other words, in the ISR of uart, the UARTx_D is read or written in ISR of the uart, in the ISR, we check if the predefined number of data has received or sent, if the predefined number of data has been received or sent, the callback function is called. In the main(), user should create the callback function himself, in the callback(), update a bool flag. in the main(), user should poll the flag to know if the redefined number of datas has been received or sent.
The rtos_examples is based on the interrupt_ring_buffer_transfer example, because the FreeRTOS is used, in the above callback() function, the xEventGroupSetBitsFromISR() is called. While in the UART_RTOS_Send() or UART_RTOS_Receive() function, the mcu is blocked at the function xEventGroupWaitBits(), the FreeRTOS can switch the task automatically based on the event triggering mechanism. But If you use FreeRTOS, it is difficult to debug.
From your description, it seems that you want to write the uart code yourself withour calling the SDK driver based on interrupt, it is okay, but if you call the xEventGroupSetBitsFromISR() in ISR of uart, the efficiency of code is very very low, because sending/receiving EACH byte, the xEventGroupSetBitsFromISR() is called and OS have to swich task. If you use the mechanism that after a bunch of bytes has been transferred, an event happens, and the OS switch task, it is the same as the rtos_examples, why do not you use it?
Hope it can help you.
BR
Xiangjun Rong