AnsweredAssumed Answered

UART RX interrupt with no data

Question asked by biafra on Dec 12, 2018
Latest reply on Dec 16, 2018 by Kerry Zhou

Hi everyone,

 

I'm using MCUXpresso 10.2.1 with a custom board based on MK66F2M0.

I'm facing with a strange situation: sometimes I get the UART interrupt handling the RX data register full event, but in the buffer there is no data available.

 

/* Receive data register full */
if ((UART_S1_RDRF_MASK & base->S1) && (UART_C2_RIE_MASK & base->C2))
{
   /* Get the size that can be stored into buffer for this interrupt. */
#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO
   count = base->RCFIFO;
#else
   count = 1;
#endif
  ...

}

 

In this situation I get count = 0.

Why there is the rx data event and no data is available?

How can this situation be generated?

 

Many thanks

Biafra

Outcomes