Skip to main content
one V
Associate III
January 14, 2019
Question

STM32 USB HID HOST enumeration gamepad is not successful, what should I do?

  • January 14, 2019
  • 3 replies
  • 1426 views

STM32 USB HID HOST Reads the gamepad. When enumerated, it finds that the handle has a custom device interface type(InterfaceClass) of 0xFF and HID of 0x03. The code is generated using STM32cubemx (5.0.1).

Usbh_core.c:

If(phost->pClass[idx]->ClassCode == phost->device.CfgDesc.Itf_Desc[0].bInterfaceClass)

The former is 0x03 and the latter is 0xFF.

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
January 14, 2019

That means, that the gamepad is not a HID class compliant device.

bInterfaceClass=0xFF means that the interface is vendor-specific, and the protocol to talk to it is proprietary. In operating system (such as Windows), the vendor supplies the driver. In STM32, you can't use this device, unless the vendor tells you the protocol.

JW

one V
one VAuthor
Associate III
January 15, 2019

But the PC side is driver-free.

The PC can directly recognize the gamepad.

0690X000006D66qQAC.png

Click the home button to bring up the interface.

Data can be read using the USBlyzer.

0690X000006D66vQAC.png

but MCU:

0690X000006D670QAC.png

waclawek.jan
Super User
January 15, 2019

Modern Windows download drivers through Internet without letting you know.

Post the whole configuration descriptor.

JW

one V
one VAuthor
Associate III
January 15, 2019

0690X000006D6T1QAK.png

0690X000006D6TBQA0.png

waclawek.jan
Super User
January 18, 2019

There is only one interface, (as bNumInterfaces = 1 in CfgDesc ) and that is bInterfaceClass=0xFF = Vendor.

So it's as I've written above: it's not a HID class, it's a vendor-defined device, which works only with vendor-provided drivers.

JW