My UART receives consistent wrong data

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

My UART receives consistent wrong data

782件の閲覧回数
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

 

 

ラベル(1)
0 件の賞賛
返信
1 返信

775件の閲覧回数
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 件の賞賛
返信