2024-07-22 08:48 AM
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).
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:
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!
2024-09-11 08:24 AM
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.
2024-09-11 08:54 AM
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.
2024-09-11 03:21 PM
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.