Getting notified of the end of a HID Report transmission
Hi everyone,
I'm developing a device based on a STM32WB55 which has a USB interface. Using CubeMX I created a project with a Custom HID device, FreeRTOS + CMSIS v2.
I need to send frames of a proprietary protocol which content usually don't exceed 64 bytes, but sometimes these frames could be up to 255 bytes.
For some reason, I can only send interrupt reports (bulk is not possible), so I made a function that splits the frames into several 64 bytes packets and then send them successively.
On the first try, I did it by blocking the CUSTOM_HID_SendReport() call with a while(USBD_BUSY == CUSTOM_HID_SendReport(...)); It works, but this is not a good way as the microcontroler ressources are blocked until the bus becomes USBD_OK.
I then tried using a semaphore, so that I try to get the semaphore using osSemaporeAcquire() before calling CUSTOM_HID_SendReport().
The problem I'm facing is that I can't find the best place in the USB Stack to release the Semaphore when the report has been sent, to unlock the following packet and so until the entire frame has been sent.
I exposed the complete problem in hope that anybody could help me, even if I'm possibly not using the best/proper way to do it.
Thanks in advance for your help and time !
