Keyboard Builders' Digest
Beautiful accessories at Kinetic Labs!
Keyboard Builders' Digest /

ZMK: A History

Pete Johanson sums up the early days of ZMK, everyone's favorite wireless first firmware, and looks into the future.

Pete Johanson
Published December 15, 2023
This post is part of the KBD.NEWS Advent Calendar 2023. The previous article was: CLP – How I found my keycaps by vvhg. Stay tuned and check back for more articles tomorrow!

As I stare at a message on our Discord server announcing that our GitHub repo passed 2k stars, I'm inspired to look back and see what all we've managed to accomplish with ZMK since our humble beginnings a few short years ago.

A Personal Itch

To quote (the questionable at best) ESR:

Every good work of software starts by scratching a developer's personal itch.

January 2020: After having killed my fourth Microsoft Ergonomic Keyboard through sustained use, I decided to finally seek out a better and more sustainable alternative. After lots of hemming and hawing, I settled on an Iris Rev. 4 keyboard. After acquiring all the parts and completing a build, I was smitten. The power of QMK, combined with the amazing typing experience and "I can fix it if it breaks!" was too much to ever go back again.

At the time, as a full time remote developer, I worked 1-2 days a week from local coffee shops to get some sunlight, air, etc. Enter the problem: Setting up a split on a cafe table, with TRRS & USB cables, finding room for my drink where it won't get knocked over, etc. was a pain. There must be something better!

An Idea

As I started researching for options, the prospect of trying to modify any of the existing firmwares to do what I wanted seemed insurmountable. The mature options where so far advanced and committed to their underlying architectures that trying to bend them to something so different seemed a fool's errand.

In order to better understand what I was up against, I did what all good engineers do. Prototype!

Prototyping

April 2020: After reviewing the hardware options being discussed, I snagged a STM32WB55 Nucleo dev kit and started learning and playing.

Pic: STM32WB55 Nucleo Pack

STM32WB55 Nucleo Pack

First order of business was settling on a base on which to build things. Knowing that a solid Bluetooth stack was a requirement from day one helped narrow the field very quickly. When I discovered the Zephyr Project it immediately seemed like a fit. But… it wasn't exactly a smooth start. The first ZMK commit:


commit 85c8be89dea8f7a00e8efb06d38e2b32f3459935
Author: Pete Johanson 
Date:   Tue Apr 21 16:20:34 2020 -0400
    Initial work.
 .gitignore     |  1 +
 .gitmodules    |  3 +++
 CMakeLists.txt | 40 ++++++++++++++++++++++++++++++++++++++++
 src/main.c     | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/zmk_lib.h  |  7 +++++++
 zephyr-rust    |  1 +
 6 files changed, 112 insertions(+)

But.. it was a start. A few months later, and my basic handwire prototype with a devkit and some tactile buttons on a breadboard worked as a BLE keyboard!

Pic: First Prototype Keyboard

First Prototype Keyboard

June 2020: I managed to snag a Proton-C along with a macropad as a next step to validate things… And that worked too?!

Pic: Proton-C Macropad

Proton-C Macropad

This thing had legs. Could it actually work? What about a split keyboard, like my beloved Iris? I would need an actual keyboard to know for sure.

Fortuitous Timing

May 2020: Unbeknownst to me… Someone else had been yearning for wireless keyboards too, and had approached it from the other angle, which was making hardware for such things more available. Nick announced an IC for the nice!nano a month after my first commit.

An interested early user who had found my initial prototype work, innovaker connected me with Nick, who had been using an unsupported QMK fork and the Arduino based BlueMicro but was interested in other options.

July 2020: Nick took a chance on me (for which I am still so very grateful) and sent me two of the pre-production samples to develop on.

Pic: First Nano

First Nano

I quickly started learning more about the nRF52840 present on the nice!nano, and getting ZMK running on it. Getting my existing work-in-progress running on the nice!nano was.. Almost too easy? It was at this point that I knew the choice of Zephyr RTOS as the base was going to pay off dividends. Zephyr is designed from the ground up with hardware agnosticism in mind, which means supporting this new target, and others in the future, would be possible without major rework to do so!

Splits? Keymaps?

With nice!nanos in hand, a mostly working basic codebase for "I'm a keyboard!", one immediate issues appeared… Making a split keyboard work!

July 2020: Doing so required learning far more about BLE, custom GATT services, and the Zephyr BT stack. But by the end of it, a split PR was born, as was a working split Kyria.

Pic: Kyria with ZMK

Kyria with ZMK

Early on, I knew that for ZMK, we needed to have a keymap system that allowed for the same power and flexibility that QMK offered. I loved my Iris still, which I was still typing on daily, until ZMK could actually be usable for more complex interactions.

With the other infrastructure in place, I turned my attention to keymaps, and how they work. Brainstorming with several early adopters, we settled on the leaning on the Zephyr devicetree for encoding/writing keymaps, and the concept of a behavior was born.

