Skip to content

Commit a62b14e

Browse files
committed
Add OP36 Qube RMK upstream firmware
1 parent cc2bf45 commit a62b14e

300 files changed

Lines changed: 66813 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,105 @@ jobs:
165165
path: keyboards/${{ matrix.keyboard }}/${{ matrix.output_name }}.uf2
166166
retention-days: 30
167167

168+
build-op36-qube:
169+
name: Build OP36 Qube firmware
170+
runs-on: ubuntu-latest
171+
172+
steps:
173+
- name: Checkout
174+
uses: actions/checkout@v4
175+
176+
- name: Install ARM toolchain
177+
run: |
178+
sudo apt-get update -qq
179+
sudo apt-get install -y --no-install-recommends gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi clang libclang-dev
180+
181+
- name: Install Rust
182+
uses: dtolnay/rust-toolchain@stable
183+
with:
184+
targets: thumbv7em-none-eabihf
185+
186+
- name: Cache cargo registry
187+
uses: actions/cache@v4
188+
with:
189+
path: |
190+
~/.cargo/registry
191+
~/.cargo/git
192+
key: ${{ runner.os }}-cargo-op36-qube-${{ hashFiles('keyboards/op36_qube/Cargo.lock') }}
193+
restore-keys: |
194+
${{ runner.os }}-cargo-op36-qube-
195+
${{ runner.os }}-cargo-
196+
197+
- name: Install flip-link
198+
run: cargo install flip-link --locked
199+
200+
- name: Download uf2conv script
201+
run: |
202+
for i in 1 2 3 4 5; do
203+
curl -fL --retry 3 --retry-delay 5 \
204+
https://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2conv.py \
205+
-o uf2conv.py && break || sleep 10
206+
done
207+
for i in 1 2 3; do
208+
curl -fL --retry 3 --retry-delay 5 \
209+
https://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2families.json \
210+
-o uf2families.json && break || sleep 10
211+
done
212+
python3 -c "import ast; ast.parse(open('uf2conv.py').read())" || { echo "uf2conv.py invalid"; exit 1; }
213+
chmod +x uf2conv.py
214+
215+
- name: Build Qube dongle
216+
working-directory: keyboards/op36_qube
217+
env:
218+
BINDGEN_EXTRA_CLANG_ARGS: "--sysroot=/usr/lib/arm-none-eabi --target=arm-none-eabi -I/usr/lib/arm-none-eabi/include -I/usr/lib/gcc/arm-none-eabi/13.2.1/include"
219+
RUST_MIN_STACK: "16777216"
220+
run: cargo build --release --bin qube --features qube
221+
222+
- name: Build left half
223+
working-directory: keyboards/op36_qube
224+
env:
225+
BINDGEN_EXTRA_CLANG_ARGS: "--sysroot=/usr/lib/arm-none-eabi --target=arm-none-eabi -I/usr/lib/arm-none-eabi/include -I/usr/lib/gcc/arm-none-eabi/13.2.1/include"
226+
RUST_MIN_STACK: "16777216"
227+
run: cargo build --release --bin left
228+
229+
- name: Build right half
230+
working-directory: keyboards/op36_qube
231+
env:
232+
BINDGEN_EXTRA_CLANG_ARGS: "--sysroot=/usr/lib/arm-none-eabi --target=arm-none-eabi -I/usr/lib/arm-none-eabi/include -I/usr/lib/gcc/arm-none-eabi/13.2.1/include"
233+
RUST_MIN_STACK: "16777216"
234+
run: cargo build --release --bin right
235+
236+
- name: Convert to UF2
237+
working-directory: keyboards/op36_qube
238+
run: |
239+
arm-none-eabi-objcopy -O binary \
240+
target/thumbv7em-none-eabihf/release/qube qube.bin
241+
python3 ../../uf2conv.py qube.bin \
242+
--base 0x26000 --family 0xADA52840 \
243+
--output op36_qube_dongle.uf2
244+
245+
arm-none-eabi-objcopy -O binary \
246+
target/thumbv7em-none-eabihf/release/left left.bin
247+
python3 ../../uf2conv.py left.bin \
248+
--base 0x26000 --family 0xADA52840 \
249+
--output op36_qube_left.uf2
250+
251+
arm-none-eabi-objcopy -O binary \
252+
target/thumbv7em-none-eabihf/release/right right.bin
253+
python3 ../../uf2conv.py right.bin \
254+
--base 0x26000 --family 0xADA52840 \
255+
--output op36_qube_right.uf2
256+
257+
- name: Upload firmware
258+
uses: actions/upload-artifact@v4
259+
with:
260+
name: op36_qube
261+
path: |
262+
keyboards/op36_qube/op36_qube_dongle.uf2
263+
keyboards/op36_qube/op36_qube_left.uf2
264+
keyboards/op36_qube/op36_qube_right.uf2
265+
retention-days: 30
266+
168267
build-settings-reset:
169268
name: Build settings_reset firmware
170269
runs-on: ubuntu-latest

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ RMK BLE split firmware for Ergohaven keyboards and trackballs (nRF52840).
1313
| K:04 Micro | 3×5 + 3 thumb | 1+1 ||
1414
| Imperial44 | 4×6 + 3 thumb | 1+1 ||
1515
| OP36 | 3×5 + 3 thumb |||
16+
| OP36 Qube | 3×5 + 3 thumb || Qube dongle + ST7789 |
1617
| Velvet | 4×6 + 5 thumb |||
1718
| Velvet UI | 4×6 + 5 thumb || PMW3610 |
1819

