AnsweredAssumed Answered

USB HID Boot profile so that STM32 acts as a "keyboard" for a Nexys 4 DDR

Question asked by sy2002 on Sep 13, 2015
Latest reply on Sep 16, 2015 by Clive One

we are re-creating a computing classic: The Commodore 65. See this link. The heart is a Nexys 4 DDR board.

The Nexys 4 DDR has an USB Host, that only can work with USB HID devices (e.g. keyboard, mouse), that are implementing the "legacy/boot protocol". AFAIK this HID boot mode originally was invented to simplify BIOS development, i.e. using USB keyboards at PCs to control BIOS settings.

I need to use a STM32 to act as a "keyboard" (i.e. USB HID device) for the Nexys 4 DDR board, as we want to use a custom STM32 based PCB to be our "keyboard controller" (connecting an original Commodore 65 keyboard to the GPIOs of the STM32 and translating it to USB scancodes).

Unfortunatelly, the STM32 USB stack does not seem to support the "HID boot protocol" mode (even though the file "usbd_hid_core.c" claims to do so in the comment in line #14).

Wikipedia writes on this topic:

"Keyboards that implement the USB Boot Keyboard profile specified in the USB Device Class Definition for Human Interface Devices (HID) v1.11 and are explicitly configured to use the boot protocol will interrupt the CPU every time the keyboard is polled even if there is no change in state unless the USB controller overrides this behavior, and are limited to 6-key rollover (6KRO). This profile is intended to allow the BIOS to handle a USB keyboard in the absence of a USB-aware operating system."

And the original USB Device Class Definition for HID 1.11 sais on page 74

"The Boot Keyboard shall send data reports when the interrupt in pipe is polled, even when there are no new key events. The Set_Idle request shall override this behavior as described in the HID Class specification."

I am not 100% sure if this (the bold marked sentence above) is the reason, why it does not work, but this is where I am currently standing.

Any help highly appreciated.

(Maybe there are alternative LIBs for the STM32 that I can use to implement a "keyboard" that runs in the HID boot mode? I googled a lot but dit not find anything.)

Best regards