cancel
Showing results for 
Search instead for 
Did you mean: 

USBH_HID_SetReport issue

Luca Giuliodori
Associate III
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 1

Sorry, bumping old zombie unanswered threads off my feed

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..