2025-03-18 10:54 PM
Hi,
I´m trying to get a USB HID Host running on a STM32G0 with STM32CubeMX and STM32CubeIDE.
Unfortunately all examples or topics in ST communities don´t really work. Also the USB wiki doesn´t provide a clear explanation of all commands available in the libraries. Maybe it´s also a problem, that the examples for the G0 don´t use FreeRTOS...
Can anyone help which commands (in which order) I´ve to use to read data (in my case from a CP2110 USB to UART bridge)?
My current code:
usbState = USBH_InterruptReceiveData (&hUsbHostFS, buf, 5, 0);
usbState = USBH_Get_DevDesc (&hUsbHostFS, 10);
USBH_SetAddress (&hUsbHostFS, 0x28);
usbState = USBH_OpenPipe (&hUsbHostFS, 0, 0x28, 1, 0, 0, 8);
USBH_HID_SetReport(&hUsbHostFS, USB_H2D, 0x50, &buf, 10); // Used to configure the CP2110
USBH_HID_GetReport(&hUsbHostFS, USB_H2D, 0x01, &buf, 3); // Attempt to read data
Best regards,
Achim
2025-05-20 6:33 AM
Hello,
As far as I know the CP2110 does not support native CDC ACM virtual port com, which requires specific driver from host side. Otherwise you could get some host examples supporting FreeRTOS from other STM32 packages STM32F7, STM32H7 ... which can be easily ported to STM32G0 platform
Regards
2025-05-21 5:30 AM
Hi,
as far as I know, in Windows no special driver is needed to see the CP2110 as a HID device.
The initialization fails at USBH_FindInterface(...);
Here is the log:
USB Host started
USB Device Connected
USB Device Reset Completed
PID: ea80h
VID: 10c4h
Address (#1) assigned.
Manufacturer : Silicon Laboratories
Product : CP2110 HID USB-to-UART Bridge
Serial Number : 007B5D47
Enumeration done.
This device has only 1 configuration.
Default configuration set.
ERROR: Cannot Find the interface for HID class.
Device not supporting HID class.
regards,
Achim