cancel
Showing results for 
Search instead for 
Did you mean: 

What could cause Usb Bad Descriptor and how to debug

FGERA.1
Associate

Hello,

It's my first try with Usb directly on an MCU, i used stm32cube mx and code generator to make a first test but when i'm running a simple cdc code i get windows throwing me an error about usb bad descriptor.

I linked my ioc and my usb schematic, i tried with and without the filter inductance0693W000006E90lQAC.png(usb connected is just wired to an exti)

1 ACCEPTED SOLUTION

Accepted Solutions
Piranha
Chief II

The D+/D- lines are reversed around TVS1. Also for TVS1 you should use 82400102 from WE or USBLC6-2SC6 from ST.

View solution in original post

5 REPLIES 5
Uwe Bonnes
Principal III

First test with system bootloader if your board enumerates. If yes, the problem is in your code. It not carefully check for hardware errors, bridges, opens, wrong parts etc.

Piranha
Chief II

The D+/D- lines are reversed around TVS1. Also for TVS1 you should use 82400102 from WE or USBLC6-2SC6 from ST.

Uwe Bonnes
Principal III

And they should be directly connected!

FGERA.1
Associate

the lines was reversed, very dumb mistake, i'm able to use bootloader and cube mx example, thanks.

thanks for the tip for tvs @Piranha​ , this device will be in an industrial environement direct connection seems little dangerous isn't it ?

I'm not a huge fan of ST's Hal, what do you guy's use for interact with usb ?

I've not used USB stacks till now, but it looks like TinyUSB is getting traction.