cancel
Showing results for 
Search instead for 
Did you mean: 

Missing ''busy'' state handling in custom USB HID code generated by MX

denis2
Associate II
Posted on May 16, 2017 at 12:51

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-hid
5 REPLIES 5
Imen.D
ST Employee
Posted on May 17, 2017 at 14:02

Hi

Tyurin.Denis_Mikhail

,

Please attach your .ioc file.I shared thisissue internally with our CubeMx team for further check and investigation.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Posted on May 17, 2017 at 14:14

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

Zheng Liang
Associate III
Posted on October 25, 2017 at 13:59

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 transmitted

successfully.

0690X00000608i6QAA.png

stm32cube-t
Senior III
Posted on February 23, 2018 at 18:53

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.

Posted on February 24, 2018 at 02:18

I did this too for my device project on STM32F072.

-- pa