2026-02-28 7:08 AM
I’m an amateur working on building an electronic device. Currently, I’m in the planning and prototyping phase and creating my own PCB design. My current project is based on the STM32F767-ZIT, and I’m having trouble getting the USB (USB-B) connection to work.
Power: VBUS is powered through a ferrite from 5 V on the female USB-B jack.
Data lines: D+ and D- are connected to PA11/PA12, each with 22 Ω resistors.
GND: connected to the board.
HSE: 8 MHz
Wires: relatively short, nothing unusual.
When connecting to a PC:
Windows plays the device connect sound, and a device appears in Device Manager.
The device shows as “Unknown USB Device (Device Descriptor Request Failed)”.
Properties:
Device type: USB Controller
Manufacturer: Standard USB Host Controller
Status: “This device has been stopped because it reported problems (Code 43)”
USBView shows: FailedEnumeration: Unknown USB Device (Device Descriptor Request Failed)
D+ shows 3–4 pulses when plugged in, then stays high (~3 V).
D- shows no activity, stays at 0 V.
Testing PA11/PA12 as GPIOs produces clean square waves on both lines.
When switching back to USB mode, D- remains at 0 V, and communication fails.
Windows SDK + USBView for debugging
USBView debug information:
[Port2] FailedEnumeration: Unknown USB Device (Device Descriptor Request Failed)
ConnectionStatus: FailedEnumeration
Device Bus Speed: Full
bLength: 0x00 (should be 18)
bDescriptorType: 0x00
bcdUSB: 0x0000
Device enumeration failure
I am not using VBUS sense on PA9. It seems optional, since Windows still detects a device (sound notification), so it appears functional in part.
Solved! Go to Solution.
2026-02-28 4:04 PM
The Problem is solved.
I got my custom code running after 36 hours LOL haha. it was pure pain.
I see now on the oscilloscope smooth signals for D+ and D- the differential pairs.
Problem was the Descriptors Lenght (0x1C instead of 0x18) String
Thanks for your fast respond to everyone I was kinda clueless at this point.
Have a nice Weekend
2026-02-28 7:51 AM
You dont tell : what should it do at all ? ..be a device, as a : ?
+
You made the setup with CubeMx?
What you choose : usb-> device ? device-> MSC, HID, ...?
2026-02-28 8:50 AM
What the device should be: a USB MIDI device (Audio Class, MIDI Streaming). So the PC sees it as a MIDI input/output, e.g. in DAWs or "USB MIDI" in Windows.
How it works / should work: The firmware uses the USB Device stack with a custom MIDI class (STM32 Cube does not ship a MIDI class, so we added one). Descriptors are Audio Control + MIDI Streaming, with one bulk IN and one bulk OUT endpoint. The host sends MIDI messages (notes, CC, etc.) on the OUT endpoint; the device can send MIDI on the IN endpoint. Standard USB MIDI 1.0.
Setup: Not from CubeMX’s device class list (there is no “MIDI” there). We chose USB_OTG_FS as Device only in CubeMX, then added the MIDI descriptors and class driver manually (similar to the Manhattan Audio Synth approach). So: USB → Device, and the “class” is a custom MIDI implementation, not MSC/HID/CDC.
2026-02-28 8:53 AM
Try known working USB device code. If that works, issue is your custom code.
2026-02-28 9:00 AM - edited 2026-02-28 9:01 AM
So try first , as @TDK also said, working USB device;
set it to CDC , serial should enumerate and work.
Then...replace with your MIDI device .
2026-02-28 9:15 AM
thanks I will try an respond asap
2026-02-28 4:04 PM
The Problem is solved.
I got my custom code running after 36 hours LOL haha. it was pure pain.
I see now on the oscilloscope smooth signals for D+ and D- the differential pairs.
Problem was the Descriptors Lenght (0x1C instead of 0x18) String
Thanks for your fast respond to everyone I was kinda clueless at this point.
Have a nice Weekend