2022-05-21 06:16 AM
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.
2022-05-24 07:27 PM
@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?
2022-05-25 10:01 AM
@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...)
2022-05-25 08:47 PM
@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.