Just tonight, I wanted to add support for caps word
to my keyboard, but it needed an update to its qmk firmware. “No problem” I thought to myself, I already did this a lot in the past, what could go wrong? Well, everything.
Dependencies, compilers, versions and brew
I had QMK 1.1.1 when I first compiled my arkenswoop firmware, but in the mean time I ran brew install xyz
several times. If you know anything about brew, it is probably that it updates all your packages before installing anything by default. Well, of course, it had to update QMK to 1.1.5_1
and several other components like Python (on my Mac M1, I can’t use Python > 3.11 with vial/qmk due to syntax errors) and a gcc toolchain we’ll talk about later.
I forgot to mention that I was using vial-qmk and not raw qmk, which I installed as follows:
|
|
vial-qmk is a fork of qmk adding support for updating your keymap interactively through a gui, allowing you to save and load keymaps quickly, which I love because it works through your browser too, so I can update my keymap at work, even on a laptop with no admin rights where I can’t install anything.
As far as I know, it is a Python GUI and a collection of scripts to make your firmware and bundle it with your keymap serialized in JSON.
Fixing Python
So I went ahead and tried to fix my Python installation, so that I could run the commands to build my firmware with vial.
No easy way to do this except with an additional command (or risking breaking your system by downgrading the system python), pyenv
. I installed it with brew install pyenv
, and set it up in my ~/.zshrc
:
|
|
But then I discovered when running pyenv versions
that it could list only versions it installed, or the system one! So I had to uninstall nearly all my brew python versions (except for 3.11 and 3.12, because why not keep the most recent ones just in case) installed through brew, and install python 3.8 with pyenv: pyenv install 3.8
. Then make it the default with pyenv local 3.8
in the vial-qmk folder.
Fixing my toolchain…?
Now I could run make arkenswoop:vial:flash
without Python errors blocking the compilation process, but then, avr-gcc screwed up? An error very similar to this one (apart from the keyboard name), down to the compiler version popped up:
|
|
But I had a toolchain (thus a standard library and a assert.h
somewhere, see brew search results:
|
|
And it did seem like a PATH problem at first, so I tried adding all sort of LDFLAGS and PATH modifications, to no avail.
Resorting to Google… page 2
The solution lies on a japanese website which I didn’t translate, I just went through and copied commands (don’t do this! It could have ended really badly) because they showed the same error I had and I somewhat understood the commands and probably what was going on.
I first read this command output, which shows that they had the same arm-none-eabi-gcc version as I have, and the same error:
|
|
The solution
The next message suggested the following commands:
|
|
Which solved my problem, and hopefully solves yours too if you’re here!
Alas, it seems it wasn’t enough for the original poster, I hope they found the solution to their particular problem. Reading the next messages, it seems that it could be related to errors / updates in their matrix definition.
Finally, adding caps word to my firmware
I just wanted to be able to press my “double shift” combo (pressing S
+L
simultaneously, which are my two tap/hold shift keys, triggers caps lock on my keyboard) to trigger caps word and not caps lock, so that I could do caps words, write a sql command eg SELECT
, then press any “non word” character like space
or comma
and exit the caps lock without pressing my combo again. Yes, I’m quite lazy, but one less keypress is like one second saved in my day!
To enable caps word in vial, all I had to do was to add CAPS_WORD_ENABLE = yes
to my root rules.mk
, recompile the firmware, and use the ANY
key with the keycode 0x7c73
(thanks to xyzz for this trick!).