none
Is there a maximum size for BufferLength in WinUsb_ControlTransfer RRS feed

  • Question

  • Hi there,

    I want to use the WinUsb_* functions to communicate to our USB(2) device. So far everything seems to work as expected. One necessity we have, is to send a rather large configuration file (200kB) over the Control Endpoint to the Device. I understand that the maximum buffer size of a control Transfer cannot be larger than 65536 (because of the WINUSB_SETUP_PACKET.Length member being an USHORT). When I call WinUsb_ControlTransfer with a BufferLength larger than 4096, the transfer fails and the LastError indicates some Invalid Parameter (87) --- Is there any way to do a control transfer with the "full" 65kB in WinUSB ??

    Thanks a lot,
    Detlef

    Thursday, February 7, 2013 1:13 PM

Answers

  • The control transfer limit is sometimes even lower than 64k. For USB Low Speed and USB Full Speed devices, it is generally only 4k. What speed is your device running at?
    Friday, February 8, 2013 11:58 PM

All replies

  • The control transfer limit is sometimes even lower than 64k. For USB Low Speed and USB Full Speed devices, it is generally only 4k. What speed is your device running at?
    Friday, February 8, 2013 11:58 PM
  • Hi Philip,

    Our device is a High-Speed device. And with the driver provided by the chip-vendor I can transfer the 64k in one transfer... Unfortunately, that other driver has a problem related to non-Endpoint-0 transfers, that's why I was using WinUSB....

    Monday, February 11, 2013 6:16 AM
  • Here is the answer:

    USB Transfer and Packet Sizes

    This states that the maximum transfer size is 4k for Control Pipes.... Unlucky though, that this is not to be found in the "User-Mode" documentation: WinUsb_ControlTransfer function


    • Edited by DSanchen Monday, February 11, 2013 9:45 AM fixed links
    Monday, February 11, 2013 9:41 AM