Zigbee网关 上电时Zstack串口乱码

来源:互联网 发布:aws centos root 编辑:程序博客网 时间:2024/06/05 04:21

Zstack定义定义宏ZTOOL_P1的时候,系统开机的时候回输出一串乱码,


用16进制显示试试



乱码的十六进制字符串是 

FE 06 41 80 01 02 00 02 04 00 C2 


后经查找该字符串找到原因,这时开机的时候系统认为上次重启ZTOOL返回的状态信息

见http://www.ti.com.cn/cn/lit/an/swra444/swra444.pdf


经仔细查找,虽然没找到合适的解决方法,简单通过注释掉MT/MT_TASK.c中的串口打印函数该乱码即可消失

/*************************************************************************************************** * @fn      MT_TransportSend * * @brief   Fill in SOP and FCS then send out the msg * * @param   uint8 *pBuf - pointer to the message that contains CMD, length, data and FCS * * @return  None ***************************************************************************************************/void MT_TransportSend(uint8 *pBuf){  uint8 *msgPtr;  uint8 dataLen = pBuf[0]; /* Data length is on byte #1 from the pointer */  /* Move back to the SOP */  msgPtr = pBuf-1;  /* Insert SOP */  msgPtr[0] = MT_UART_SOF;  /* Insert FCS */  msgPtr[SPI_0DATA_MSG_LEN - 1 + dataLen] = MT_UartCalcFCS (pBuf, (3 + dataLen));  /* Send to UART */#ifdef MT_UART_DEFAULT_PORT  //HalUARTWrite(MT_UART_DEFAULT_PORT, msgPtr, dataLen + SPI_0DATA_MSG_LEN);#endif  /* Deallocate */  osal_msg_deallocate(msgPtr);}#endif /* MT_TASK *//*************************************************************************************************** ***************************************************************************************************/


注释掉

 //HalUARTWrite(MT_UART_DEFAULT_PORT, msgPtr, dataLen + SPI_0DATA_MSG_LEN);
经测试,乱码已经消失。

0 0
原创粉丝点击