This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] PROCESSOR-SDK-AM64X: Variable number of bytes read by UART

Part Number: PROCESSOR-SDK-AM64X

Tool/software:

Greetings,

For a use case, where characters are received via UART RX, we define the UART Transaction parameters.

In the UART Transaction parameters, we define .count as well, which denotes the number of characters to be read.

But, when the number of characters to be read is variable and not known beforehand, then this can be handled with a certain combination.

Let's have a look at the same.

Regards,

Vaibhav

  • One such combination/modification that can be done is to add a timeout along with taking a note of the number of characters read.

    trans.timeout = number_of_CPU_ticks; //  for timeout of the UART Transaction.

    count = ((UART_Config *)gUartHandle[CONFIG_UART_CONSOLE])->object->uartLld_handle->readCount; // once the timeout happens, count will now store the number of characters read. Note, in this case the number of characters read will be short of original transaction.count value.