uart_read_bytes hangs after event
Posted: Fri Dec 15, 2023 2:10 pm
I'm using the ESP IDF UART driver. I receive an event with event.size=9 bytes (for example). Then I try to uart_read_bytes for 9 bytes and the code still takes 1000ms sometimes. Is this expected? I would assume that once the event is there and has the number of bytes, those bytes would be ready in the FIFO immediately. Is that not a correct assumption?
Relevant code is:
Relevant code is:
Code: Select all
if (xQueueReceive(uart_queue, (void *)&event, (TickType_t)portMAX_DELAY)) {
switch (event.type) {
// Event of UART receiving data
case UART_DATA:
// Sometimes this takes > 1sec to read 9 bytes.
bytesRead = uart_read_bytes(SPROC_UART_PORT_NUM, readBuffer, event.size, portMAX_DELAY);
break;