cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411 USB device not working with windows custom PCB

PeppersONLY
Associate

I created a custom STM32F411 PCB. I can program it and blink a LED for example just fine. I also have a STM32 blackpill board which uses the same MCU. When I run some USB HID code it works fine on the blackpill but once uploaded to my custom PCB and I plug it into my windows PC, it says the usb device malfunctioned and is not working. I followed all the guidelines from the datasheet for the USB design. (I dont need external pull-ups for D+, no need for VBUS sensing). Also I have a 25Mhz HSE clock that is properly configured for the precise 48Mhz USB clock even though its only running at FS. Any ideas to why this might be happening?

PeppersONLY_0-1766178736015.png

PeppersONLY_1-1766178932485.png

 

 

2 REPLIES 2
TDK
Super User

Nothing wrong with what is shown as far as I can see.

If the same code works on equivalent hardware, the problem is likely not the code.

For an UFQFPN48, I immediately question solderability. Was the part loaded correctly? Is the pad connected to GND? Faulty solder connections?

Reset it with BOOT0 held high and BOOT1 held low. does the USB DFU bootloader start? If not, there's a problem with the hardware.

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

Hi @PeppersONLY 

Indeed, as mentioned @TDK UFQFPN48 is a fine-pitch package and can be tricky to solder. 

  • Ensure the USB D+ and D- lines are routed correctly with controlled impedance (~90 Ω differential).
  • Check for proper USB line length matching and minimal stubs.
  • Ensure stable power supply and clean with proper decoupling capacitors near the MCU

If still cannot connect to DFU bootloader, you need to analyze your clock configuration and review your USB line routing

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.