Using Zephyr without west

This page provides information on using Zephyr without west. This is not recommended for beginners due to the extra effort involved. In particular, you will have to do work “by hand” to replace these features:

  • cloning the additional source code repositories used by Zephyr in addition to the main zephyr repository, and keeping them up to date

  • specifying the locations of these repositories to the Zephyr build system

  • flashing and debugging without understanding detailed usage of the relevant host tools

Note

If you have previously installed west and want to stop using it, uninstall it first:

pip3 uninstall west

Otherwise, Zephyr’s build system will find it and may try to use it.

Getting the Source

In addition to downloading the zephyr source code repository itself, you will need to manually clone the additional projects listed in the west manifest file inside that repository.

mkdir zephyrproject
cd zephyrproject
git clone https://github.com/zephyrproject-rtos/zephyr
# clone additional repositories listed in zephyr/west.yml,
# and check out the specified revisions as well.

As you pull changes in the zephyr repository, you will also need to maintain those additional repositories, adding new ones as necessary and keeping existing ones up to date at the latest revisions.

Building applications

You can build a Zephyr application using CMake and Ninja (or make) directly without west installed if you specify any modules manually.

cmake -Bbuild -GNinja -DZEPHYR_MODULES=module1;module2;... samples/hello_world
ninja -Cbuild

When building with west installed, the Zephyr build system will use it to set ZEPHYR_MODULES.

If you don’t have west installed and your application does not need any of these repositories, the build will still work.

If you don’t have west installed and your application does need one of these repositories, you must set ZEPHYR_MODULES yourself as shown above.

See Modules (External projects) for more details.

Similarly, if your application requires binary blobs and you are not using west, you will need to download and place those blobs in the right places instead of using west blobs. See Binary Blobs for more details.

Flashing and Debugging

Flashing and debugging are done with the west flash, west debug, west debugserver, west attach and west rtt commands, which are documented in Building, Flashing and Debugging. These commands require west, so they are not available if you are using Zephyr without it.

Without west, you can still flash and debug using any of the Flash & Debug Host Tools which work for your board (and which those west commands wrap), but you will have to invoke them yourself, with the right options for your board and application.