AnsweredAssumed Answered

STM32F4 USB HID: transmit interrupt

Question asked by Mig on Sep 16, 2014
Latest reply on Sep 23, 2014 by Mig

The STM USB HID stack generates an interrupt when new data have been received (eg 64 bytes). It is necessary to poll the status (using the USBD_HID_RecReport function), but this is no problem in my application.

If I want to transmit data from the MCU to the PC, which exceeds the max. 64 bytes buffer, I need to start several transmits (using the USBD_HID_SendReport function), of course.

As HID max transfer rate is 1ms and I did not yet found any flag, which tells me that the last package has been transferred successful to the PC (ACK), I need to slow down the transmit rate much slower than the 1ms.

As the package size can be up to 64kB I need to do 1000 tranmits wich takes a while. Up to 2 seconds would be acceptable, but I need >10 seconds with my procedure.

If I do not wait long enough the receive process on the PC will stop after several 10 packages.