We are using the Libuarte - advanced UARTE driver and sometimes see crashes in the uart_evt_handler code in nrf_libuarte_async.c when it gets a NRF_LIBUARTE_DRV_EVT_RX_DATA event with no data in the buffer because the sub_rx_count index is pointing just past the end of the buffer. I.e.-
I don't understand the reason to throw an error for no data, and it seems like this rare timing alignment can trigger the error when there really is no problem - just a gap about length of the timeout. (Much shorter or longer than the timeout would be fine. But the host we are talking to can have variable gaps between bytes sometimes.) It seems to me that the check for zero data on a NRF_LIBUARTE_DRV_EVT_RX_DATA is not needed, and in fact can intermittently trigger when a problem does not exist.
Is there a way around this without editing the nrf_libuarte_async.c library code?
If it matters, here are some more details:
- nRF52833
- 115200 baud (so each byte takes about 87 microseconds)
- timeout_us = 200