USB Keyboard support in U-Boot
Published on May 30, 2013
Serial ports have been around for over 40 years and many of us embedded folks don't leave home without them.
In recent years, they've been harder to come by though. They're no longer standard on PCs, and laptops generally need a USB to serial adapter.
We're also shipping devices in enclosures without serial port connectors, so changing a U-Boot setting through the serial port requires disassembly.
To address this, we recently enabled USB Keyboard support to our U-Boot configuration files and added some commands to our default boot script that enable it if boot fails
The links above show the details:
- The CONFIG_USB_KEYBOARD and CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP macros must be set in the board.h file.
- The usb start command starts the USB subsystem, and
- You can tell U-Boot to read keys by adding usbkbd to the stdin environment variable.
U-Boot > setenv stdin serial