Skip to main content
Associate II
July 15, 2024
Question

ST CDC Composite Device Working on Windows not working on MacOS

  • July 15, 2024
  • 2 replies
  • 1532 views

We have a STM32H7 based device that we want to communicate with over serial using USB. We created the USB Composite driver using the sample code.

When we connect our device to Windows it shows up as a Serial Port (COM12).

When we connect it to MacOS it just shows up as a USB Composite device and I can't figure out how to get it to show up as a serial port.

How do we fix this?

2 replies

Lead II
July 16, 2024

Check the USB enumeration (all the descriptors the MCU will send). Use a USB debugger/analyzer. I assume, your descriptors (enumeration) is slightly wrong.

ARPAuthor
Associate II
July 16, 2024

Thank you for the suggestions.

Would you be willing to give some guidance on exactly what I am looking for? If the descriptors are wrong, then why does it work just fine on Windows? Does that give us any clues as to what exactly might be wrong with the descriptors?

We took the values from the basic example.

ARPAuthor
Associate II
July 18, 2024

I installed a usb analyzer tool on my Windows computer. Below are the items I was able to see. Can you identify what might be incorrect or missing for MacOS that Windows doesn't care about?

Device Descriptors:

 Port: 1
 Speed: Full Speed
 Device address: 15
 Open pipes: 3
 Connection status: Device connected


Device Descriptor

 USB version: 2.0
 Device class: 0xef - Miscellaneous Device
 Device subclass: 0x2 - ?
 Device protocol: 0x1 - Interface Association
 Control pipe max size: 64 bytes
 Vendor ID: 0x483 (STMicroelectronics)
 Product ID: 0x52a4 (Unknown)
 Product version: 2.0
 Manufacturer: HolleyTuningGroup
 Product: HTG COMPOSITE DEVICE
 Serial Number: 356739573532
 Configurations: 1

Configuration Descriptors:

descriptors[0] = "Configuration Descriptor"
bLength = 9
bDescriptorType = USB_CONFIGURATION_DESCRIPTOR_TYPE (2)
wTotalLength = 75
bNumInterfaces = 2
bConfigurationValue = 1
iConfiguration = 0
Reserved = 0
SupportsRemoteWakeup = 0
SelfPowered = 1
PoweredByBus = 1
MaxPower = 0x32 -> 100 mA

descriptors[1] = "Interface Association Descriptor"
bLength = 8
bDescriptorType = USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE (11)
bFirstInterface = 1
bInterfaceCount = 2
bFunctionClass = 2
bFunctionSubClass = 2
bFunctionProtocol = 1
iFunction = 0

descriptors[2] = "Interface Descriptor"
bLength = 9
bDescriptorType = USB_INTERFACE_DESCRIPTOR_TYPE (4)
bInterfaceNumber = 1
bAlternateSetting = 0
bNumEndpoints = 1
bInterfaceClass = UsbCommunication (2)
bInterfaceSubClass = 2
bInterfaceProtocol = 7
iInterface = 0

descriptors[3] = "Class-Specific Interface Descriptor"
bLength = 5
bDescriptorType = CS_INTERFACE (36)
bDescriptorSubtype = 0
comm_interface = 
 bcdCDC = 272

descriptors[4] = "Class-Specific Interface Descriptor"
bLength = 5
bDescriptorType = CS_INTERFACE (36)
bDescriptorSubtype = 1
comm_interface = 
 call_capatibilities = 
 controls = 
 UseClassInterface = 0
 SelfControl = 0
 Reserved = 0
 bmCapatibilities = 0
 bDataInterface = 00000010

descriptors[5] = "Class-Specific Interface Descriptor"
bLength = 4
bDescriptorType = CS_INTERFACE (36)
bDescriptorSubtype = 2
comm_interface = 
 abstract_control_capatibilities = 
 controls = 
 FeatureSupport = 0
 LineStateSupport = 1
 Send_Break_Support = 0
 NotificationSupport = 0
 Reserved = 0
 bmCapatibilities = 00000010

descriptors[6] = "Class-Specific Interface Descriptor"
bLength = 5
bDescriptorType = CS_INTERFACE (36)
bDescriptorSubtype = 6
comm_interface = 
 bMasterInterface = 1
 bSlaveInterface = { 2 }

descriptors[7] = "Endpoint Descriptor"
bLength = 7
bDescriptorType = USB_ENDPOINT_DESCRIPTOR_TYPE (5)
bEndpointAddress = 3
Reserved = 0
Direction = Input
type = Interrupt (3)
reserved = 0
wMaxPacketSize = 8
bInterval = 16

descriptors[8] = "Interface Descriptor"
bLength = 9
bDescriptorType = USB_INTERFACE_DESCRIPTOR_TYPE (4)
bInterfaceNumber = 2
bAlternateSetting = 0
bNumEndpoints = 2
bInterfaceClass = UsbCommData (10)
bInterfaceSubClass = 0
bInterfaceProtocol = 0
iInterface = 0

descriptors[9] = "Endpoint Descriptor"
bLength = 7
bDescriptorType = USB_ENDPOINT_DESCRIPTOR_TYPE (5)
bEndpointAddress = 2
Reserved = 0
Direction = Output
type = Bulk (2)
reserved = 0
wMaxPacketSize = 64
bInterval = 0

descriptors[10] = "Endpoint Descriptor"
bLength = 7
bDescriptorType = USB_ENDPOINT_DESCRIPTOR_TYPE (5)
bEndpointAddress = 2
Reserved = 0
Direction = Input
type = Bulk (2)
reserved = 0
wMaxPacketSize = 64
bInterval = 0