本帖最后由 gzbkey 于 2016-5-25 14:56 编辑
用stm32f205,usb_host_device_lib,用cdc修改成自定义设备
DCD_EP_Tx 一次发送64字节没有问题,但是修改为128、512都出问题,下边的数据是修改为512,上位机接收到的数据,而且接收到4次就收不到数据了。
我修改了 CDC_DATA_MAX_PACKET_SIZE 512 ,和TX1_FIFO_FS_SIZE 512,TX2_FIFO_FS_SIZE 512
感觉是TX_FIFO_FS_SIZE 这里有什么相关的没有正确导致
接收到的数据,从 29 ad 开始就不是我发出的数据,换句话说,只有第一次收到的数据才是完全正确的。我进入调试状态查看,数据缓冲区的数据都是正确的,经过DCD_EP_Tx 发送后,出来的数据就有问题了
请教各位有经验的兄弟,应该如何解决?
第1次数据
5 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 7 8 9 8 0 0 0 0 0 7 72 3 4 5 6 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