我用的是USB虚拟串口,程序已经调通了,可以发送“STM32Vrtual”用上位机能接受到“STM32Vrtual”了,但是 我想发a[] 数组的数,为什么上位机只显示出来42个(这42个十六进制的数:48 4D 59 70 84 64 52 58 6B 5A 5A 67 6C 68 56 50 47 48 4A 4D 51 56 59 58 50 57 5A 5D 67 68 60 5D 5C 5C 55 57 5C 5D 58 52 53 4E 与数组a[]的前42个都能对应上),可是后面的就没有了,这么回事?? u8 a[] ={72,77,89,112,132,100,82,88,107,90,90,103,108,104,86,80,71,72, 74,77,81,86,89,88,80,87,90,93,103,104,96,93,92,92,85,87,92,93,88,82,83, 78,76,75,80,86,86,90,90,89,88,87,91,93,96,99,99,97,92,89,86,84,84,86,87, 84,83,81,80,79,79,84,88,91,92,93,92,91,90,91,94,96,96,94,93,89,84,82,82, 83,84,84,85,84,83,82,82,84,87,92,94,95,95,93,92,91,91,91,92,92,90,88,85, 82,80,81,82,83,85,86,86,85,85,87,89,91,94,95,95,94,92,90,89,88,89,89,89, 87,85,83,81,81,82,84,86,88,89,89,88,88,90,91,93,95,95,94,92,89,87,86,86, 86,86,86,85,83,82,82,82,85,87,89,91,91,91,90,91,91,92,93,93,92,90,89,86, 84,84,84,85,85,85,85,84,84,84,}; void USB_Send_Data(u8* data_buffer, u8 len) { count_in=len; UserToPMABufferCopy(data_buffer, ENDP1_TXADDR, count_in); SetEPTxCount(ENDP1, count_in); SetEPTxValid(ENDP1); } |
stm32 USB的CDC类传输掉数据
STM32F105 USB接收数据不断进入中断,出现“死机”现象
关于STM32CubeMX配置的USB例程电脑无法识别问题
STM32F407 USB-HS-OTG是否不外接PHY可以做虚拟串口?
如何做一个USB从机键盘用stm32f407
用STM32F4 Cube MX生成的USB Device C代码的BUG
USB Device + FatFS + SDIO 模拟U盘意外只读问题
USB Device + FatFS + SDIO 问题
STM32H7配置成USB DEVICE时,连接电脑时不进入中断
STM32F446 USB和串口1 冲突
RE:STM32 USB发送数据
回复:STM32 USB发送数据
你可以仿真一下,看看程序中 count_in的值到底是多少。还有USB一次发送的缓冲区是多大。
count_in的值就是sizeof(a)的长度啊。USB的缓冲区大小怎么看啊?!