Keyboard firmware for cortex-m, with layer/dynamic keymap/vial support, written in Rust.
-
Update
memory.x
for your microcontroller(if needed) -
Create your
vial.json
by your layout: https://get.vial.today/docs/porting-to-via.html, replace the default one -
Update your default keymap at
src/keymap.rs
-
Update USB interrupt binding at
src/main.rs
(if needed) -
Check the chip name of
probe-rs
is right, if you don't usecargo run
, you can skip this step
{% if chip == "nrf52840_xxAA" -%}
To use NRF BLE, you should have nrf s140 softdevice 7.3.0 flashed to nrf52840 first.
The following are the detailed steps:
- Erase the flash:
probe-rs erase --chip nrf52840_xxAA
- Flash softdevice firmware to flash:
probe-rs download --verify --format hex --chip nRF52840_xxAA s140_nrf52_7.3.0_softdevice.hex
- Compile, flash and run the example
cargo run --release
{% elsif chip == "nrf52832_xxAA" -%}
To use NRF BLE, you should have nrf s132 softdevice 7.3.0 flashed to nrf52832 first.
The following are the detailed steps:
- Erase the flash:
probe-rs erase --chip nrf52832_xxAA
- Flash softdevice firmware to flash:
probe-rs download --verify --format hex --chip nRF52832_xxAA s132_nrf52_7.3.0_softdevice.hex
- Compile, flash and run the example
cargo run --release
{% elsif chip == "esp32c3" -%}
To use ESP BLE, you should have Rust nightly and esp-idf
toolchain installed. The full instruction of installing esp-idf
toolchain can be found here and here
To run the example, make sure that you have esp-idf environment, ldproxy
and espflash
installed correctly. Then, run
cd boards/esp32c3_ble
cargo run --release
If everything is good, you'll see the log as the following:
cargo run --release
Compiling ...
...
...
Finished `release` profile [optimized + debuginfo] target(s) in 51.39s
Running `espflash flash --monitor --log-format defmt target/riscv32imc-esp-espidf/release/rmk-esp32c3`
[2024-04-07T12:49:21Z INFO ] Detected 2 serial ports
[2024-04-07T12:49:21Z INFO ] Ports which match a known common dev board are highlighted
[2024-04-07T12:49:21Z INFO ] Please select a port
[2024-04-07T12:50:24Z INFO ] Serial port: '/dev/cu/xx'
[2024-04-07T12:50:24Z INFO ] Connecting...
[2024-04-07T12:50:24Z INFO ] Using flash stub
Chip type: esp32c3 (revision v0.4)
Crystal frequency: 40 MHz
Flash size: 4MB
Features: WiFi, BLE
MAC address: aa:aa:aa:aa:aa:aa
App/part. size: 607,488/4,128,768 bytes, 14.71%
[2024-04-07T12:50:24Z INFO ] Segment at address '0x0' has not changed, skipping write
[2024-04-07T12:50:24Z INFO ] Segment at address '0x8000' has not changed, skipping write
[00:00:03] [========================================] 337/337 0x10000 [2024-04-07T12:50:28Z INFO ] Flashing has completed!
{% elsif chip == "esp32s3" -%}
To use ESP BLE, you should have Rust for Xtensa target and esp-idf
toolchain installed.
The full instruction of installing esp-idf
toolchain can be found here and here
To run the example, make sure that you have esp-idf environment, ldproxy
and espflash
installed correctly. Then, run
cd boards/esp32s3_ble
cargo run --release
{% endif -%}