Using your own computer
If you wish to do this lab on your own computer, it must be running a Unix-like system such as Linux or macOS. You may be able to do the lab in Microsoft Windows but do not expect help from the teachers (you're welcome to provide a step-by-step guide that would be included here).
The Zephyr web site contains instructions to install Zephyr.
You will have perform the following steps:
- Install the required packages on your computer (such as cmake).
- Decide where you will install Zephyr (for example
$HOME/zephyrproject
). - Create a virtual Python 3 environment (for example in
$HOME/zephyrproject/venv
):
$ mkdir $HOME/zephyr
$ python3 -mvenv $HOME/zephyr/venv
- Activate this environment by sourcing the
activate
file:
$ source $HOME/zephyr/venv/bin/activate
- Install
west
, Zephyr toolbox utility:
$ pip install west
- Get Zephyr source code from git using
west
and update its dependent git repositories:
$ cd $HOME/zephyrproject
$ west init
$ west update
- Register Zephyr location for cmake:
$ west zephyr-export
- Install Zephyr Python requirements:
$ pip install -r zephyr/scripts/requirements.txt
- Install Zephyr SDK (see the instructions to install the SDK).
- Register Zephyr SDK location for cmake by running
setup.sh
found inside the SDK directory. - Install udev rules as per the instructions page.
Keep in mind the following points:
- Zephyr and its SDK might take up to 25GB on your computer. Please ensure that you have enough room available.
- Do not forget to activate the virtual Python environment in any terminal where you wish to use Zephyr.
- You need to set the
ZEPHYR_BASE
environment variable to thezephyr
directory created bywest init
(for example$HOME/zephyrproject/zephyr
).