QMK seems to be a popular open source keyboard firmware. I've read through their docs a bit, and I think it should mostly support everything that is needed for the lalboard. Namely split keyboards and a robust key mapping mechanism that should be able to support the various mode keys/modes that the lalboard needs.
The only problem is that it doesn't support esp32. I guess I *could* switch to a compatible board/MCU, but a brief search doesn't show anything readily available that is as featureful, available, and cheap as esp32. And there seems to be at least some demand out there for running qmk on an esp32, so I thought I would poke at it bit.
After much gnashing of teeth (and keys), I managed to get a very very hacky proof of concept that compiles and links. This involves
- adding a new esp32 platform to qmk (currently mostly just stubbed out)
- tweaking qmk's build system to build a static library, instead of a full firmware image
- creating a new esp-idf project, that calls into qmk to perform the various processing tasks needed in the main loop. (i.e. something similar to the main loop for the LUFA protocol)
- manually copying that qmk static library to the esp-idf project, and ensuring it gets linked
This is far from an actually functional proof-of-concept, but I think I'm convinced it's at least within the realm of possibility now. I think the next steps will be to more fully implement and integrate the new esp32 functionality in qmk, and ideally figure out some way to link the two builds, to avoid having to build in multiple places and copy stuff around between them.
I doubt something like this would be accepted by the qmk maintainers, since it's essentially using bailing wire and duct tape to smoosh 2 different build systems together. But hopefully it can at least serve as a template for others who want to use qmk on an esp32.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Hey Ben have you had a look at this project yet? https://github.com/Galzai/MK32
Are you sure? yes | no
I'm unfamiliar with esp32, what are the features that you feel are lacking in mcu like STM32F072?
it's natively supported by qmk and is relative cheap. (about $3 in jlcpcb if you use their pcb assembly service: https://jlcpcb.com/parts/componentSearch?isSearch=true&searchTxt=STM32F072CBU6). There're a few open source keyboard designs available using this mcu that should be easy to migrated to your project, like the ferris(https://github.com/pierrechevalier83/ferris/tree/main/0.2)
Are you sure? yes | no
I think I have a build structure that mostly works now. I have an esp-idf project set up, which has my qmk-with-modifications as a git submodule, and using cmake's ExternalProject_add to drive qmk's build, and consuming the static library that it produces -- with the ability to reference code in either direction. e.g. to call qmk's keyboard_task() from the main() function in the esp-idf project, and to call hardware-specific functionality from the new esp32 platform code in my modified version of qmk.
Still lots of stubs that need implementing though :)
Are you sure? yes | no