Part Number: AM2612
We are using the UART LLD driver and have encountered an exception during UART_lld_read().
While debugging, we found that the exception is triggered inside UART_procLineStatusErr().
The following code restores the receive buffer pointer:
/* Reset the read buffer and read count so we can pass it back */ hUart->readBuf = hUart->readBuf - hUart->readCount;
When a line-status error (FE/PE/BI/OE) occurs, UART_procLineStatusErr() empties the RX FIFO and then adjusts readBuf using readCount.
However, in our environment, this operation causes hUart->readBuf to point to an address lower than the original rxBuf passed to UART_lld_read(). After that, the driver accesses an invalid memory region and an exception occurs.
Questions:
- Is this a known issue in the UART LLD driver?
- Under what conditions can readBuf become inconsistent with readCount?
- Is there an official workaround or patch available?
- Is it not necessary to clear `readCount` after executing the code below?
hUart->readBuf = hUart->readBuf - hUart->readCount;
Environment:
- Device: AM261x
- MCU+ SDK: 26.01.00.08
- Driver file: uart_v0_lld.c
- API: UART_lld_read()
Any guidance or recommended fix would be appreciated.
Best Regards