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.

cc2530_z-stack串口接收数据_总是丢失帧的第二个字节。。。。请指点啊。。。



串口接收数据部分程序,摘取如下:

(说明:两个不同的工程,但是在测试的时候,把这个串口处理函数都修改为如下所示,结果有些区别)

void MT_UartProcessZToolData ( uint8 port, uint8 event )
{
    uint8 count = 0;//从串口接收到字节的个数
    uint8 flag = 0;
    (void)event;
    
    while(Hal_UART_RxBufLen(port))
    {
        HalUARTRead(port, &COMRxBuf[count++], 1);
        flag = 1;
    }

    HalUARTWrite(0, COMRxBuf, count);
}

串口调试助手发送、接收,结果如下:
1.
[发送]00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
[接收]00       02 03 04 05 06 07 08 09 10 11 12 13 14 15 68 10 00 81 00 00 00 00 00 00 00 02 00 02 85 16(中间空格是我自己分开的,方便看)
2.
[发送]00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
[接收]00       02 03 04 05 06 07 08 09 10 11 12 13 14 15

请问这两个工程的问题出在哪儿?请各位帮忙啊,谢谢。。。。。。