Skip to main content
Luca Giuliodori
Associate III
May 10, 2018
Question

USBH_HID_SetReport issue

  • May 10, 2018
  • 1 reply
  • 1156 views
Posted on May 10, 2018 at 14:30

I'm developing an HID USB Host application. I have already opened a discussion (

https://community.st.com/0D50X00009XkX0ASAV

) about HID USB Host and I applied all the suggested patches in forum, but now I have another problem.

When I try to send data to device (is a HID custom device that work fine if connected to PC) with SBH_HID_SetReport() function, it return 'USBH_BUSY' every time I try to send message.

The problem seems to be inside the USBH_HandleControl() function: the state machine reaches the 'CTRL_DATA_OUT_WAIT' state but, when it call USBH_LL_GetURBState(), return 'USBH_URB_STALL' status and than the USBH_HID_SetReport() function return 'USBH_BUSY'.

This is the code used to send data:

&sharpdefine MAX_USBDATASIZE (64)

.

.

.

static uint8_t USBBufToSend[MAX_USBDATASIZE];

static uint16_t lenUSBBufToSend;

.

.

.

USBH_StatusTypeDef res;

.

.

.

res=USBH_HID_SetReport(&hUsbHostFS,0x02,0x00,USBBufToSend,lenUSBBufToSend);

Why the device state is 'USBH_URB_STALL'? Is it my mistake?

Is possible to resume the correct state?

null

    1 reply

    Tesla DeLorean
    Guru
    August 10, 2018

    Sorry, bumping old zombie unanswered threads off my feed

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Robmar
    Senior II
    August 14, 2024

    Great support lol!!  Can't help, bump it off!  What a totally unprofessional mess ST USB driver is!

    IMHO ST MCU business won't last much longer given all the competition such as Raspberry Pi and ESP industrial boards