Using tinyusb to create a virtual COM port with STM32 #2453
Unanswered
joshkahn42
asked this question in
Q&A
Replies: 1 comment
-
Hi @mithro Were you able to make a Virtual COM Port with TinyUSB for your STM32U585? I too want to use TinyUSB for making a Virtual COM Port. I have an STM32U575 on a custom board. Any pointers to how should I go about it? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am attempting to use tinyusb to create a virtual USB COM port with STM32 and running into some issues.
I am using the STM32u585, basing my work on this post in the discussion #633 (comment) and on the Getting Started documentation for tinyusb. I used the 2 cdc example to create a single cdc code that runs on my stm32.
I can see the stm32 in a USB Device Tree Viewer (https://www.uwe-sieber.de/usbtreeview_e.html) where it does show up as having a CDC interface descriptor.
I do not see the device as a COM port in windows Device Manager, which is what I want to achieve.
Any ideas on what I am missing?
Thanks
Report from Usb Device Tree viewer:
Connection Status : 0x01 (Device is connected)
Port Chain : 1-1-4
Properties : 0x01
IsUserConnectable : yes
PortIsDebugCapable : no
PortHasMultiCompanions : no
PortConnectorIsTypeC : no
ConnectionIndex : 0x04 (Port 4)
CompanionIndex : 0
CompanionHubSymLnk : USB#VID_2109&PID_0817#MSFT30000000000#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
CompanionPortNumber : 0x04 (Port 4)
-> CompanionPortChain : 2-2-4
Vendor ID : 0xCAFE (Unknown Vendor)
Product ID : 0x4001
USB Version : 2.0 -> but Device is Full-Speed only
Port maximum Speed : High-Speed (Companion Port 2-2-4 supports SuperSpeed)
Device maximum Speed : Full-Speed
Device Connection Speed : Full-Speed
Self powered : no
Demanded Current : 100 mA
Used Endpoints : 1
DriverKeyName : ERROR_INVALID_NAME
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\CAFE40010100
osvc : REG_BINARY 00 00
Connection Index : 0x04 (Port 4)
Connection Status : 0x01 (DeviceConnected)
Current Config Value : 0x00 (Configuration 0)
Device Address : 0x15 (21)
Is Hub : 0x00 (no)
Device Bus Speed : 0x01 (Full-Speed)
Number of open Pipes : 0x00 (0 pipes to data endpoints)
Data (HexDump) : 04 00 00 00 12 01 00 02 EF 02 01 40 FE CA 01 40 ...........@...@
00 01 01 02 03 01 00 01 00 15 00 00 00 00 00 01 ................
00 00 00 ...
Connection Index : 0x04 (4)
Length : 0x10 (16 bytes)
SupportedUsbProtocols : 0x03
Usb110 : 1 (yes, port supports USB 1.1)
Usb200 : 1 (yes, port supports USB 2.0)
Usb300 : 0 (no, port not supports USB 3.0) -> but Companion Port 2-2-4 does
ReservedMBZ : 0x00
Flags : 0x00
DevIsOpAtSsOrHigher : 0 (Device is not operating at SuperSpeed or higher)
DevIsSsCapOrHigher : 0 (Device is not SuperSpeed capable or higher)
DevIsOpAtSsPlusOrHigher : 0 (Device is not operating at SuperSpeedPlus or higher)
DevIsSsPlusCapOrHigher : 0 (Device is not SuperSpeedPlus capable or higher)
ReservedMBZ : 0x00
Data (HexDump) : 04 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00 ................
bLength : 0x12 (18 bytes)
bDescriptorType : 0x01 (Device Descriptor)
bcdUSB : 0x200 (USB Version 2.0) -> but device is Full-Speed only
bDeviceClass : 0xEF (Miscellaneous)
bDeviceSubClass : 0x02
bDeviceProtocol : 0x01 (IAD - Interface Association Descriptor)
bMaxPacketSize0 : 0x40 (64 bytes)
idVendor : 0xCAFE (Unknown Vendor)
idProduct : 0x4001
bcdDevice : 0x0100
iManufacturer : 0x01 (String Descriptor 1)
iProduct : 0x02 (String Descriptor 2)
iSerialNumber : 0x03 (String Descriptor 3)
bNumConfigurations : 0x01 (1 Configuration)
Data (HexDump) : 12 01 00 02 EF 02 01 40 FE CA 01 40 00 01 01 02 .......@...@....
03 01 ..
bLength : 0x09 (9 bytes)
bDescriptorType : 0x02 (Configuration Descriptor)
wTotalLength : 0x004B (75 bytes)
bNumInterfaces : 0x02 (2 Interfaces)
bConfigurationValue : 0x01 (Configuration 1)
iConfiguration : 0x00 (No String Descriptor)
bmAttributes : 0x80
D7: Reserved, set 1 : 0x01
D6: Self Powered : 0x00 (no)
D5: Remote Wakeup : 0x00 (no)
D4..0: Reserved, set 0 : 0x00
MaxPower : 0x32 (100 mA)
Data (HexDump) : 09 02 4B 00 02 01 00 80 32 08 0B 00 02 02 02 00 ..K.....2.......
00 09 04 00 00 01 02 02 00 04 05 24 00 20 01 05 ...........$. ..
24 01 00 01 04 24 02 02 05 24 06 00 01 07 05 81 $....$...$......
03 08 00 10 09 04 01 00 02 0A 00 00 00 07 05 02 ................
02 40 00 00 07 05 82 02 40 00 00 .@......@..
bLength : 0x08 (8 bytes)
bDescriptorType : 0x0B (Interface Association Descriptor)
bFirstInterface : 0x00 (Interface 0)
bInterfaceCount : 0x02 (2 Interfaces)
bFunctionClass : 0x02 (Communications and CDC Control)
bFunctionSubClass : 0x02
bFunctionProtocol : 0x00
iFunction : 0x00 (No String Descriptor)
Data (HexDump) : 08 0B 00 02 02 02 00 00 ........
bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x00 (Interface 0)
bAlternateSetting : 0x00
bNumEndpoints : 0x01 (1 Endpoint)
bInterfaceClass : 0x02 (Communications and CDC Control)
bInterfaceSubClass : 0x02 (Abstract Control Model)
bInterfaceProtocol : 0x00 (No class specific protocol required)
iInterface : 0x04 (String Descriptor 4)
Data (HexDump) : 09 04 00 00 01 02 02 00 04 .........
bFunctionLength : 0x05 (5 bytes)
bDescriptorType : 0x24 (Interface)
bDescriptorSubType : 0x00 (Header Functional Descriptor)
bcdCDC : 0x120 (CDC Version 1.20)
Data (HexDump) : 05 24 00 20 01 .$. .
bFunctionLength : 0x05 (5 bytes)
bDescriptorType : 0x24 (Interface)
bDescriptorSubType : 0x01 (Call Management Functional Descriptor)
bmCapabilities : 0x00
D7..2 : 0x00 (Reserved)
D1 : 0x00 (sends/receives call management information only over the Communication Class interface)
D0 : 0x00 (does not handle call management itself)
bDataInterface : 0x01
Data (HexDump) : 05 24 01 00 01 .$...
bFunctionLength : 0x04 (4 bytes)
bDescriptorType : 0x24 (Interface)
bDescriptorSubType : 0x02 (Abstract Control Management Functional Descriptor)
bmCapabilities : 0x02
D7..4 : 0x00 (Reserved)
D3 : 0x00 (not supports the notification Network_Connection)
D2 : 0x00 (not supports the request Send_Break)
D1 : 0x01 (supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State)
D0 : 0x00 (not supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature)
Data (HexDump) : 04 24 02 02 .$..
bFunctionLength : 0x05 (5 bytes)
bDescriptorType : 0x24 (Interface)
bDescriptorSubType : 0x06 (Union Functional Descriptor)
bControlInterface : 0x00
bSubordinateInterface[0] : 0x01
Data (HexDump) : 05 24 06 00 01 .$...
bLength : 0x07 (7 bytes)
bDescriptorType : 0x05 (Endpoint Descriptor)
bEndpointAddress : 0x81 (Direction=IN EndpointID=1)
bmAttributes : 0x03 (TransferType=Interrupt)
wMaxPacketSize : 0x0008 (8 bytes)
bInterval : 0x10 (16 ms)
Data (HexDump) : 07 05 81 03 08 00 10 .......
bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x01 (Interface 1)
bAlternateSetting : 0x00
bNumEndpoints : 0x02 (2 Endpoints)
bInterfaceClass : 0x0A (CDC-Data)
bInterfaceSubClass : 0x00
bInterfaceProtocol : 0x00
iInterface : 0x00 (No String Descriptor)
Data (HexDump) : 09 04 01 00 02 0A 00 00 00 .........
bLength : 0x07 (7 bytes)
bDescriptorType : 0x05 (Endpoint Descriptor)
bEndpointAddress : 0x02 (Direction=OUT EndpointID=2)
bmAttributes : 0x02 (TransferType=Bulk)
wMaxPacketSize : 0x0040 (64 bytes)
bInterval : 0x00 (ignored)
Data (HexDump) : 07 05 02 02 40 00 00 ....@..
bLength : 0x07 (7 bytes)
bDescriptorType : 0x05 (Endpoint Descriptor)
bEndpointAddress : 0x82 (Direction=IN EndpointID=2)
bmAttributes : 0x02 (TransferType=Bulk)
wMaxPacketSize : 0x0040 (64 bytes)
bInterval : 0x00 (ignored)
Data (HexDump) : 07 05 82 02 40 00 00 ....@..
Error : ERROR_GEN_FAILURE
none
Beta Was this translation helpful? Give feedback.
All reactions