初学者,最近卡在了将串口接收到的数据写入Flash中。
想问下UART如何判定一段数据的接收完成,是否存在相应的标志位。
在123gxl的例子程序usb_dev_serial中没有发现与此相关的部分。
如果有相应标志位,请告知。如果没有,那该如何实现数据的接收完成呢。
谢谢。
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.
初学者,最近卡在了将串口接收到的数据写入Flash中。
想问下UART如何判定一段数据的接收完成,是否存在相应的标志位。
在123gxl的例子程序usb_dev_serial中没有发现与此相关的部分。
如果有相应标志位,请告知。如果没有,那该如何实现数据的接收完成呢。
谢谢。
Lucky
你可以自定义一个协议,比如在发送数据之前,发送一个数据包size的数值,然后Tiva根据该数值来决定是否接收完毕。
另外,请问楼主需要的是什么应用?
谢谢回答。我先按照你说的方法试一试。
我现在只是单纯的使用串口完成了通信,自定义协议之前还没碰到过,不知道有相关的example。
现在想拓展一下,将串口接收到的数据存到Flash中去。
Lucky
你可以先将接收的数据存到Ram中,接收完毕后再写入Flash.
谢谢你的建议。
我是自己编写了一个java小程序,将所要传输的bin文件的大小计算出来后
将大小以unsigned int的形式添加在了bin文件的首部。通过改变bin文件来实现的功能。
不知道有没有有关串口协议的例子,想学习一下。
谢谢。
Lucky
没有相关的例程。
实际上,Tiva的Bootloader通过串口升级便是一个类似的例程。你可以去看一下源代码,只是会消耗一定的精力来理解消化。
你好,现在遇到一个问题!当我拨掉JTAG的连接线后,串口不能发送据,当重新插上JTAG线后,串口才能正常的工作!请问一下这是什么情况?