cancel
Showing results for 
Search instead for 
Did you mean: 

USB custom HID: unable to send data from controller to PC consecutively

Juan.2422
Associate II

I am using STM32L1 series and configured it as as custom HID device. I am able to receive data from PC and able to respond once using USBD_CUSTOM_HID_SendReport function. If i am trying to send again data to PC using the same function it is not working. It is going to either USB device status as busy or device state suspended.

I have used "09.7_USB HID device - custom device lab" document to configure the project. Please let me know how to figure out the issue.

12 REPLIES 12

@Pavel A.​ My final requirement is to send data to host periodically (data include sensor/GPIO status etc.). I have seen few tutorials which transmit data continuously in the same manner. So is this practically possible with custom HID? Am i missing something?

@Juan.2422 Strictly speaking, it is NOT possible, because you can send anything ONLY when the host allows you. But the HID protocol has special means for this.

You can define a preferred polling interval in the IN interrupt EP descriptor less or equal than your desired sending period. The host will issue IN requests to this endpoint at this frequency, if it can. Bu no other warranties (that the rate will be exactly as you specified, that the rate will be constant...)

@Pavel A.​ Thank you for clarifying. I have tried with different polling interval but didn't help. May be my host is not issuing IN request ( I have used some readymade applications on host, so not sure what is happening inside.)

I will check it and update if i could figure out anything else.