In particular, early on we decided to focus on a declarative syntax for keymaps, not code. With the advantage of knowing that some day, in some distant future, we would want to support a GUI runtime keymap editor, we focused on composition, combining reusable building blocks of functionality, to enable complex results. The vision was to start early with that assumption, so that future approaches to changing that composition would not be dependant on an approach that assumed recompiling code.

Still, the support was basic, with only a super basic mod-tap implementation to prove the theory.

A Wild Okke Appears

September 2020: As luck would have it, another early adopter also had a personal itch to scratch. Okke took it upon themselves to take the basic behavior concept, and the unit test infrastructure I had added, and graced us with a Hold Tap PR.

This PR was the real validation that our keymap approach could work, would allow complex functionality to be built upon it, and added a feature that is so pivotal to using smaller keyboards well.

Not content to stop there, he also then added:

The focus on adding there amazing features freed up my time to focus on countless other low level items, BLE improvements, encoders, basic display support, build infrastructure, etc. Simultaneously, we had other folks adding things like:

Here Come The Users

November 2020: At this point, the initial nice!nano group buy delivered. Talk about an influx of new users. That had the welcome side effect of identifying all the areas we were woefully lacking in functionality, and gave us focus to work on things like:

Pic: Display POC

Display POC

New amazing projects like the Keymap Editor and Miryoku ZMK started to spring up, as folks embraced the project and started adding to it in ways I hadn't previously imagined possible.

Steady Growth

Jan 2021: The following year was marked by steady growth, and incremental improvements. We slowly chipped away at the little things, stability, enhancements to hold taps, sticky keys, debouncing, etc. The documentation website was refined further and further.

Vendors Notice

September 2021: As features and stability work continued, we slowly started seeing vendors, not just hobbyists, take interest in using ZMK. Another wave of new ZMK users appeared as first the LowProKB Corne-ish Zen, and later the Kinesis Advantage 360 Pro and MoErgo Glove80 started shipping.

MORE FEATURES!

Work continued at a steady pace, with more users, more minor features, etc. At this point, our feature set was robust enough to handle a large variety of users needs, from micro combo/layer heavy users to 75% traditional layouts with RGB.

At this point, my focus slowly transitioned to constant refinement mode.

Refinement

Jan 2023: A lot of the focus is about building on the existing core, and taking all the feedback about current pain points and trying to address those needs. That includes a variety of pending or planned work such as:

By The Numbers

Metrics around our usage are usually inferred. We don't actively track numbers of builds, installs, etc. of anything ZMK related. But some numbers that are interesting to have a sense of ZMK's growth:

Looking Forward

We've come a long way since a humble start on a Nucleo kit and breadboard. Our keymaps and compositional approach have enabled some powerful features for users without requiring they right a single line of code. Our laser focus on low power design in everything we do means that we've untethered users from constant changing and poor battery life.

And yet, our firmware is still far too difficult to use for many users. Our bluetooth handling is dogmatic, which leads to regular confusion about how to pair multiple devices to your keyboard, and our reliance on GitHub for building and flashing keymap changes is challenging at best. Our keymap syntax, and the errors produced when there are problems, is a constant source of user frustration. There is so much more to do; with many efforts underway already to address these pain points.

In addition, oft requested features like mouse keys, true pointer hardware support, runtime keymap support, etc. are all widely anticipated.

I love working on ZMK. Getting to see all the amazing keyboards posted to our show-and-tell channel, seeing new PRs come in with new features, watching all the amazing folks in our help channels assisting new users is incredibly rewarding.

A Final, Humble Request

If you are excited by ZMK of today and tomorrow, please consider donating/sponsoring:

Written on a Le Chiffre STM32 by Sporkus, running ZMK (of course), with lubed Akko CS Lavender Purple switches with MT3 Operator keycaps.

Pete Johanson (41)

petejohanson
LocationSouthern Oregon (for now)
DescriptionFirmware developer and keyboard designer
OccupationEmbedded engineer, designer
Joined2020
NicheWireless, low profile, 34-keys, unibody splits
Fav. switchChocs (Sunsets and 30g whites)
Fav. profileChicago Steno, LDSA, MBK
LayoutColemak DH
Other hobbiesdisc golf
Linkspetejohanson.dev, GitHub, @[email protected]
Do you like this post? Share, donate, subscribe, tip me off!

Published on Fri 15th Dec 2023. Featured in KBD #2023.


Related

1984 keyboard

A 36-key ortholinear split keyboard called 1984, created by Dilshod Temirkhodjaev.

CB34S

CB34S is a 34-key columnar staggered Choc V1 monoblock split keyboard by Bubbleology – with Nice!Nano and Nice!View.

MonoSeb40

A wireless monoblock split by seblov: the 40-key MonoSeb40.

NostrumX

A 32-key ergo split keyboard using Seeed Xiao BLE: NostrumX by Bennytrouser.

Wireless 2.4Ghz receiver for Bluetooth modules

Turns any nRF Bluetooth keyboard (nice!nano etc.) into a non-Bluetooth QMK keyboard.

Allium58 by Beekeeb

Beekeeb's Leo announced Allium58, a low-pro split based on the Lily58 Pro.

×
top