Installation Guides¶
In-depht installation guide: docs.zephyrproject
Board docs: nucleo_f767zi
If you have STM32CubeProgrammer PATH problems, you can use OpenOCD instead.
Quick Installation¶
Install script using curl
curl -O https://raw.githubusercontent.com/UiASub/K2-Zephyr/main/install_zephyr.sh
chmod +x install_zephyr.sh
./install_zephyr.sh
use ./install_zephyr.sh -h to see help
STM32CubeProgrammer (Recommended):
then make the usb writeable (Linux only):
Install script using powershell
You will need winget to install dependencies.
Invoke-WebRequest https://raw.githubusercontent.com/UiASub/K2-Zephyr/main/install_zephyr.ps1 -OutFile install_zephyr.ps1
# Use script:
Set-ExecutionPolicy -ExecutionPolicy Bypass -File install_zephyr.ps1
Default install path is $HOME\zephyrproject
STM32CubeProgrammer (Recommended): Link to Google Drive
Manual Installation¶
Windows: Use winget then run this in ps or cmd:
winget install Kitware.CMake Ninja-build.Ninja oss-winget.gperf Python.Python.3.11 Git.Git oss-winget.dtc wget 7zip.7zip
STM32CubeProgrammer (Recommended): Link to Google Drive
You may need to add the 7zip and STM32CubeProgrammer installation folders to your PATH.
Get Zephyr and install Python dependencies in Windows¶
in Powershell on Windows:
cd $Env:HOMEPATH
python -m venv zephyrproject\.venv
zephyrproject\.venv\Scripts\Activate.ps1
pip install west
west init --mr v4.2.0 zephyrproject
cd zephyrproject
west update
west zephyr-export
west packages pip --install
cd $Env:HOMEPATH\zephyrproject\zephyr
west sdk install --toolchains arm-zephyr-eabi
Clone and Build K2-Zephyr (Windows)¶
After completing the Zephyr setup:
Ubuntu: Use apt:
sudo apt install --no-install-recommends git cmake ninja-build gperf \
ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk \
xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 openocd
verify:
Note: Python above version 3.12 may not work, recommended version is therefore 3.11
Get Zephyr and install Python dependencies in Ubuntu¶
Using pip on Linux:
python3.11 -m venv ~/zephyrproject/.venv
source ~/zephyrproject/.venv/bin/activate
pip install west
west init --mr v4.2.0 ~/zephyrproject
cd ~/zephyrproject
west update
west zephyr-export
west packages pip --install
cd ~/zephyrproject/zephyr
west sdk install --toolchains arm-zephyr-eabi
Or using uv:
cd ~/zephyrproject
uv venv --python 3.11
source .venv/bin/activate
uv pip install west
west init --mr v4.2.0 ~/zephyrproject
west update
west zephyr-export
west packages pip --install
cd ~/zephyrproject/zephyr
west sdk install --toolchains arm-zephyr-eabi
Clone and Build K2-Zephyr¶
After completing the Zephyr setup:
MacOS: Use Homebrew
STM32CubeProgrammer (Recommended): Link to Google Drive (Mac ARM)Get Zephyr and install Python dependencies in Mac¶
Using pip on MacOS:
python3.11 -m venv ~/zephyrproject/.venv
source ~/zephyrproject/.venv/bin/activate
pip install west
west init --mr v4.2.0 ~/zephyrproject
cd ~/zephyrproject
west update
west zephyr-export
west packages pip --install
cd ~/zephyrproject/zephyr
west sdk install --toolchains arm-zephyr-eabi
Or using uv:
cd ~/zephyrproject
uv venv --python 3.11
source .venv/bin/activate
uv pip install west
west init --mr v4.2.0 ~/zephyrproject
west update
west zephyr-export
west packages pip --install
cd ~/zephyrproject/zephyr
west sdk install --toolchains arm-zephyr-eabi
Clone and Build K2-Zephyr¶
After completing the Zephyr setup:
STM32CubeProgrammer PATH (if installed from ST website)¶
If you installed STM32CubeProgrammer from Google Drive or ST's website, the installer may not add the CLI tools to your PATH.
If west flash doesn't find STM32CubeProgrammer, you can add it manually:
Windows (example)¶
use the exact install path you have; PowerShell example
Open System Properties -> Environment Variables and add the STM32CubeProgrammer bin directory to your PATH, or use PowerShell:
After adding the path, re-open your shell (or sign out & sign back in on Windows) so west flash can detect the STM32CubeProgrammer CLI.
macOS (example)¶
- Find the installed CLI binary (common name:
STM32_Programmer_CLI).
- Add its directory to your shell profile (example path below, adjust to match the location you discovered):
echo 'export PATH="/Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/Resources/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
Linux (example)¶
- Find the installed CLI binary (common name:
STM32_Programmer_CLI).
- Add its directory to your shell profile (example path below, adjust to match the location you discovered):
echo 'export PATH="/opt/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
OpenOCD¶
To explicitly use OpenOCD: