AnsweredAssumed Answered

LPC5410x UART overrun issue

Question asked by Sven Savic on Feb 16, 2019
Latest reply on Feb 20, 2019 by Kerry Zhou

I have always used interrupt based UART for any data transfer, so this is bit unknown to me. Seemingly most of my data goes down to the drain when I try to read uart "synchronously" (I dont mean synchronous mode of UART, but just not interrupt based).

 

I have loop something like this:

while (1) {

      if (uart.dataReady()) {

         buff = uart.receive();

         }

      delay_us(100);

}

 

uint8_t uart::dataReady()

{

   return IS_BIT_SET (channel.STAT, RXRDY);

}

uint8_t uart::receive()

{

  return channel.RXDAT;

}

 

If I put delay between each transmit sequence in the host system, this kinda works. but not reliably.

Without delay, I receive first character and then I get overrunint=1 in STAT and rest of the data is lost. 

Logic analyzer shows all data, and baud is set correctly (115200). Uart is connected to wifi module and host is connected over the wifi.

My packages are 10-30 bytes. I only receive first byte of each packet ?? 

 

With interrupt, everything works like a charm. .. so its obviously issue with collecting the data from UART.

Unfortunately, in this case I cant use interrupt as I need to write some data to FLASH RAM and if interrupt is enabled, uC got stuck after IAP_RAM2FLASH.

 

I dont need to do any operation when data transfer starts, so blocking calls are fine. How do I reliably read the whole data buffer synchronously ?

Outcomes