cancel
Showing results for 
Search instead for 
Did you mean: 

USB device not recognized - running crystalless USB on an STM32L422KBT6

MadCowKP
Associate

I am desperately trying to get the USB interface to work on an STM32L422KBT6. On my custom-designed board, the microcontroller is connected to a USB port via two differential lines (D+ and D-). The board is powered by LDOs through the VBUS. Here is the board layout, with the BOOT0 pin subsequently pulled to GND (had forgotten to do that).

Platinenlayout.pngSchaltplan.png

In the Device Configuration Tool, under RCC, 'CRS SYNC' is set to 'CRS SYNC Source USB'. Under Connectivity -> USB, the checkbox for Device (FS) is checked, and under Middleware and Software Packs -> USB_DEVICE, 'Communication Device Class (Virtual Port Com)' is selected as the Class For FS IP. Programming is done with the ST-Link V2 debugger via SWDP. The Clock Configuration is as follows:

Clock Configuration.png

Regardless of whether I use MSI or HSI48 as the clock for the USB bus, I receive the error message: 'The last USB device you connected to this computer malfunctioned, and Windows does not recognize it.'

Despite reading numerous application notes and much more, I am at a loss. Can anyone tell me what I am doing wrong? Thank you in advance!

3 REPLIES 3
FBL
ST Employee

Hi @MadCowKP 

It seems you did good to keep length matching rooting does not seem to be differential pair (90Ohm). Did you check power supply? Check if your cable is shielded. Or use USB analyzer to monitor USB traffic

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.

liaifat85
Senior III

Please take a multimeter and measure the voltage on VBUS (Pin 1, PA9). This is important to ensure the 5V is correctly reaching the STM32 when connected to the host.

gbm
Lead III

Use HSI48 with CRS sync to USB.

Try increasing stack and heap size to twice the default values.

No need to connect VBUS input but mauke sure that VBUS detection is disabled in USB config settings.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice