UART receiving buffer flush doesn't work

Hi all,
I wrote application for Q2687 which listens for data on UART. Sometimes I need to flush UART receiving FIFO but function io_control() with IOC_UART_FL doesn’t work. Here is code I use:

eUartFl_t flush=UART_FLUSH_ALL;
eChStatus_t status;
status=uart1_itf.io_control(Uart1Handle, IOC_UART_FL, (void*)&flush);
TRACE((1, "FL %d", status));

Returned status is CH_STATUS_NORMAL, but FIFO remains untouched, calling this:

while(uart1_itf.read(Uart1Handle, &receivedCharacter, 1))
TRACE((1, "%c", receivedCharacter));

after flushing FIFO proves that it still contains recived data. Have you had similar problem?

Hi,

Can you confirm the data is the one that was supposed to be flushed?

Regards,
Rex_alex

I’m quite sure that calling

uart1_itf.io_control(Uart1Handle, IOC_UART_FL, (void*)&flush);

does nothing, I did some tests with artificial data send from Hercules terminal to GSM module. It doesn’t flush single byte. I could simply read data from UART FIFO and drop them in software but it seems to be inefficient.

Hi,

Please share the details about the FW, OS/OASiS version.

Regards,
Rex_alex