Skip to main content
FGERA.1
Associate
December 1, 2020
Solved

What could cause Usb Bad Descriptor and how to debug

  • December 1, 2020
  • 4 replies
  • 2441 views

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)

This topic has been closed for replies.
Best answer by Piranha

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

4 replies

Uwe Bonnes
Chief
December 1, 2020

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
PiranhaBest answer
Principal III
December 1, 2020

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

Uwe Bonnes
Chief
December 1, 2020

And they should be directly connected!

FGERA.1
FGERA.1Author
Associate
December 1, 2020

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 ?

Piranha
Principal III
January 16, 2021

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