2017-05-16 03:51 AM
I'm using STMCubeMX 4.21.0 to generate custom USB HID project. My device needs to send frequent HID reports, therefore it calls USBD_CUSTOM_HID_SendReport every 1-10ms.
This function always returns USBD_OK, even if previous report is not transmitted - in this case it just ignores new report.
It becomes a problem because there is no way for user code to check if data was successfully transmitted or another attempt is required.
I've implemented a local workaround in this function: it returns USBD_BUSY when hhid->state == CUSTOM_HID_BUSY
But this change is not in user modifiable area, therefore this change is lost on every project re-generation in CubeMX.
Am I missing something, is there any other good way to work around this issue?
#cubemx-usb-hid2017-05-17 05:02 AM
Hi
Tyurin.Denis_Mikhail
,Please attach your .ioc file.I shared thisissue internally with our CubeMx team for further check and investigation.
Thanks
Imen
2017-05-17 07:14 AM
Sure, here is the link to ioc file:
https://raw.githubusercontent.com/denis-m-tyurin/IRtoUSB/master/Firmware/IR_TO_USB/IR_TO_USB.ioc
2017-10-25 04:59 AM
This still exists in v4.1, my thought is smae with
HAMMI.Imen
, there need a busy state with return to check whether the data is transmittedsuccessfully.
2018-02-23 09:53 AM
Hello,
Please note this is not an STM32CubeMX issue but a USB device library issue. The fix will be available with the next version of the library, that is delivered as part of the STM32Cube MCU embedded software packages.
Best regards.
2018-02-23 06:18 PM
I did this too for my device project on STM32F072.
-- pa