Files
inkclip/firmware
2026-01-12 15:09:34 -06:00
..
2026-01-10 11:20:58 +08:00
2026-01-12 15:09:34 -06:00
2025-04-07 19:57:23 -04:00
2026-01-10 11:20:58 +08:00
2026-01-10 11:47:24 +08:00
2025-04-07 19:57:23 -04:00

Inkclip Firmware

WARNING! Contents below are outdated; we are currently using a USB MIDI-based firmware for better cross-platform compatibility.

This is the firmware implementation for Inkclip. It implements a USB 2.0 HID device with the following reports:

  • Write Pattern: Report ID = 0x01, Direction = Output (host to device), Size = 5,000 bytes.

    Updates the pattern on the e-paper display of the device. The 5,000 bytes are interpreted as a 40,000-bit bit vector that represents a bitmap of the 200x200 pattern to be displayed. Each byte is the little-endian representation of 8 pixels on the display, from left to right, from top to bottom, in row-major order.

    Namely, the kth least significant bit in the nth byte of the report represents the pixel value at coordinates (x, y) = (n % 25 + k, n / 25).

  • Serial Number Request: Report ID = 0x02, Direction = Output (host to device), Size = 1 byte.

    Sends a request for the device's unique serial number. The content of the 1-byte payload is ignored.

  • Serial Number Response: Report ID = 0x02, Direction = Input (device to host), Size = 16 bytes.

    An ASCII representation of the device's unique serial number. Currently, this is implemented as the base-64 encoding of the 12-byte UID of the STM32 MCU.

Flashing the Firmware

If you simply want to flash the firmware onto a completed Inkclip device, you can use the cargo-dfu tool. Simply connect the device via USB with BOOT0 pulled up and then run under this directory

cargo dfu --release

If you want to debug this firmware through e.g. SWD then you can use probe-rs with a debugging probe instead.

Implementation Details

  • The USB device sets the maximum current to 100mA, which should be well above the active power draw of the actual hardware (9mA MCU + 8mA e-paper).
  • The SPI link between the MCU and the e-paper display is 20MHz, which is the maximum supported frequency listed on the display module's datasheet.
  • This firmware is implemented in no_std Rust with the embassy framework and the embassy-stm32 HAL.

License

This firmware implementation for Inkclip, namely all files under this directory, is provided under GNU General Public License v3.0 or later (GPL-3.0-or-later).