Skip to content

Commit

Permalink
Automate a few more steps required to build firmware locally
Browse files Browse the repository at this point in the history
  • Loading branch information
deividaspetraitis committed Apr 13, 2024
1 parent 51edcd9 commit ac83686
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# git config --get core.excludesfile
.env

# ignore zmk, build directories
zmk
build

# Vim backup, undo files
*.orig
*~
Expand Down
8 changes: 4 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

CFG="/home/deividas/github.com/deividaspetraitis/zmk-config/config"
CFG="/home/deividas/github.com/deividaspetraitis/zmk-config"

west build -p -d build/right -b nice_nano_v2 -- -DSHIELD=think_corne_right -DZMK_CONFIG="$CFG"
west build -p -d build/left -b nice_nano_v2 -- -DSHIELD=think_corne_left -DZMK_CONFIG="$CFG"
west build -p -d build/reset -b nice_nano_v2 -- -DSHIELD=settings_reset -DZMK_CONFIG="$CFG"
west build -s "$CFG/zmk/app" -p -d "$CFG/build/right" -b nice_nano_v2 -- -DSHIELD=think_corne_right -DZMK_CONFIG="$CFG/config"
west build -s "$CFG/zmk/app" -p -d "$CFG/build/left" -b nice_nano_v2 -- -DSHIELD=think_corne_left -DZMK_CONFIG="$CFG/config"
west build -s "$CFG/zmk/app" -p -d "$CFG/build/reset" -b nice_nano_v2 -- -DSHIELD=settings_reset -DZMK_CONFIG="$CFG/config"
7 changes: 5 additions & 2 deletions scripts/flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ fi
# Give some time to the user to mount the device.
sleep 5

# Create a mount point
mkdir -p /media/usb

# Right
sudo mount /dev/disk/by-id/usb-Adafruit_nRF_UF2_97A391CF144F945C-0:0 /media/usb
sudo cp build/right/zephyr/zmk.uf2 /media/usb/
sudo cp ./build/right/zephyr/zmk.uf2 /media/usb/

# Left
# sudo mount /dev/disk/by-id/usb-Adafruit_nRF_UF2_38F4230B63B3DA6E-0:0 /media/usb # old
# sudo mount /dev/disk/by-id/usb-Adafruit_nRF_UF2_38F4230B63B3DA6E-0:0 /media/usb
# sudo cp build/left/zephyr/zmk.uf2 /media/usb/

# sudo cp build/reset/zephyr/zmk.uf2 /media/usb
Expand Down
17 changes: 15 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ let
ninja
gperf
python3
virtualenv
ccache
dtc
gmp.dev
Expand All @@ -153,7 +154,19 @@ pkgs.mkShell {
export PATH=$PATH:${zephyr-sdk}/arm-zephyr-eabi/bin
unset CFLAGS
unset LDFLAGS
python3 -m venv ./venv/.venv
source ./zephyr/zephyr-env.sh
virtualenv ./.venv
source ./.venv/bin/activate
# clone zmk
git clone [email protected]:infused-kim/zmk.git -b pr-testing/mouse_ps2_v2 ./zmk
# setup
# https://zmk.dev/docs/development/setup
west init -l ./zmk/app/
cd ./zmk && west update && west zephyr-export && cd ..
pip3 install -r ./zmk/zephyr/scripts/requirements.txt
source ./zmk/zephyr/zephyr-env.sh
'';
}

0 comments on commit ac83686

Please sign in to comment.