Skip to main content

Native Setup

1. Install Zephyr Dependencies

Open Zephyr's Getting Started Guide and follow the instructions under these sections:

info

Zephyr's Install Linux Host Dependencies page may be of use for users of Linux distributions which are not based on Ubuntu.

2. Source Code

Next, you'll need to clone the ZMK source repository if you haven't already. Open a terminal and navigate to the folder you would like to place your zmk directory in, then run the following command:

git clone https://github.com/zmkfirmware/zmk.git

Then step into the repository.

cd zmk

3. Get Zephyr and install Python dependencies

note

These steps are very similar to Zephyr's Get Zephyr and install Python dependencies instructions, but specialized for ZMK.

  1. Use apt to install Python venv package:
sudo apt install python3-venv
  1. Create a new virtual environment and activate it:
python3 -m venv .venv
source .venv/bin/activate

Once activated your shell will be prefixed with (.venv). The virtual environment can be deactivated at any time by running deactivate.

note

Remember to activate the virtual environment every time you start working.

  1. Install west:
pip install west
  1. Initialize the application and update to fetch modules, including Zephyr:
west init -l app/
west update
tip

This step pulls down quite a bit of tooling, be patient!

  1. Export a Zephyr CMake package. This allows CMake to automatically load boilerplate code required for building Zephyr applications.
west zephyr-export
  1. Install the additional dependencies found in Zephyr's requirements-base.txt:
pip install -r zephyr/scripts/requirements-base.txt

4. Install Zephyr SDK

Return to Zephyr's Getting Started Guide and Install Zephyr SDK.

OS-Specific Notes

dfu-util is required to flash devices that use DFU, but there is currently no maintained package for it on Chocolatey. QMK Toolbox contains a working version of it though.

Your setup is now complete.