Hi Niyanth
The example uses single instance of UART IP and writes string into, then reads back chars. After every 4B receives, these are sent back on UART.
This example also showing that if the reading from ring buffer is slower than writing to it, buffer will overflow. To show this situation, data reading is slowed down by 1s delay.
In uart_task
/* Send data */
do
{
error = UART_RTOS_Receive(&handle, recv_buffer, sizeof(recv_buffer), &n);
if (error == kStatus_UART_RxHardwareOverrun)
{
/* Notify about hardware buffer overrun */
if (kStatus_Success !=
UART_RTOS_Send(&handle, (uint8_t *)send_hardware_overrun, strlen(send_hardware_overrun)))
{
vTaskSuspend(NULL);
}
}
if (error == kStatus_UART_RxRingBufferOverrun)
{
/* Notify about ring buffer overrun */
if (kStatus_Success != UART_RTOS_Send(&handle, (uint8_t *)send_ring_overrun, strlen(send_ring_overrun)))
{
vTaskSuspend(NULL);
}
}
if (n > 0)
{
/* send back the received data */
UART_RTOS_Send(&handle, (uint8_t *)recv_buffer, n);
}
vTaskDelay(1000);
} while (kStatus_Success == error);
remark this line will solve this issue
// vTaskDelay(1000);
Regards
Daniel