Author Topic: USB HID device maximum speed  (Read 20194 times)

vitech07

  • Member
  • ***
  • Posts: 1
USB HID device maximum speed
« on: November 15, 2012, 03:08:21 am »
Hello, forum.
I've done USB FS HID device on STM32F4Discovery board as a client, PC is a host. Board is configured to transmit packet when it recieves packet from PC.
In specifications to HID it is described, that maximum speed of FS HID transfer is 64 kB/s (64 bytes every 1 ms), but in fact when i used 64b length packet with INTERRUPT transactions with WriteFile and ReadFile i got only 5 kB/s IN and 5 kB/s OUT (10 kB/s overall).
After that I decided to try CONTROL transaction with 64byte packet, Set_Feature and Get_Feature API functions. Tests showed following results: near 30 kB/s IN and 30 kB/s OUT (overall around our 64 kB/s limit).
Then I read here on forum, that feature packets can be increased in HID descriptor report from 64 bytes to 512 bytes. Results on my board with 512b control packets and Set_Feature Get_Feature functions: 100 kB/s IN and 100 kB/s OUT (200 kB/s total).

Question is: Can I get any faster speed with my HID device and how?

PS: is there any terminals to communicate with HID devices over CONTROL transfers? YAT from maettu_this works with INTERRUPT transactions only.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: USB HID device maximum speed
« Reply #1 on: November 15, 2012, 10:53:22 am »
From my HID FAQ:

On the interrupt endpoint(s), set bInterval to the minimum allowed value: 10 for low speed and 1 for full or high speed. Each call to ReadFile or WriteFile adds overhead, so send the data in fewer, longer reports and/or increase the ReadFile buffer size to enable reading multiple reports at once. (ReadFile returns as many reports as are available, up to ReadFile's buffer size.)

http://www.lvr.com/hidfaq.htm

64kB/sec is the maximum guaranteed bandwidth for full speed.

I don't know of any terminal applications that use control transfers for Input reports. A HID without an OUT interrupt endpoint will use control transfers for Output reports (with WriteFile).