dev: add zmk docker tutorial to readme

This commit is contained in:
phiwan-dev 2025-07-19 22:34:15 +02:00
parent f344124981
commit cdc911bb9c

View file

@ -57,6 +57,35 @@ Lastly, you can replace the point array in [`footprints/phi-caps`](./footprints/
- 2 oled 0.91 inch i2c (optional)
- 2 batteries 3.7v (optional, requres cable otherwise)
# Firmware
## Using ZMK locally using docker
For now, this is the tutorial to get the goosekb to work.
```bash
cd <path-to-goosekb>
docker volume create --driver local -o o=bind -o type=none -o device="<absolute-path-to-goosekb>/config/" zmk-config # enter absolute path
git clone https://github.com/zmkfirmware/zmk.git firmware/zmk
nix shell nixpkgs#devcontainer # or install devcontainer otherwise
devcontainer up --workspace-folder firmware/zmk
docker ps -a # get zmk container name
docker exec -it <zmk-container-name> /bin/bash
# now from within container
cd /workspaces/zmk
west init -l app/
west update
# actually build the firmware
cd app
rm -rf build/
west build -p -d build/left -b seeeduino_xiao_ble -- -DSHIELD=goose_left -DZMK_CONFIG="/workspaces/zmk-config"
west build -p -d build/right -b seeeduino_xiao_ble -- -DSHIELD=goose_right -DZMK_CONFIG="/workspaces/zmk-config"
cp build/left/zephyr/zmk.uf2 build/left.uf2
cp build/right/zephyr/zmk.uf2 build/right.uf2
# connect mcu with pc
# double press the reset button
# the file explorer should now show a usb media
# copy the corresponding .uf2 firmware to the usb media
# it should now auto-eject and run the new firmware
```
# Thanks
- to https://github.com/MvEerd/ergogen/tree/mveerd for ergogen
- to https://flatfootfox.com/ergogen-introduction/ for teaching ergogen