RMK
Keyboard firmware for cortex-m, with layer/dynamic keymap/vial support, written in Rust.
RMK is under active development, breaking changes may happen. Please check the latest doc or file an issue if you have any problem.
News
RMK just released version 0.1.0, migrate to Embassy! By migrating to Embassy, RMK now has better async support, more supported MCUs and much easier usages than before. For examples using Embassy, check boards folder!
Prerequisites
This crate requires Rust 1.75 and up. openocd(stm32) or probe-rs(stm32/rp2040) is used for flashing & debugging.
Usage
NOTE: RMK You can build your own keyboard firmware using RMK or try built-in firmware example for stm32h7 & rp2040.
Build your own firmware
Example can be found at boards. The following is a simple
step-to-step instruction for creating your own firmware:
- Create a rust embedded project, Add rmk to your project using
cargo add rmk - Choose your target, use
rustup target add <your-target-name>to install the target. Here is the doc for target choosing. For example, rp2040 is Cortex-M0+, so its target isthumbv6m-none-eabi. - Create
.cargo/config.tomlin your project's root, specify your target here. Seeboards/stm32h7/.cargo/config.toml - Create your own keymap file, see:
boards/stm32h7/src/keymap.rs - Generate the vial config of your keymap, folloing vial's porting guide
- Create
main.rs, create yourasync fn main(). Seeboards/stm32h7/src/main.rs
Use built-in example
rp2040
- Install probe-rs
cargo install probe-rs --features cli - Build the firmware
cd boards/rp2040 cargo build - Flash it
cd boards/rp2040 cargo run
stm32h7
-
Install openocd
-
Build the firmware
cd boards/stm32h7 cargo build -
Flash You can use both
probe-rsandopenocdto flash the firmware:# Use openocd openocd -f openocd.cfg -c "program target/thumbv7em-none-eabihf/debug/rmk-stm32h7 preverify verify reset exit" # Use probe-rs cd boards/stm32h7 cargo run -
(Optional) Debug firmware using CMSIS-DAP
Open the project using VSCode, choose
Cortex-Debug - stm32h7debug profile, then pressF5, the firmware will be automatically compiled and flashed. A debug session is started after flashing. Check.vscode/tasks.jsonand.vscode/launch.jsonfor details.
Roadmap
A lot of todos at the list, any contributions are welcomed :)
- support rp2040
- basic keyboard functions
- layer
- system/media keys
- vial support
- eeprom
- keyboard macro
- wireless
- encoder
- RGB
- cli tools
License
RMK is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.