Skip to main content
Grzegorz Kania
Associate II
July 13, 2017
Question

Bug in USB HID, keyboard code

  • July 13, 2017
  • 3 replies
  • 951 views
Posted on July 13, 2017 at 11:18

I'd like to report a bug. 

In the file usbh_hid_keybd.c, ver. V3.2.2, date: 07-July-2015

line 333:

Now is:

if(HID_Handle->length > (sizeof(keybd_report_data)/sizeof(uint32_t))){

   HID_Handle->length = (sizeof(keybd_report_data)/sizeof(uint32_t));

}

should be replaced with:

if(HID_Handle->length > sizeof(keybd_report_data)){

   HID_Handle->length = sizeof(keybd_report_data);

}

If I did not make a change, the keyboard reported an error by sending a stall event.

Can anyone confirm this?

#host-usb-hid-keyboard
This topic has been closed for replies.

3 replies

Amel NASRI
ST Technical Moderator
July 17, 2017
Posted on July 17, 2017 at 16:12

Hi

Kania.Grzegorz.002

‌,

Could you please precise the FW package you are using?

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Grzegorz Kania
Associate II
July 18, 2017
Posted on July 18, 2017 at 09:18

Hi Amel

I am using the STM32Cube_FW_F7_V1.3.0 package, but I found this file also in others, eg: STM32Cube_FW_F1_V1.4.0, STM32Cube_FW_F2_V1.6.0

Grzegorz

Igor Pokorny
Visitor II
December 21, 2017
Posted on December 22, 2017 at 00:09

Well, I do have the same experience. A small keyboard I was planning to use (Gembird Mini Usb keyboard) stalled after ennumeration until I didn't change lines according KIania's recomendation. Thanks.  Never the less the mentioned keyboard works in Linux without any problem as well as any other keyboard I tried with ST USB library.  Strange. 

I am using the last version 

STM32Cube_FW_F7_V1.8.0.

 

Igor