Page 1 of 1

USB Keyboard - setting LED's not working

Posted: Wed Oct 14, 2015 12:07 pm
by alwaysnub
I am working on a USB keyboard device driver/code for my OS.
Currently trying to get the numlock and capslock LED's to light up using the boot-protocol SetReport(Out), but even though the usb transfer is completed successfully, the LED's dont light up.
If i wait too long after initializing the device (i,e 1-4 seconds) before trying to set the LED's, then the usb transfer reports a CRC Time Out error. This makes me think im not completely initializing the device.

I do the following before trying to set the LED's:
USB_SetConfiguration
HID_SetProtocol (0) Boot-Protocol
HID_GetReportDescriptor

Am i missing a step? I could not find anything else in the HID specifications.

Re: USB Keyboard - setting LED's not working

Posted: Thu Nov 26, 2015 10:51 am
by alwaysnub
I have solved this problem.

This is actually related to the uhci and not the HID specifically.
The reason the LED's never light up and a time-out error is generated after a period of time is because after each uhci transaction i was stopping the scheduler/controller -
(Setting bit-0 to 0 in the CMD register)

You MUST leave the controller running!