🛠 Create a Custom HID Device with Romu

Bitmerse Romu Compact USB Development Board (RP2354A) · intermediaire · Transformez la carte Romu en un périphérique d'entrée USB dédié pour automatiser des tâches complexes.

Objectives

This tutorial aims to configure the Romu board to behave as a custom Human Interface Device (HID), such as a macro pad or MIDI controller. Unlike classic boards requiring cables, the Romu plugs directly into a USB Type-A port. The goal is to understand the RP2354A's hybrid architecture and exploit its security features to create passwordless authentication keys or productivity tools.

Required Material

Steps

Install the official SDK for the RP2354A. Ensure the Arm Cortex-M33 compiler is correctly configured, as the main core handles the USB stack.

  1. Environment Setup
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
make

Create a new project folder. Since the Romu lacks easily accessible external GPIOs, you will use the integrated buttons and RGB LED. Configure the USB descriptor to declare a generic HID device.

  1. HID Project Preparation
// Simplified HID descriptor structure example
const uint8_t hid_report_descriptor[] = {
    0x05, 0x01, // Usage Page (Generic Desktop)
    0x09, 0x06, // Usage (Keyboard)
    0xA1, 0x01, // Collection (Application)
    // ... key definitions ...
    0xC0
};

Write code that reads the state of the physical buttons on the board. On press, send a specific HID frame (e.g., a key combination for a shortcut).

  1. Input Logic Implementation
void send_hid_report(uint8_t keycode) {
    uint8_t report[8] = {0};
    report[2] = keycode;
    tud_hid_report(0, report, sizeof(report));
}

Compile the firmware. Since there is no standard USB-C connector for BOOTSEL mode flashing, you will likely need to use the debug pads to connect a USB-Serial adapter or use an SWD flashing tool, depending on the final board configuration.

  1. Compilation and Flashing
cmake ..
make

Verification

Once the firmware is loaded, insert the Romu board directly into a USB Type-A port on your computer. The operating system should detect a new HID device. Open a text editor or USB diagnostic tool to confirm that pressing the Romu buttons triggers the programmed actions (e.g., sending a letter or macro). The RGB LED should light up to indicate activity.

Going Further

Explore the RP2354A's Arm Trustzone and Secure Boot security features. You can design a security key that requires cryptographic authentication before sending HID commands, turning the Romu into a robust passwordless authentication token for sensitive environments.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials