AnsweredAssumed Answered

UART 'overrun' errors and missing bytes

Question asked by Dane Bouchie on Feb 3, 2016
Latest reply on Feb 5, 2016 by Marek Neuzil

Using a K-10 Processor with Processor Expert In KDS, we where trying to port over some code from a previous coldfire chip which simply takes characters from a uart and stores them into a buffer. Our baud rate is 115200.

 

Using a legacy UART component (AsyncSerial), using UART_OnRxCharExt(), we are able to retrieve byte-by-byte and store each one in our own buffer. Problem is, when sending larger streams (30+ bytes a time), a few bytes go missing and we receive an 'overrun' error.

 

Using the Serial_LDD with a ReadBlock() of a large number of bytes, we are able to pull in all data successfully, however, if we attempt to read character-by-character using a recursive method the same error occurs:

 

i=0;

ReadBlock(&char_buffer,1);

 

void Wireless_OnBlockReceived() {

buffer[i++] = char_buffer;

if (i > 200)

     i = 0; // This line is actually not reached during our test as the error occurs on the first "stream"

ReadBlock(char_buffer,1);

}

Outcomes