embeddedsw
embeddedsw copied to clipboard
Missing UART event XUARTPS_EVENT_SENT_DATA when transmitting
I'm experiencing issue when transmitting reasonable amount of data using interrupt driven UART. In general it is working but sometimes (sporadically) it looks like missing final UART interrupt (I guess XUARTPS_IXR_TXEMPTY) when sending last chunk. Therefore I never get XUARTPS_EVENT_SENT_DATA event.
Can anybody explain why there is check for RX interrupts in following code of function XUartPs_SendBuffer:
https://github.com/Xilinx/embeddedsw/blob/836d748f91eda280bac23d0200df8a3bef61c0c3/XilinxProcessorIPLib/drivers/uartps/src/xuartps.c#L390
if (((ImrRegister & XUARTPS_IXR_RXFULL) != (u32)0) ||
((ImrRegister & XUARTPS_IXR_RXEMPTY) != (u32)0)||
((ImrRegister & XUARTPS_IXR_RXOVR) != (u32)0)) {
XUartPs_WriteReg(InstancePtr->Config.BaseAddress,
XUARTPS_IER_OFFSET,
ImrRegister | (u32)XUARTPS_IXR_TXEMPTY);
}