player 2(040) has entered the game.
During the past 2 years if you had not noticed, there has been a chip shortage. Namely the atmega 32u4 chips that power the elite-c and pro micros microcontrollers that are at the centers of custom keyboards. It just so happened that during this time raspberry pi developed a microcontroller of their own.
This is known as the rp2040.
rp2040
Why does this matter? Well we can now get the 2040 as a drop in replacement for the pro micros. This is super helpful for the qmk world as they have been busy building the firmware for it. They have also been kind enough to build converters for it.
so how do we build for it?
At the time of the writing of this qmk has not merged this into the main branch, therefore for qmk we will want to checkout the develop
branch and for the sadekbaroudi fork checkout develop_rp2040
$ git checkout develop
or
$ git checkout develop_rp2040
Now we can go through and do the qmk install song and dance as outlined nicely by adafruit https://learn.adafruit.com/using-qmk-on-rp2040-microcontrollers or we can do the easier way and use docker. For docker we are going to hotwire the docker_build.sh script and use my version of that.
# from inside the root of the qmk_firmware folder
curl https://gist.githubusercontent.com/ridingintraffic/a872b990403b07b8b95a90e438dba529/raw/f893d70dfe447fc925a8fff1dbf5de507cc9cc7b/docker_build_hot.sh -o util/docker_build_hot.sh. && chmod +x util/docker_build_hot.sh
# then run it with
./util/docker_build_hot.sh nothing:nothing
This will nicely drop us into the qmk container with all the proper deps installed. Additionally through some volume mounting of that script we will have access to all our local files inside the docker container. This is a two way mount, we will be able to write out files as well. This is important when we move to build the firmware later. Time to get to work. We will need to update the git-sudmodule because we are not on a release branch. This is done with:
I have no name!@83ff02ad93ad:/qmk_firmware$ make git-submodule
....
This will take a few minutes to clone and build everything that we need but its worth it. Once it is complete then we just build the firmware for the keyboard that we want to convert to rp2040 as follows.
$ make crkbd:default CONVERT_TO=kb2040
When it is completed we will be left with a u2f file back in the root of the qmk_firmware folder, this is courtesy of the script and its volume mounts from above. Then set the 2040 into bootloader mode and copy the u2f to its proper home and have fun!