Zigbee网关 上电时Zstack串口乱码
2015-11-11 13:22
1316 查看
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中的串口打印函数该乱码即可消失
注释掉
用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);经测试,乱码已经消失。
相关文章推荐
- Android 中Fragment使用
- 第一个spark+scala程序
- requestAnimationFrame
- UIRefreshControl
- JSP中request对象常用方法汇总
- 黑马程序员——基础知识——网络传输
- MySQL中用户及权限管理学习
- angularJS的directive
- IE浏览器清除缓存及历史浏览数据
- IE浏览器清除缓存及历史浏览数据
- Ruby 命名
- 使用POI动态更新导出的EXCEL模板中的列
- udp服务器监听(多线程)
- drupal中的缓存
- 关于多线程与异步的部分问题的总结
- EF中Code First模式初探
- Fragment中super.onResume调用时机
- QT位置相关函数
- 三大WEB服务器对比分析(apache ,lighttpd,nginx)
- MapReduce Map Join 样例