cancel
Showing results for 
Search instead for 
Did you mean: 

USB Host "No registered class for this device."

Flankiste
Associate

Hi, i'm working on connecting a multimeter to an stm32f2 via USB (STM32 as a HOST). The goal is to send SCPI commands to it (I easly did it in python just to chek the correct behevor of the multimeter).
I implemented the USB Host lib but after few hours of debugging i cant figure out how to set the active class... (phost->pActiveClass != NULL) return false and i get "No registered class for this device". I have setup CDC in cubeMX but doesn't seems to work).
I use the USBH_CDC_Transmit to send command to the multimeter but since the USBH_UserProcess state machine never reach APPLICATION_READY state it's not even a thing (i tryed sending commands in APPLICATION_START state but no success either).

I get the folowing output with max lvl of debug :

USB Device Connected
USB Device Reset Completed
PID: ea60h
VID: 10c4h
Address (#1) assigned.
Manufacturer : Silicon Labs
Product : METRIX MX5060
Serial Number : 10003926
Enumeration done.
This device has only 1 configuration.
Default configuration set.
No registered class for this device.

 

Regards,


- Flankiste

 

6 REPLIES 6
FBL
ST Employee

Hi @Flankiste 

Did you refer to the example provided here ? Do you use a reference board? You may need to attach minimum firmware to replicate the issue or attach a USB traffic using USB analyzer or sniffer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


Pavel A.
Super User

Is it a composite device perhaps?

I don't really understand your question. The device is a multimeter, but the USB COM interface is managed by a CP210x chip from Silicon Labs. And yes, I've checked the example provided, but it doesn't help much since it is made for CDC class devices. So it looks like I need to use my own implementation of the CP210 driver. After some more digging, I stumbled across this repo:
https://github.com/henla464/USB_Host_Shield_Library_2.0/blob/master/CP210x.cpp
Do you think it's possible to adapt it and use it alongside the USBH library ?

AFAIK, at least some CP210x do not conform to the USB CDC standard. Their USB descriptors can indicate a vendor-specific class (0xFF) rather than the CDC class. From the referred source, CP210 has 3 endpoints similar to the CDC so it may be possible to adapt the ST CDC driver. Since the device does not expose the standard CDC class, the "core" host code also should be adapted (match by VID & PID instead of class).

 

 

Hi @Flankiste @Pavel A. 

Interesting ! You suggest to customize USBH_SelectInterface when initializing the interface

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


I mean this line to select the class:

https://github.com/STMicroelectronics/STM32CubeF2/blob/a50f3a40ff3110eb44d45fd2908a9590d25a1d9e/Middlewares/ST/STM32_USB_Host_Library/Core/Src/usbh_core.c#L641

Only for this specific project, if the USB class for that device is FF.  Not suggesting to change the ST middleware library.