Skip to main content
Graduate
March 19, 2025
Question

STM32G0B1 USB HID Host

  • March 19, 2025
  • 1 reply
  • 598 views

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

    This topic has been closed for replies.

    1 reply

    ST Employee
    May 20, 2025

    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

    AWackAuthor
    Graduate
    May 21, 2025

    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