Skip to content

Repository files navigation

SMK

SMK - Small (device) Mechanical Keyboard Firmware

Build

This is a keyboard firmware targeting SinoWealth 8051-based devices.

The S (Small) in SMK comes from this firmware using SDCC to build itself.

⚠️ WARNING ⚠️

This firmware is still highly experimental, so be cautious when trying to use it or extend it.

You can very easily end up with a bricked device if the written firmware can't jump back into ISP mode, so before testing or modifying it, it's best to have a full dump of your stock firmware and a programming tool (like an Arduino Nano + sinodude-serial or SinoWealth SinoLink + ProWriter) that can write it back.

Supported Devices

Keyboard MCU ISP USB Wireless Extra Details
NuPhy Air60 v1 SH68F90A / BYK916 2.4G Details
E-YOOSO Z11 SH68F90A / BYK901 N/A Details
Genesis Thor 300 SH68F881 / BYK801 N/A Details
CIY X77 SH68F89 / BYK816 N/A External 24Cxx EEPROM Details

Platform notes: SH68F90 / SH68F90A, SH68F881, SH68F89.

Developing

Prerequisites

Nix

Currently, this project is primarily developed with the help of Nix and Nix flakes. Please consider using Nix and the provided flake to automatically set up a reproducible development environment.

With Nix installed and flakes enabled, use nix develop or direnv to enter a shell with all prerequisites installed.

Building & Flashing

Once all prerequisites are set up, you can build and flash firmware for a specific combination of keyboard and layout using the following commands:

meson setup build # configure meson build dir
meson compile -C build nuphy-air60_default_smk.hex # build firmware for nuphy-air60 with the default layout
meson compile -C build nuphy-air60_default_flash # write firmware to the device via sinowisp

Debug Console

Debug builds ship their log output as HID reports. smk-console (tools/smk-console) prints them, and runs on Linux, macOS and Windows:

cargo run --release --manifest-path tools/smk-console/Cargo.toml               # defaults to 05ac:024f (nuphy-air60)
cargo run --release --manifest-path tools/smk-console/Cargo.toml -- 258a:002a  # eyooso-z11
cargo run --release --manifest-path tools/smk-console/Cargo.toml -- 258a:001f  # genesis-thor-300
cargo run --release --manifest-path tools/smk-console/Cargo.toml -- 258a:0016  # ciy-x77

It picks devices up and drops them as they are plugged and unplugged, so it can be left running across a reflash. On Linux the /dev/hidraw* node needs a udev rule, or sudo.

Acknowledgements

About

A keyboard firmware for sinowealth-8051-based devices

Topics

Resources

Stars

136 stars

Watchers

8 watching

Forks

Releases

Used by

Contributors

Languages