cancel
Showing results for 
Search instead for 
Did you mean: 

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

one V
Associate III

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.

6 REPLIES 6

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

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

Modern Windows download drivers through Internet without letting you know.

Post the whole configuration descriptor.

JW

0690X000006D6T1QAK.png

0690X000006D6TBQA0.png

0690X000006D8DFQA0.pngChange the code and get the description:

0690X000006D8D5QAK.png

0690X000006D8DAQA0.png

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