correct bulk size for highspeed endpoint in dynamic_configuration and usbtmc exmaples#1516
correct bulk size for highspeed endpoint in dynamic_configuration and usbtmc exmaples#1516
Conversation
|
@hathach, perhaps you can explain this to me? Will this cause any issues when a high-speed device is talking to a full-speed host (or using a full-speed hub)? Since it would be a full-speed connection, the packets shouldn't be more than 64 bytes, but the descriptor will statically report a maxPacketLen of 512? (I'm not so familiar with high-speed USB, so please pardon my ignorance) (It looks like the correct answer is to have two sets of descriptors, and update the example application code to choose the appropriate one. If so, I can write up a patch?) |
|
For complete compatible with FS hub/host, highspeed-capable device must prepare 2 configuration descriptors: fs and hs and return correct one according to the actual link speed. When HS-capable device working in FS link, it may need to answer to the tinyusb/examples/device/cdc_msc/src/usb_descriptors.c Lines 143 to 233 in ae8b8f0 Note: The driver reserve max 512 bytes for buffering, but should only use the actual packet size from actual descriptor if needed. For cdc driver it simply schedule the max possible (512) since typically, cdc transfer end with short packet and have an stream buffered. |
|
PS: I will update the usbtmc example later to also support this scenario :) |
Thanks! I didn't want to create more work for you (but on the other hand, I don't have any HS devices to test...) I unfortunately used |
|
No problems at all, you added usbtmc driver before I have sorted this hs/fs thing out. I will double check the example and driver when having time. |
Describe the PR
fix #1457, close #1459
bulk endpoint size must be 512 for highspeed and 64 for FS, dynamic_configuration and usbtmc examples hard coded to 64 and cause an assert in the stack