This repository contains projects to demonstrate usbx repository.
This example works as a USB HID device. It will appear as a USB mouse device on PC.
This example works as a USB HID device. It will appear as a USB keyboard device on PC.
This example works as a USB HID device. It will appear as a USB consumer device on PC.
This some usb tools free that can help use to develop his application:
- Thesycon USB Descriptor Dumper: https://www.thesycon.de/eng/usb_descriptordumper.shtml
- USBDeview to manage USB devices: https://usbdeview.com/
Information for device STM32 USB AUDIO VCP (VID=0x4542 PID=0x5998):
Device current bus speed: FullSpeed Device supports USB 1.1 specification Device supports USB 2.0 specification Device address: 0x000F Current configuration value: 0x00 Number of open pipes: 0
0x12 bLength
0x01 bDescriptorType
0x0200 bcdUSB
0xEF bDeviceClass (Miscellaneous device)
0x02 bDeviceSubClass
0x01 bDeviceProtocol
0x40 bMaxPacketSize0 (64 bytes)
0x4542 idVendor
0x5998 idProduct
0x0200 bcdDevice
0x01 iManufacturer "STMicroelectronics"
0x02 iProduct "STM32 USB AUDIO VCP"
0x03 iSerialNumber "AUDIO_VCP"
0x01 bNumConfigurations
0x09 bLength 0x02 bDescriptorType 0x0161 wTotalLength (353 bytes) 0x05 bNumInterfaces 0x01 bConfigurationValue 0x00 iConfiguration 0xC0 bmAttributes (Self-powered Device) 0x19 bMaxPower (50 mA)
0x08 bLength
0x0B bDescriptorType
0x00 bFirstInterface
0x03 bInterfaceCount
0x01 bFunctionClass (Audio Device Class)
0x00 bFunctionSubClass
0x20 bFunctionProtocol (Audio Protocol IP version 2.00)
0x00 iFunction
0x09 bLength 0x04 bDescriptorType 0x00 bInterfaceNumber 0x00 bAlternateSetting 0x00 bNumEndPoints 0x01 bInterfaceClass (Audio Device Class) 0x01 bInterfaceSubClass (Audio Control Interface) 0x20 bInterfaceProtocol (Audio Protocol IP version 2.00) 0x00 iInterface
0x09 bLength 0x24 bDescriptorType 0x01 bDescriptorSubtype 0x0200 bcdADC 0x08 bCategory (IO_BOX) 0x0097 wTotalLength (151 bytes) 0x00 bmControls
0x08 bLength 0x24 bDescriptorType 0x0A bDescriptorSubtype 0x18 bClockID 0x01 bmAttributes 0x01 bmControls Clock Frequency Control - read only 0x00 bAssocTerminal 0x00 iClockSource
0x11 bLength 0x24 bDescriptorType 0x02 bDescriptorSubtype 0x12 bTerminalID 0x0101 wTerminalType (USB Streaming) 0x00 bAssocTerminal 0x18 bCSourceID 0x02 bNrChannels (2 channels) 0x00000003 bmChannelConfig 0x00 iChannelNames 0x00 bmControls 0x00 iTerminal
0x22 bLength 0x24 bDescriptorType 0x06 bDescriptorSubtype 0x16 bUnitID 0x12 bSourceID 0x0000000F bmaControls(0) Mute Control - host programmable Volume Control - host programmable 0x00000000 bmaControls(1) 0x00000000 bmaControls(2) 0x00000000 bmaControls(3) 0x00000000 bmaControls(4) 0x00000000 bmaControls(5) 0x00000000 bmaControls(6) 0x00 iFeature
0x0C bLength 0x24 bDescriptorType 0x03 bDescriptorSubtype 0x14 bTerminalID 0x0301 wTerminalType (Speaker) 0x00 bAssocTerminal 0x16 bSourceID 0x18 bCSourceID 0x0000 bmControls 0x00 iTerminal
0x08 bLength 0x24 bDescriptorType 0x0A bDescriptorSubtype 0x19 bClockID 0x01 bmAttributes 0x01 bmControls Clock Frequency Control - read only 0x00 bAssocTerminal 0x00 iClockSource
0x11 bLength 0x24 bDescriptorType 0x02 bDescriptorSubtype 0x11 bTerminalID 0x0201 wTerminalType (Microphone) 0x00 bAssocTerminal 0x19 bCSourceID 0x02 bNrChannels (2 channels) 0x00000003 bmChannelConfig 0x00 iChannelNames 0x00 bmControls 0x00 iTerminal
0x22 bLength 0x24 bDescriptorType 0x06 bDescriptorSubtype 0x15 bUnitID 0x11 bSourceID 0x0000000F bmaControls(0) Mute Control - host programmable Volume Control - host programmable 0x00000000 bmaControls(1) 0x00000000 bmaControls(2) 0x00000000 bmaControls(3) 0x00000000 bmaControls(4) 0x00000000 bmaControls(5) 0x00000000 bmaControls(6) 0x00 iFeature
0x0C bLength 0x24 bDescriptorType 0x03 bDescriptorSubtype 0x13 bTerminalID 0x0101 wTerminalType (USB Streaming) 0x00 bAssocTerminal 0x15 bSourceID 0x19 bCSourceID 0x0000 bmControls 0x00 iTerminal
0x09 bLength 0x04 bDescriptorType 0x01 bInterfaceNumber 0x00 bAlternateSetting 0x00 bNumEndPoints 0x01 bInterfaceClass (Audio Device Class) 0x02 bInterfaceSubClass (Audio Streaming Interface) 0x20 bInterfaceProtocol (Audio Protocol IP version 2.00) 0x00 iInterface
0x09 bLength 0x04 bDescriptorType 0x01 bInterfaceNumber 0x01 bAlternateSetting 0x01 bNumEndPoints 0x01 bInterfaceClass (Audio Device Class) 0x02 bInterfaceSubClass (Audio Streaming Interface) 0x20 bInterfaceProtocol (Audio Protocol IP version 2.00) 0x00 iInterface
0x10 bLength 0x24 bDescriptorType 0x01 bDescriptorSubtype 0x12 bTerminalLink 0x00 bmControls 0x01 bFormatType (FORMAT_TYPE_1) 0x00000001 bmFormats PCM 0x02 bNrChannels (2 channels) 0x00000003 bmChannelConfig 0x00 iChannelNames
0x06 bLength 0x24 bDescriptorType 0x02 bDescriptorSubtype 0x01 bFormatType (FORMAT_TYPE_1) 0x03 bSubslotSize 0x18 bBitResolution (24 bits per sample)
0x07 bLength 0x05 bDescriptorType 0x01 bEndpointAddress (OUT endpoint 1) 0x01 bmAttributes (Transfer: Isochronous / Synch: None / Usage: Data) 0x0126 wMaxPacketSize (1 x 294 bytes) 0x01 bInterval (1 frames)
0x08 bLength 0x25 bDescriptorType 0x01 bDescriptorSubtype 0x00 bmAttributes 0x00 bmControls 0x00 bLockDelayUnits (undefined) 0x0000 wLockDelay
0x09 bLength 0x04 bDescriptorType 0x02 bInterfaceNumber 0x00 bAlternateSetting 0x00 bNumEndPoints 0x01 bInterfaceClass (Audio Device Class) 0x02 bInterfaceSubClass (Audio Streaming Interface) 0x20 bInterfaceProtocol (Audio Protocol IP version 2.00) 0x00 iInterface
0x09 bLength 0x04 bDescriptorType 0x02 bInterfaceNumber 0x01 bAlternateSetting 0x01 bNumEndPoints 0x01 bInterfaceClass (Audio Device Class) 0x02 bInterfaceSubClass (Audio Streaming Interface) 0x20 bInterfaceProtocol (Audio Protocol IP version 2.00) 0x00 iInterface
0x10 bLength 0x24 bDescriptorType 0x01 bDescriptorSubtype 0x13 bTerminalLink 0x00 bmControls 0x01 bFormatType (FORMAT_TYPE_1) 0x00000001 bmFormats PCM 0x02 bNrChannels (2 channels) 0x00000003 bmChannelConfig 0x00 iChannelNames
0x06 bLength 0x24 bDescriptorType 0x02 bDescriptorSubtype 0x01 bFormatType (FORMAT_TYPE_1) 0x03 bSubslotSize 0x18 bBitResolution (24 bits per sample)
0x07 bLength 0x05 bDescriptorType 0x82 bEndpointAddress (IN endpoint 2) 0x05 bmAttributes (Transfer: Isochronous / Synch: Asynchronous / Usage: Data) 0x0126 wMaxPacketSize (1 x 294 bytes) 0x01 bInterval (1 frames)
0x08 bLength 0x25 bDescriptorType 0x01 bDescriptorSubtype 0x00 bmAttributes 0x00 bmControls 0x00 bLockDelayUnits (undefined) 0x0000 wLockDelay
0x08 bLength 0x0B bDescriptorType 0x03 bFirstInterface 0x02 bInterfaceCount 0x02 bFunctionClass (Communication Device Class) 0x02 bFunctionSubClass (Abstract Control Model - ACM) 0x01 bFunctionProtocol (ITU-T V.250) 0x00 iFunction
0x09 bLength 0x04 bDescriptorType 0x03 bInterfaceNumber 0x00 bAlternateSetting 0x01 bNumEndPoints 0x02 bInterfaceClass (Communication Device Class) 0x02 bInterfaceSubClass (Abstract Control Model - ACM) 0x01 bInterfaceProtocol (ITU-T V.250) 0x00 iInterface
0x05 bFunctionalLength 0x24 bDescriptorType 0x00 bDescriptorSubtype 0x0110 bcdCDC
0x05 bFunctionalLength 0x24 bDescriptorType 0x01 bDescriptorSubtype 0x00 bmCapabilities 0x04 bDataInterface
0x04 bFunctionalLength 0x24 bDescriptorType 0x02 bDescriptorSubtype 0x02 bmCapabilities
0x05 bFunctionalLength 0x24 bDescriptorType 0x06 bDescriptorSubtype 0x03 bControlInterface 0x04 bSubordinateInterface(0)
0x07 bLength 0x05 bDescriptorType 0x83 bEndpointAddress (IN endpoint 3) 0x03 bmAttributes (Transfer: Interrupt / Synch: None / Usage: Data) 0x0008 wMaxPacketSize (1 x 8 bytes) 0x05 bInterval (5 frames)
0x09 bLength
0x04 bDescriptorType
0x04 bInterfaceNumber
0x00 bAlternateSetting
0x02 bNumEndPoints
0x0A bInterfaceClass (CDC Data)
0x00 bInterfaceSubClass
0x00 bInterfaceProtocol
0x00 iInterface
0x07 bLength 0x05 bDescriptorType 0x05 bEndpointAddress (OUT endpoint 5) 0x02 bmAttributes (Transfer: Bulk / Synch: None / Usage: Data) 0x0040 wMaxPacketSize (64 bytes) 0x00 bInterval
0x07 bLength 0x05 bDescriptorType 0x84 bEndpointAddress (IN endpoint 4) 0x02 bmAttributes (Transfer: Bulk / Synch: None / Usage: Data) 0x0040 wMaxPacketSize (64 bytes) 0x00 bInterval
Microsoft OS Descriptor is not available. Error code: 0x0000001F
Index LANGID String 0x00 0x0000 0x0409 0x01 0x0409 "STMicroelectronics" 0x02 0x0409 "STM32 USB AUDIO VCP" 0x03 0x0409 "AUDIO_VCP"
Connection path for device: USB xHCI Compliant Host Controller Root Hub STM32 USB AUDIO VCP (VID=0x4542 PID=0x5998) Port: 4
Running on: Windows 10 or greater (Build Version 22631)
Brought to you by TDD v2.19.0, Dec 5 2023, 12:08:38