2025-12-19 1:16 PM
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?
Solved! Go to Solution.
2025-12-28 8:34 AM - edited 2025-12-28 8:34 AM
Impedance won't matter for that short of a trace.
You said you swapped your data lines, what does that look like?
Still think pulling BOOT0 to 3V3 on reset is the best debug approach. You have a resistor there. If you can swap data lines, should be able to short that to 3V3.
Typically the device side has the plug connector, not receptacle.
Large in focus pictures of the board may help.
2025-12-19 1:24 PM
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.
2025-12-25 5:35 AM
Hi @PeppersONLY
Indeed, as mentioned @TDK UFQFPN48 is a fine-pitch package and can be tricky to solder.
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.
2025-12-26 6:08 PM - edited 2025-12-27 5:59 PM
ㅤㅤ
2025-12-27 5:58 PM - edited 2025-12-27 6:01 PM
I didnt expose any BOOT pins onto my PCB. The PCB was assembled with JLCPCB and I have tried 2 other of the same board and they have the same issue. I realized that I swapped the data lines to the usb connector footprints but still when swapping them externally to the correct lines I still get the same issue...
2025-12-27 6:00 PM
Hi. I dont think that the MCU's solder job is the issue as I had it assembled with JLCPCB. I am now wondering if the data lines impedance is faulty. I will check this and get back to you. Also, I realized that I swapped the data lines to the usb connector footprints but still when swapping them externally to the correct lines I still get the same issue...
2025-12-27 6:44 PM
I am pretty sure this USB routing should be fine but I checked on a impedance calculator and my traces could be a little thicker. I still think this should be ok because its only UBS FS.
2025-12-28 8:34 AM - edited 2025-12-28 8:34 AM
Impedance won't matter for that short of a trace.
You said you swapped your data lines, what does that look like?
Still think pulling BOOT0 to 3V3 on reset is the best debug approach. You have a resistor there. If you can swap data lines, should be able to short that to 3V3.
Typically the device side has the plug connector, not receptacle.
Large in focus pictures of the board may help.
2025-12-29 7:19 PM
Can't believe I hadn't tried this but I tried a different board and now it works fine must be a defect or bad solder job...