| Authors |
|
| Responsible |
|
| Last Updated | 10/12/2025, 12:48:54 PM |
| Last Author | Kai Berszin |
Scope
This article guides you through the Zephyr installation process. It follows and comments on the Zephyr Getting Started Guide.
How to use this guide
It is recommended to have the Zephyr Getting Started Guide and this guide open at the same time. This guide will comment on the steps taken in the Zephyr guide and give more context and recommendations.
Goals
Getting all the required dependencies installed without doing much extra work. The Zephyr guide does more than just installation. It also teaches how to compile your first sample. We will not do that here. Instead we will focus on just the installation. There are other guides for building code.
Installing dependencies
It is now time to start with the Zephyr guide. Installing the depencies is very much platform dependent. The process on Ubuntu and macOS is straight forward using apt or homebrew. Windows installs can be a bit more tricky.
Ubuntu & macOS
Follow the Zephyr guide. Nothing to add here.
Windows
The build system depends on a few small open source packages for which it can be quite hard to find windows executables. The Zepyhr guide recommends to use chotolatey, a package manager (like apt) but for Windows. It allows you to install these dependecies with relative ease. But do not use it blindly. Only use it for software that is hard to find and or install.
Installing chocolatey
Follow the link in the Zephyr guide. On the chocolatey page choose the Individual option for installation.
Now follow the installation guide and pay attention to every little detail.
Note: You need to do this in an admin powershell. In your Window search bar search for powershell, right click and select run as administrator.
When you are done, check your choco installation by running choco. It should print something similar to
Chocolatey vx.y.z
Please run 'choco -?' or 'choco <command> -?' for help menu.
Now return to the Zephyr guide.
All the following steps need to be done in an admin shell. Both powershell and the standard windows command prompt cmd should work. But don't forget the run as admin part.
Follow the steps up to the lines where you install stuff using choco with choco install. Have a look at the list of programs they want you to install. You might have some of them already installed on your system. There is a good chance that python, git and maybe even cmake are already installed. Don't reinstall these with choco. Just remove them from the list. Especially consider install python seperately as you might have to use and update it in the far future when you have long forgotten that choco exists on your machine.
Now we can continue to the next major step.
Get Zephyr and install Python dependencies step
They want you to clone the main Zephyr repository just to install python requirements and export a CMake package.
Chances are you are reading this guide because you want to start working on SAGE related code. You can do this steps with our own codebase instead of theirs. There are two options here:
Option 1: Follow the Zephyr guide
You will end up with a useless Zephyr source tree but it will work.
Option 2: Start immediately with SAGE code
Advantage: No need to download Zephyr twice (Once for nothing and a second time for SAGE code). Don't underestimate the download times. Doing this on a mobile connection might take 30 minutes.
Second advantage: Your code is already set up and ready to use.
Convinced? Let's get started.
Follow only this guide for now.
Start by installing west into your python environment.
pip install west
We will use the POBC code as an exmple, but all Zephyr repos which follow the Zephyr T2 workspace topology should work. (This is the case for all SAGE Zephyr repos so you don't actually need to know what that T2 term means).
The first step is to initialize the workspace folder (sage-pay-pobc-sw-workspace) where
the sage-pay-pobc-sw and all Zephyr modules will be cloned. Make sure to navigate to a folder where you want to place the code. Now run this command where you want to place the workspace. Note: You you need to adjust the command to download another repo than POBC.
west init -m https://github.com/aris-space/sage-pay-pobc-sw --mr main sage-pay-pobc-sw-workspace
west will create a workspace folder and put our Github code into a subfolder of that workspace.
Now navigate into the workspace
cd sage-pay-pobc-sw-workspace
and run west update
west update
This will download Zephyr. When it's done, you should have some more folder named zephyr and modules in your workspace.
Now we are done with our special excursion. There is a complete zephyr source tree in your workspace now. We can go back to the Zephyr getting started guide and skip over the steps where we download Zephyr (we just did that), and go straight to the last two commands to do the cmake export and python dependency installation.
west zephyr-export
west packages pip --install
Installing the Zephyr SDK
Almost done. We have everything except the C compiler to compile our code. Zephyr offers compilers and tools for every support platform in a neat little packages called the Zephyr SDK.
Try to run the following
west packages pip --install
If the above command does not work for some reason you can achieve the same thing by running this command inside your workspace folder:
pip install -r zephyr/scripts/requirements.txt
Now we can install the latest Zephyr SDK by running
west sdk install
Congratulations
You made it. You only have to do this once per machine. The Zephyr SDK and dependencies will be used for any Zephyr project you will be working on.
If you found it hard to follow this guide or you found things that just don't work, please tell the person responsible for this article.
Next step is the how to build guide.