Skip to main content
one V
Associate III
Jan 14, 2019 2:09 PM UTC
Question

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

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.

6 replies

waclawek.jan
Super User
Jan 14, 2019 2:33 PM UTC

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
Jan 15, 2019 2:36 AM UTC

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
Jan 15, 2019 7:54 AM UTC

Modern Windows download drivers through Internet without letting you know.

Post the whole configuration descriptor.

JW

one V
one VAuthor
Associate III
Jan 15, 2019 9:45 AM UTC

0690X000006D6T1QAK.png

0690X000006D6TBQA0.png

waclawek.jan
Super User
Jan 18, 2019 10:08 PM UTC

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