cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
betontalpfa
Explorer
Explorer
422 Views
Registered: ‎10-12-2018

Overrun Error on XuartLite

Jump to solution

I have a UART link between two FPGAs, driven by XuartLite. The link is stable if the data is less than or equal 16 (the size of the HW FIFO in the IP) Greater packet causes Overrun Error.

The link should be slow enough (baud=115200) for the 100MHz Microblaze. (This means a byte arrives in each 9/115200 sec)

I read the link in polled mode, without any other tasks/IRQs, so this is a simple while loop:

while (1) {
    ReceivedCount += XUartLite_Recv(UartLitePtr,
                   RecvBuffer + ReceivedCount,
                   TEST_BUFFER_SIZE - ReceivedCount);
    if (ReceivedCount == packet_size) {
        break;
    }
    if(
        UartLitePtr->Stats.ReceiveFramingErrors ||
        UartLitePtr->Stats.ReceiveOverrunErrors ||
        UartLitePtr->Stats.ReceiveParityErrors
    ){
        // If we got an error, print statistics. 
        printStatus(UartLitePtr);
        ReceivedCountPrev = ReceivedCount;
    }
}

However, I get an Overrun Error.

What's do I wrong?

0 Kudos
Reply
1 Solution

Accepted Solutions
betontalpfa
Explorer
Explorer
411 Views
Registered: ‎10-12-2018

Sorry, it was completely my fault.

There was a printf between the send and the receive, which results in the late read of the FIFO. So when I reached this loop, the FIFO has been overrun.

View solution in original post

0 Kudos
Reply
1 Reply
betontalpfa
Explorer
Explorer
412 Views
Registered: ‎10-12-2018

Sorry, it was completely my fault.

There was a printf between the send and the receive, which results in the late read of the FIFO. So when I reached this loop, the FIFO has been overrun.

View solution in original post

0 Kudos
Reply