My UART receives consistent wrong data

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

My UART receives consistent wrong data

355 Views
NVazquez
Contributor IV

I am using TX and RX interrupt routine for uart. The board is receiving less than 30 characters from an external device. When it receives 15 or 16 it just receives the last char multiple times(more than 200 times). I am using a serial analyzer to check what exactly the Tx is transmitting. It just transmits 30 characters something. The Rx receives the data fine until 15th and 16th character then it starts receiving the last character multiple times

 

the following is my Rx routine,

 

void DEMO_USART_IRQHandler(void)
{
uint8_t data = 0;

/* If new data arrived. */
if ((kUSART_RxFifoNotEmptyFlag | kUSART_RxError) & USART_GetStatusFlags(DEMO_USART))

{

data = USART_ReadByte(DEMO_USART);
if( ( bIgnoreFirstZero == CLEAR ) && ( data ) )
{
bIgnoreFirstZero = SET;
}
if(bIgnoreFirstZero == SET)
{
if( ( data == CARRIAGE_RETURN ) )
{
bTportUartDataRec = SET;
}
else if( data == END_OF_TEXT )
{
bTportUartDataRec = SET;
}
else
{
*(gUARTReciveStr+gStrOffset)= data;
gStrOffset++;
}
}
}
SDK_ISR_EXIT_BARRIER;
}

 

 

Not sure if I am checking the correct flags?

 

 

The following is the configuration.

NVazquez_0-1667241386292.png

 

 

Labels (1)
0 Kudos
Reply
1 Reply

348 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @NVazquez ,

How about first use UART example under SDK ?

If still have issue, please tell me chip part number , and the steps how to reproduce your issue on my side, thanks!

 

BR

Alice

0 Kudos
Reply