Archive of https://github.com/RaringM/keybow2040-rs — Embedded rust project for the Keybow 2040 (RP2040 based) https://github.com/RaringM/keybow2040-rs
  • Rust 96.1%
  • Linker Script 3.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-09-26 08:46:39 -05:00
.cargo Clarify defmt log level 2025-02-13 10:38:55 -06:00
src Added very rough keyboard mode/organized code a bit 2025-02-23 09:15:23 -06:00
.gitignore base project & working leds 2025-02-12 20:55:05 -06:00
build.rs base project & working leds 2025-02-12 20:55:05 -06:00
Cargo.lock Added very rough keyboard mode/organized code a bit 2025-02-23 09:15:23 -06:00
Cargo.toml Added very rough keyboard mode/organized code a bit 2025-02-23 09:15:23 -06:00
LICENSE better readme & add license 2025-02-13 10:50:44 -06:00
memory.x base project & working leds 2025-02-12 20:55:05 -06:00
README.md fix table on README 2025-09-26 08:46:39 -05:00
rust-toolchain.toml Correct RTT for defmt 2025-02-14 16:00:29 -06:00

keybow2040-rs

A rust firmware implementation for the Keybow 2040 by Pimoroni

The Keybow 2040 is a RP2040 with 2MB W25Q16JVUXIQ flash memory based 4x4 mechanical keyboard.

Dependencies

  1. Add RP2040 target (thumbv6m-none-eabi) target using rustup
  • rustup target add thumbv6m-none-eabi
  1. Install elf2uf2-rs
  • cargo install --locked elf2uf2-rs

Flashing

  1. The Keybow2040 must be placed into the bootloader (?) mode which can through either of the following methods:

    • While the Keybow2040 is connected:

      a. Hold the BOOTSEL button (BOOTSEL is on the right when assembled)

      b. Press the RESET button for 1 second, then release (RESET is on the left when assembled)

      c. Release the BOOTSEL button

    • While the Keybow2040 is disconnected:

      a. Hold the BOOTSEL button

      b. Connect the Keybow2040's USB C connector

  2. If the Keybow2040 entered bootloader mode correctly then it should show up as an external drive labelled "RPI-RP2"

  3. cargo run --release will compile the binary, then run elf2uf2-rs with the -d flag to automatically flash.

Debugging

The Keybow2040 provides pads for TX/RX, as well as SWCLK/SWDIO (SWC, and SWD respectively on Keybow2040).

We can choose to use just the TX/RX pads(UART0, serial comm), the SWCLK/SWDIO pads(SWD, allows programming/debugging), or both.

We can use a Raspberry Pi Pico as a debugger, following the steps provided here

In order to do this, we'd need to utilize the pads given and solder on headers to the pads.

  1. Solder on the headers to the pads (I used a 2-pin header for TX/RX, and a 4-pin header for SWCLK/SWDIO/3+/GND)
  2. Connect the Pico to the Keybow2040 via the headers, using the following connections (in order from top to bottom relative to Keybow2040 with USB-C facing away)
Pico Keybow2040
VSYS 3+
SWDIO SWD
SWCLK SWC
GND GND
RX TX
TX RX

RTT SWD

Flashing and attaching to RTT probe-rs run --chip RP2040 ./target/thumbv6m-none-eabi/release/keybow2040-rs

Connecting to RTT probe-rs attach --chip RP2040 ./target/thumbv6m-none-eabi/release/keybow2040-rs

UART0 TX/RX

  1. Flash the Keybow2040 firmware using cargo run --release while Keybow2040 is in bootloader mode
  2. Connect to the Pico's COM port, using minicom or PuTTY on Windows

Resources