This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6748 串口接收错误



我用C6748串口读取IMU模块信息,但是基本上只能接收一帧(8个字节),之后程序一直跳进UART_INTID_RX_LINE_STAT== int_id 这个地方,不知道哪里有问题?

while((UART_INTID_RX_DATA == int_id)||(UART_INTID_CTI == int_id))
{
if(UART_INTID_RX_DATA == int_id){
for(i = 0;i < 8; i++){
Receive[i] = UARTCharGet(SOC_UART_2_REGS);
printf("Receive = %d\n",Receive[i]);
}
int_id = UARTIntStatus(SOC_UART_2_REGS);
}
else if(UART_INTID_CTI == int_id){
Receive[i] = UARTCharGet(SOC_UART_2_REGS);
printf("Receive = %d\n",Receive);
int_id = UARTIntStatus(SOC_UART_2_REGS);
}
// Packet_Decode(Receive);

if(UART_INTID_RX_LINE_STAT == int_id)
{
while(UARTRxErrorGet(SOC_UART_2_REGS))
{

rxErrData=UARTCharGetNonBlocking(SOC_UART_2_REGS);
printf("rxErrData = %d\n",(int)rxErrData);
// UARTInit(); //串口初始化
UARTFIFOEnable(SOC_UART_2_REGS);

}
}