Keyboard firmware from scratch

I’m in the process of writing a new keyboard firmware from scratch and I was wondering if folks would be interested in following along?

The project setup is

  • chibios 20.3.x
  • arm-gcc 9.3 and above
  • CMake (no git submodules!)
  • C++17 and C11 everywhere

The firmware will be limited to ARM chips (STM32 family tbh).

I’ve got the basics all setup and am currently working on dynamic keymaps (think: via).
Eventually it’ll support hot-swapping different keyboards without any interruptions. Think combining a full-sized keyboard with a numpad or macropad, or combining different split keyboards. Anything goes.

Below is a picture of a working prototype of a corne + let’s split - it’s acting as one keyboard!

Let me know if you’re interested and I’d start writing some posts about what’s there and what’s coming, and how I’m going about writing a keyboard firmware from scratch.

1 Like

Why chibios over something more popular like freertos or zephyr?

This looks pretty cool, will the downstream keyboard be connected over proper USB so it could also be plugged into a pc and still function?

Great Question - I looked at specifically for RTOSes which claim to have a small footprint.

Out of the 5 I picked chibios because I was most familiar with it.

I hope the page isn’t wrong, but I haven’t implemented in other RTOS to compare the footprint myself.

That’s probably the best reason right there.

1 Like

It depends on which chip you have on the pro-micro replacement PCB I think.
Right now I’m using STM32G031/PCA9675 for prototyping. For those the answer is no. But if you develop a drop in replacement with a chip which actually has USB support the answer would be yes.

The current setup is a 3 component Y-splitter setup, where you only plug the Y splitter into your PC, and the keyboards into the Y-splitter. The firmware runs on the Y-splitter, performing all keyboard actions.
Y-Splitter communication runs on the TX/RX lines of the 3.1 USB-C cable.

So I guess the answer is yes, but I’ve not gone there (yet).

1 Like

That’s actually a really smart way to do that that gets you around needing an MCU with a USB host interface!

1 Like