Part Number: MCU-PLUS-SDK-AM243X
Hello TI,
Currently, I am working on the UART example provided in the SDK for the R5 core with freeRTOS.
I modified the example code with a while loop as follows
void uart_echo(void *args)
{
int32_t transferOK;
UART_Transaction trans;
Drivers_open();
Board_driversOpen();
DebugP_log("[UART] Echo example started ...\r\n");
UART_Transaction_init(&trans);
while(1)
{
/* Send entry string */
gNumBytesWritten = 0U;
trans.buf = &gUartBuffer[0U];
strncpy(trans.buf,"This is uart echo test blocking mode\r\nReceives 8 characters then echo's back. Please input..\r\n", APP_UART_BUFSIZE);
trans.count = strlen(trans.buf);
transferOK = UART_write(gUartHandle[CONFIG_UART_CONSOLE], &trans);
APP_UART_ASSERT_ON_FAILURE(transferOK, trans);
/* Read 8 chars */
gNumBytesRead = 0U;
trans.buf = &gUartReceiveBuffer[0U];
trans.count = APP_UART_RECEIVE_BUFSIZE;
transferOK = UART_read(gUartHandle[CONFIG_UART_CONSOLE], &trans);
APP_UART_ASSERT_ON_FAILURE(transferOK, trans);
/* Echo chars entered */
gNumBytesWritten = 0U;
trans.buf = &gUartReceiveBuffer[0U];
trans.count = APP_UART_RECEIVE_BUFSIZE;
transferOK = UART_write(gUartHandle[CONFIG_UART_CONSOLE], &trans);
APP_UART_ASSERT_ON_FAILURE(transferOK, trans);
/* Send exit string */
gNumBytesWritten = 0U;
trans.buf = &gUartBuffer[0U];
strncpy(trans.buf, "\r\nAll tests have passed!!\r\n", APP_UART_BUFSIZE);
trans.count = strlen(trans.buf);
transferOK = UART_write(gUartHandle[CONFIG_UART_CONSOLE], &trans);
APP_UART_ASSERT_ON_FAILURE(transferOK, trans);
DebugP_log("All tests have passed!!\r\n");
}
Board_driversClose();
Drivers_close();
return;
}
whenever, I enter the input from the serial terminal, it is always appending carriage return as shown below and when in a loop it misses the data as carriage return is appended into the buffer as shown below.

I always entered user input "welcome2", but on the screen you can see the data loss caused by the carriage return 0x0d.
Do you have any workaroud for this problem?
Thanks & regards
Teja