2016-12-06 11:27 AM
Hi.
I implemented USB HS communication (CDC class) between STMF769 Discovery board (device) and PC (host). It works as expected when I want to send less or more than 2048 bytes. But with 2048 I don't receive anything on the PC side. As said, if Len parameter to CDC_Transmit_HS(uint8_t* Buf, uint16_t Len) function is 2047 or 2049 or anything else, I receive everything. Only when Len is 2048, I don't receive anything.
Any idea? Is this a bug in CDC drivers maybe?
Thanks
#usb-cdc #usb-hs #stm32f7 #usb2016-12-06 03:11 PM
I think you'll find the same 'problem' with any length that is a multiple of 64. A transaction is only complete when a partial packet is sent (for HS, less than 64 bytes). Try following your 2048 byte send by a 0 byte send. This isn't a flaw of the CDC code per se, although it would have been helpful if it were documented in the Cube code.
Geoffrey
2016-12-06 04:26 PM
The ZERO LENGTH PACKET thing.... ?
2016-12-06 11:25 PM
I don't receive anything neither if I
consecutively call:
CDC_Transmit_HS((uint8_t *)Buffer, 2048) ;
CDC_Transmit_HS((uint8_t *)Buffer, 0) ;
nor:
CDC_Transmit_HS((uint8_t *)Buffer, 2048) ;
CDC_Transmit_HS((uint8_t *)Buffer, 2048) ;
But if I call:
CDC_Transmit_HS((uint8_t *)Buffer, 4096) ; I receive all 4096 bytes. So, the theory about multiple of 64 isn't correct...
2017-09-14 08:03 AM
Hi obid.matic
I have problem with sending bytes by usb cable at all. I want to use stm32cubemx and when I plug in the cable, my laptop recognizes the virtual com. but hyperterminal can not open the com and I cant send any data. could you send me a sample code to see what is wrong. Sorry for my english. Thanks in advance!