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