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,

14 REPLIES 14
LMorr.3
Senior II

My DM trace length is 206.67mm and the DP is 166.06mm.

Could the 40.61mm length delta potentially cause the corrupted USB descriptor data I'm seeing?

No, 40mm shouldn't matter on a 12 MHz signal. (You should probably get those a bit closer on the next revision though, if it happens, and route them side by side.)

USB is error-detecting/correcting so it's a bit weird that it gets through at all. Really feel like it could be a Linux driver thing, especially since it's consistent. But since it works if you change clocks that doesn't quite fit either. Can you try on a Windows machine? I assume the delays didn't help at all.

 

If you feel a post has answered your question, please click "Accept as Solution".

Ok thanks.  I will try on a Windows and a MAC.  You may be right about the Linux driver... considering the Vendor and Manufacturer are sometimes filled with 'default' data when the connection fails.  ( either a pi character or copying the value from Product to Serial Number and Manufacturer ) I don't think the USB protocol or uC is adding these default values so it must be the Linux driver.  I'll also try upgrading my Linux kernel.

I also had a logic analyzer connected to the DM/DP pins but could not decode to usable values.  ( lots of 'reset' and 'error' fragments )

LMorr.3
Senior II

I found the problem.  I tried on a MAC and Windows and it worked.  I then tried again on my Linux box, but using a USB port on my keyboard instead of using the USB ports on the front of my PC.  ( keyboard uses a different USB controller )  It worked flawlessly so it must be a bad USB port on the front of my PC.  It must have been damaged by all the abuse it has gone through with all my custom prototype boards.  Thanks for the heads-up, good call!

 

Not sure if I was supposed to mark this as the solution since the issue was my PC's USB controller hardware and not the Linux driver, but your suggestion led me to test on other machines/USB ports.  Thanks!