This repo contains an example template for a new Zephyr project using the T2 (Star topology) where the application is the manifest repository.
The application supplied as example is the original Blinky app found in Zephyr samples folder.
More information on workspaces and supported topologies within a zephyr project can be found in the Zephyr Project Documentation
The instructions bellow are for MacOS.
This zephyr project uses the ARM GCC Compiler and assumes it is installed and the GNUARMEMB_TOOLCHAIN_PATH environment variable is set and pointing to the install folder.
For more information on available toolchains visit the Zephyr Toolchain Documentation
If another toolchain is used make sure to change the ZEPHYR_TOOLCHAIN_VARIANT variable in CMakeLists.txt
Alternatively we can install zephyr-sdk to provide one or multiple compilers
Python3 is required to use and compile the Zephyr RTOS.
To install on MacOS:
brew install python3
Create a folder for the new workspace. This new workspace will host an app folder where the contents of our repo will be installed as well as a full version of the zephyr-rtos with all the needed submodules for all the supported boards/architectures.
mkdir our_app_workspace
cd our_app_workspaceWe only need to create the workspace folder, the rest will be handled by west tool.
our_app_workspace/
│
├── app/ # This is where our repo will be installed
│ ├── app1/
│ │ ├── CMakeLists.txt # First Application
│ │ ├── prj.conf
│ │ └── src/
│ │ └── main.c
│ │
│ ├── app2/
│ │ ├── CMakeLists.txt # Second Application
│ │ ├── prj.conf
│ │ └── src/
│ │ └── main.c
│ └── west.yml # main manifest with optional import(s) and override(s)
│
├── modules/
│ └── lib/
│ └── tinycbor/
│
└── zephyr/
The most convenient way to install west is to create a python virtual environment.
python3 -m venv .venvActivate the virtual environment.
source .venv/bin/activateInstall the west tool
pip install westUsing west we clone our repo into the app folder and using west update we import the rest of the project from the Zephyr repository.
west init -m <repo_url> # this repo in this case
west updateInstall the rest of the python requirements
west packages pip --installWith the project completly setup we can test it by building the blinky example provided.
For example to build the project for a STM32F429ZI Nucleo dev board:
west build -p always -b nucleo_f429ziAlternatively, we can fix the board type using west config
# To check current config
west config -l
# To add a board to the setting
west config build.board nucleo_f429zi
# Also to delete the config setting
west config -d build.boardHowever, this setting will apply to all apps inside the apps folder. If different apps are targeting different boards this parameter must not be set