Skip to content

Instantly share code, notes, and snippets.

@rockavoldy
Created May 26, 2023 10:26
Show Gist options
  • Save rockavoldy/6fcc0c6ccd3fdec7691f20cdee073dc0 to your computer and use it in GitHub Desktop.
Save rockavoldy/6fcc0c6ccd3fdec7691f20cdee073dc0 to your computer and use it in GitHub Desktop.
Build and flash firmware Cyber60

Build and Flash Cyber60 ZMK on Apple Silicon

Make sure homebrew already installed

  1. Prepare some dependencies needed to build firmware
    brew install cmake ninja gperf python3 ccache qemu dtc wget libmagic
  2. Download and setup latest zephyr-sdk from zephyrproject/project-rtos
    wget -c https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.1/zephyr-sdk-0.16.1_macos-aarch64.tar.xz
    tar xvf zephyr-sdk-0.16.1_macos-aarch64.tar.xz
    cd zephyr-sdk-0.16.1
    ./setup.sh
  3. setup pyenv, and install python3.10.6
    curl https://pyenv.run | bash
    pyenv install 3.10.6
    pyenv virtualenv 3.10.6 zmk
  4. Clone zmk repo, and install west. for Cyber60, need to take the repo from 4pplet
    cd $HOME
    git clone https://github.com/4pplet/zmk.git
    cd zmk
    pyenv local zmk
    # verify python version is 3.10.6
    python3 -V
    pip3 install west
  5. Init project using west, and update west toolchain, and install requirement needed for zmk
    west init -l app/
    west update
    # it will take times to download the toolchain
    pip3 install -r zephyr/scripts/requirements.txt
  6. Do some needed changes to the keymap, the file for cyber60 is in the zmk/app/boards/arm, there will be 4 cyber60 directory, make sure you use the correct directory
  7. When you're done and want to build the firmware, cd to zmk/app, and build NOTE: every west build need to be inside zmk/app
    ZEPHYR_TOOLCHAIN_VARIANT=zephyr west build -p -b cyber60_rev_d
  8. Wait for the build process to finish, then after done, you can flash to the board using
    west flash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment