cancel
Showing results for 
Search instead for 
Did you mean: 

USB Device sometimes not recognized

LMorr.3
Senior II

Using an STM32F373, I setup a USB DEVICE virtual port class.  The connection does work but it takes disconnecting/reconnecting the USB cable once or twice before it gets detected successfully as a serial port/usb device on my linux box.  I use lsusb to see which USB devices are found, and when the connection intialy fails, I get the following message in 'dmesg':

"new full-speed USB device number 48 using xhci_hcd
usb 3-1: config index 0 descriptor too short (expected 67, got 9)
usb 3-1: config 1 has 0 interfaces, different from the descriptor's value: 2
usb 3-1: New USB device found, idVendor=0000, idProduct=0001, bcdDevice= 2.00
usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-1: Product: my Module
usb 3-1: Manufacturer: STMicroelectronics
usb 3-1: SerialNumber: 2077345D5646

 

If I disconnect the USB cable and reconnect it it usually works.

Any ideas on what I should look at to fix this issue?

Thank you,

2 REPLIES 2
Pavel A.
Evangelist III

It fails to return the configuration descriptor for some reason. Debug. Likely the host reads the device descriptor and strings first, but does not print that before parsing config descriptors.

 

What's odd is the descriptor Product, Manufacturer and Serial gets corrupted with 'pi' character or sometimes repeats the Product string for Manufacturer and Serial Number when it fails.  ( maybe USB uses those as defaults before they are read in ).  But the connection seems to work well when it does connect... 

Also, it always shows 'expected 67, got 9' so if it was receiving 'garbage' it would not always be '9' I would assume.  I'll keep looking...