Tool/software:
Hi
I have issues with timeout UART_read.
Example is uart_echo:
Added the code at the end between DebugP_log and driversClose like this:
DebugP_log("All tests have passed!!\r\n");
for (int i=0;i<30;i++)
{
trans.buf = &gUartReceiveBuffer[0U];
trans.count = APP_UART_RECEIVE_BUFSIZE;
trans.timeout = 1000;
transferOK = UART_read(gUartHandle[CONFIG_UART_CONSOLE], &trans);
DebugP_log("Read %d -> ok = %d\r\n",i,transferOK);
}
Board_driversClose();
It's a ~1sec timeout read, the serial does not have anything here (using a simple text console to send the 8 characters needed by the example for echo).
The console looks like this:
12345678
All tests have passed!!
Read 0 -> ok = -1
Read 1 -> ok = 0
Read 2 -> ok = 0
Read 3 -> ok = 0
Basically what I get is a FAIL for 1st try and than I get SystemP_SUCCESS no matter how much I try and it is visible that only the 1st try waits the 1 second, after that it returns almost instant.
The culprit seems to be this part of uart_v0.c:

The status seems to be -1 on UART_lld_readIntr which is correct (it must be timeout) by the return of the function is 0.
Am I doing something wrong? Timeout is not supposed to work with blocking/interrupt?
Best regards,








