Synergy S7 Uart overflow error

I am receiving data on UART on a Synergy S7 system from a custom board. It works correctly for a period of time (that often is not very long), then it suddenly stops working and the rx buffer is always empty.

This is the function that inserts data in my local buffer:

 status = g_sf_comms0.p_api->read(g_sf_comms0.p_ctrl, (uint8_t *)bufferRX, DIM_BUFFER_RX, TX_NO_WAIT);

I checked the value of status: when I can receive the data, its value is SSP_ERR_TIMEOUT.

When it stops working, its value is SSP_ERR_OVERFLOW.

I reset my local buffer after receiving data in this way:

memset(&bufferRX, 0, sizeof(bufferRX)); 

It seems that its not enough and that I need also to clear some specific buffer of the UART peripheral.

Is there a function that manage it (a "clear uart buffer" function)?

My project is blocked by this problem.

Thank you in advance

Parents Reply Children