cancel
Showing results for 
Search instead for 
Did you mean: 

USB HID keyboard: Windows & Linux send LED reports twice?

Nickelgrass
Senior

Hello,

I made a simple USB HID keyboard with a STM32F042 in bare metal (no HAL, no LL). Everything works great. Including LEDs and media key support. 

The only strange thing I am observing is that windows and linux are both sending the LED report twice in a row (the second one comes directly after the minimum poll ~10ms later). The first report is always 0x01 and the second one is the actual state of the LEDs. Now I could implement a "filter" but I was wondering if this is normal behavior? Or could I have an issue in my descriptor?

Thanks 

Kind regards

1 ACCEPTED SOLUTION

Accepted Solutions
Nickelgrass
Senior

So it seems this is a normal behaviour if there is more than one interface on the device. The first report is always the ID. Simple workaround is to assign an ID outside/higher than the LEDs (like ID 0x80 for the standard keyboard keys) and only set the LEDs if the report is lower.

View solution in original post

1 REPLY 1
Nickelgrass
Senior

So it seems this is a normal behaviour if there is more than one interface on the device. The first report is always the ID. Simple workaround is to assign an ID outside/higher than the LEDs (like ID 0x80 for the standard keyboard keys) and only set the LEDs if the report is lower.