@@ -55,3 +56,8 @@ Every push builds all devices in parallel via GitHub Actions. UF2 artifacts avai
5556
## RMK Version
5657

5758
Based on [RMK](https://github.com/HaoboGu/rmk) 0.8.2 with nRF52840 BLE support.
59+
60+
`keyboards/op36_qube` is isolated on `common/rmk-main-upstream`, vendored from
61+
official RMK upstream `https://github.com/HaoboGu/rmk` main at commit
62+
`baaab8b7d839e8938e016892965891f1bde45efe`, so current 0.8.2 firmwares are
63+
not mixed with the Qube runtime.

common/rmk-main-upstream/README.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
<!-- PROJECT LOGO -->
2+
<br />
3+
<p align="center">
4+
<a href="https://github.com/haobogu/rmk">
5+
<img src="https://github.com/HaoboGu/rmk/blob/dad1f922f471127f5449262c4cb4a922e351bf43/docs/images/rmk_logo.svg?raw=true" alt="Logo" width="150">
6+
</a>
7+
8+
<p align="center">
9+
A feature-rich keyboard firmware written in Rust.
10+
<br />
11+
<br />
12+
<a href="https://crates.io/crates/rmk"><img src="https://img.shields.io/crates/v/rmk"></a>
13+
<a href="https://docs.rs/rmk/latest/rmk/"><img src="https://img.shields.io/docsrs/rmk"></a>
14+
<a href="https://github.com/HaoboGu/rmk/actions"><img src="https://github.com/haobogu/rmk/actions/workflows/build.yml/badge.svg"></a>
15+
<a href="https://discord.gg/HHGA7pQxkG"><img src="https://img.shields.io/discord/1166665039793639424?label=discord"></a>
16+
</p>
17+
</p>
18+
19+
👉 Join our [Discord server](https://discord.gg/HHGA7pQxkG) for discussions, support, and community collaboration!
20+
21+
-----
22+
[中文](https://github.com/HaoboGu/rmk/blob/main/README_zh.md)
23+
24+
25+
## Features
26+
27+
- **Broad microcontroller compatibility**: Leveraging [embassy](https://github.com/embassy-rs/embassy), RMK supports a comprehensive range of microcontrollers, including stm32, nRF, rp2040(w), esp32, etc
28+
- **Dynamic keymap customization**: RMK offers native [Vial](https://get.vial.today) support, enabling real-time keymap modifications. You can even edit keymaps over BLE connections wirelessly
29+
- **Advanced keyboard functionality**: RMK comes with lots of advanced keyboard features by default, including layer switching, media controls, system commands, mouse control, and more
30+
- **Wireless connectivity**: BLE wireless support with automatic reconnection and multi-device capabilities for nRF52 and esp32 microcontrollers, tested on nRF52840, esp32c3, esp32s3, Pi Pico W
31+
- **Easy configuration**: RMK simplifies keyboard development through a single `keyboard.toml` configuration file. For Rust enthusiasts, the firmware remains highly customizable using Rust code
32+
- **Optimized performance**: RMK achieves approximately 2ms latency in wired mode and 10ms in wireless mode. With the `async_matrix` feature enabled, power consumption is significantly reduced—a 2000mAh battery can power your keyboard for several months
33+
34+
## [User Documentation](https://rmk.rs/docs/user_guide/guide_overview) | [API Reference](https://docs.rs/rmk/latest/rmk/) | [FAQs](https://rmk.rs/docs/getting_started/faq) | [Changelog](https://github.com/HaoboGu/rmk/blob/main/rmk/CHANGELOG.md)
35+
36+
## Real-World Implementations
37+
38+
### [rmk-ble-keyboard](https://github.com/HaoboGu/rmk-ble-keyboard)
39+
40+
<img src="https://raw.githubusercontent.com/HaoboGu/rmk/refs/heads/main/docs/docs/main/images/rmk_ble_keyboard.jpg" width="60%">
41+
42+
### [dactyl-lynx-rmk](https://github.com/whitelynx/dactyl-lynx-rmk)
43+
44+
<img src="https://raw.githubusercontent.com/whitelynx/dactyl-lynx-keyboard/refs/heads/main/resources/skeleton-prototype.jpg" width="60%">
45+
46+
### [sessile](https://github.com/willpuckett/sessile)
47+
48+
<img src="https://raw.githubusercontent.com/HaoboGu/rmk/refs/heads/main/docs/docs/main/images/sessile.png" width="60%">
49+
50+
### [Urchin](https://github.com/TimoBbz/urchin-rmk-firmware)
51+
52+
<img src="https://raw.githubusercontent.com/HaoboGu/rmk/refs/heads/main/docs/docs/main/images/urchin.png" width="60%">
53+
54+
### [zx66](https://github.com/zongxin1993/zx66-keybord)
55+
56+
<img src="https://raw.githubusercontent.com/zongxin1993/zx66-keybord/refs/heads/master/Images/zx66-keybord_03.jpg" width="60%">
57+
58+
### [rmk-zsa-voyager](https://github.com/jpds/rmk-zsa-voyager)
59+
60+
<img src="https://raw.githubusercontent.com/HaoboGu/rmk/refs/heads/main/docs/docs/main/images/zsa-voyager.webp" width="60%">
61+
62+
## Getting Started
63+
64+
### Option 1: Start with a Template
65+
66+
Quickly bootstrap your project using [rmkit](https://github.com/HaoboGu/rmkit) and the official RMK [project template](https://github.com/HaoboGu/rmk-template).
67+
68+
```shell
69+
cargo install rmkit flip-link
70+
# If you encounter installation issues on Windows, try this alternative command:
71+
# powershell -ExecutionPolicy ByPass -c "irm https://github.com/haobogu/rmkit/releases/download/v0.0.20/rmkit-installer.ps1 | iex"
72+
rmkit init
73+
```
74+
75+
For comprehensive guidance, refer to the [User Guide](https://rmk.rs/docs/user_guide/guide_overview).
76+
77+
### Option 2: Explore Built-in Examples
78+
79+
Browse the examples in the [`examples`](https://github.com/HaoboGu/rmk/tree/main/examples) directory. Below are step-by-step instructions for rp2040 development. The process is similar for other microcontrollers when using a debug probe.
80+
81+
#### rp2040 Setup
82+
83+
1. Install [probe-rs](https://github.com/probe-rs/probe-rs)
84+
85+
```shell
86+
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/probe-rs/probe-rs/releases/latest/download/probe-rs-tools-installer.sh | sh
87+
```
88+
89+
2. Build the firmware
90+
91+
```shell
92+
cd examples/use_rust/rp2040
93+
cargo build --release
94+
```
95+
96+
3. Flash using a debug probe
97+
98+
With a debug probe connected to your rp2040 board, simply run:
99+
100+
```shell
101+
cd examples/use_rust/rp2040
102+
cargo run --release
103+
```
104+
105+
4. (Optional) Flash via USB
106+
107+
Without a debug probe, you can use `elf2uf2-rs` to flash via USB:
108+
109+
1. Install the tool: `cargo install elf2uf2-rs`
110+
2. Modify `examples/use_rust/rp2040/.cargo/config.toml` to use `elf2uf2`:
111+
```diff
112+
- runner = "probe-rs run --chip RP2040"
113+
+ runner = "elf2uf2-rs -d"
114+
```
115+
3. Connect your rp2040 board while holding the BOOTSEL button until the USB drive appears
116+
4. Flash the firmware:
117+
```shell
118+
cd examples/use_rust/rp2040
119+
cargo run --release
120+
```
121+
Upon successful completion, you'll see output similar to:
122+
```shell
123+
Finished release [optimized + debuginfo] target(s) in 0.21s
124+
Running `elf2uf2-rs -d 'target\thumbv6m-none-eabi\release\rmk-rp2040'`
125+
Found pico uf2 disk G:\
126+
Transfering program to pico
127+
173.00 KB / 173.00 KB [=======================] 100.00 % 193.64 KB/s
128+
```
129+
130+
## [Development Roadmap](https://rmk.rs/docs/development/roadmap)
131+
132+
Current roadmap of RMK can be found [here](https://rmk.rs/docs/development/roadmap).
133+
134+
## Minimum Supported Rust Version (MSRV)
135+
136+
RMK is developed against the latest stable Rust release. While other versions may work, they are not fully tested.
137+
138+
## License
139+
140+
RMK is licensed under either of
141+
142+
- Apache License, Version 2.0 (LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
143+
- MIT license (LICENSE-MIT or <http://opensource.org/licenses/MIT>)
144+
145+
at your option.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# RMK Main Upstream
2+
3+
This vendor root is reserved for Qube-capable firmware targets that need RMK
4+
mainline display and split events.
5+
6+
- Upstream: https://github.com/HaoboGu/rmk
7+
- Branch: main
8+
- Commit: baaab8b7d839e8938e016892965891f1bde45efe
9+
- Imported crates: `rmk`, `rmk-config`, `rmk-macro`, `rmk-types`
10+
11+
The existing `common/rmk-0.8.2-*` trees are intentionally left untouched.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "rmk-config"
3+
version = "0.6.1"
4+
edition = "2024"
5+
authors = ["Haobo Gu <haobogu@outlook.com>"]
6+
description = "Config crate of RMK"
7+
homepage = "https://github.com/haobogu/rmk"
8+
repository = "https://github.com/haobogu/rmk"
9+
license = "MIT OR Apache-2.0"
10+
resolver = "2"
11+
12+
[dependencies]
13+
config = "0.15"
14+
toml = "1"
15+
serde = { version = "1", features = ["derive"] }
16+
serde-inline-default = "1"
17+
once_cell = "1.19"
18+
pest = "2.8"
19+
pest_derive = "2.8"
20+
paste = "1.0.15"

0 commit comments

Comments
 (0)