From 9dde7dea7e806aa47143416e107c002565a71f32 Mon Sep 17 00:00:00 2001 From: phiwan-dev <75113544+phiwan-dev@users.noreply.github.com> Date: Sun, 20 Jul 2025 16:38:40 +0200 Subject: [PATCH] docs: reflect changes in readme --- .gitignore | 5 +- README.md | 58 ++++++++++++------- .../boards/shields/goose/Kconfig.defconfig | 6 +- 3 files changed, 45 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 07a5b31..b1e7a68 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ kicad-prj/kicad-prj-backups kicad-prj/fp-lib-table kicad-prj/kicad-prj.kicad_prl -kicad-prj/pcb.kicad_prl \ No newline at end of file +kicad-prj/pcb.kicad_prl + +# zmk +firmware/zmk diff --git a/README.md b/README.md index 8df81c8..c8991a5 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,11 @@ in progress... - custom graphics and silk screen + # Manual additions after Ergogen -Ergogen is used to generate most parts of the PCB. This can be done using: +Ergogen is used to generate most parts of the PCB. From within the ergogen folder, this can be done using: ``` -ergogen . && cp output/pcbs/pcb.kicad_pcb kicad-prj/ +ergogen . && cp output/pcbs/pcb.kicad_pcb ../kicad-prj/ ``` However, various smaller modifications as well as the reversible OLED and silkscreen graphics are placed manually by hand. It is likely that this could be done through ergogen as well, feel free to fork and adjust my config. @@ -25,8 +26,9 @@ All modifications are listed in here: - Put on silkscreens on front [`porsche-front-big.kicad_mod`](./kicad-prj/graphics.pretty/porsche-front-big.kicad_mod) and back [`porsche-back-big.kicad_mod`](./kicad-prj/graphics.pretty/porsche-back-big.kicad_mod) + # Customize Graphics -In [graphics](./graphics/) you can find the source images used in this project. +In [graphics](./kicad-prj/graphics/) you can find the source images used in this project. There are two types of graphics. ### Silkscreen The silksceen uses the porsche images. @@ -44,7 +46,8 @@ You will most likely have a .png or .jpg image, which needs to be transformed to For this you can use popular online tools like [convertio.co](https://convertio.co/). Optionally you can try to optimize your svg using [this website](https://optimize.svgomg.net/), although it didn't make much of a difference for me. Next, we need to transform our svg into an array of points, for which i used [this website](https://shinao.github.io/PathToPoints/). -Lastly, you can replace the point array in [`footprints/phi-caps`](./footprints/phi-caps.js) for the front side or [`footprints/phi-logo`](./footprints/phi-logo.js) for the back side. +Lastly, you can replace the point array in [`ergogen/footprints/phi-caps`](./ergogen/footprints/phi-caps.js) for the front side or [`ergogen/footprints/phi-logo`](./ergogen/footprints/phi-logo.js) for the back side. + # Parts @@ -57,38 +60,53 @@ 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. +Usually ZMK is compiled throug a GitHub actions workflow. However, I prefer to use it locally using a docker devcontainer. The devcontainer is provided by the official ZMK project. + +## Setting up the ZMK docker toolchain ```bash -cd -docker volume create --driver local -o o=bind -o type=none -o device="/config/" zmk-config # enter absolute path +cd +nix develop # or install devcontainer cli otherwise +docker volume create --driver local -o o=bind -o type=none -o device="/firmware/zmk-config/" zmk-config 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 /bin/bash +docker exec -it /usr/bin/env bash # now from within container cd /workspaces/zmk west init -l app/ west update -# actually build the firmware -cd app +``` + +## Compiling the ZMK firmware +```bash +# enter the docker container +docker ps -a # get zmk container name +docker exec -it /usr/bin/env bash +# now from within the container +cd /workspaces/zmk/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" +west build -p -d build/left -b seeeduino_xiao_ble -- -DSHIELD=phiboard_left -DZMK_CONFIG="/workspaces/zmk-config" +west build -p -d build/right -b seeeduino_xiao_ble -- -DSHIELD=phiboard_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 +# the firmware can now be accessed outside the docker container at /firmware/zmk/app/build/ ``` +## Flashing the firmware +- 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 -- to https://github.com/Pipshag/goosekb for inspiration +- to https://github.com/Pipshag/goosekb for inspiration on ergogen and zmk - to https://www.youtube.com/watch?v=ohu4tZ4qov8 for finally making me follow through - and many, many more! diff --git a/firmware/zmk-config/boards/shields/goose/Kconfig.defconfig b/firmware/zmk-config/boards/shields/goose/Kconfig.defconfig index 711ee46..ee8befa 100644 --- a/firmware/zmk-config/boards/shields/goose/Kconfig.defconfig +++ b/firmware/zmk-config/boards/shields/goose/Kconfig.defconfig @@ -1,7 +1,7 @@ -if SHIELD_GOOSE_LEFT +if SHIELD_PHIBOARD_LEFT config ZMK_KEYBOARD_NAME - default "phiboard v1" + default "phiboard" config USB_DEVICE_MANUFACTURER default "phiwan" config ZMK_SPLIT_ROLE_CENTRAL @@ -9,7 +9,7 @@ config ZMK_SPLIT_ROLE_CENTRAL endif -if SHIELD_GOOSE_LEFT || SHIELD_GOOSE_RIGHT +if SHIELD_PHIBOARD_LEFT || SHIELD_PHIBOARD_RIGHT config ZMK_SPLIT default y