Discover how West, a meta-tool from the Zephyr real-time operating system (RTOS) ecosystem, revolutionizes embedded software development by streamlining project management across multiple repositories. This article dives into practical applications of West for enhancing portability and reusability in complex embedded systems, offering engineers actionable insights to optimize their workflows.
Embedded software development is rapidly evolving. What once was a bare-metal monolith compiled in a vendor integrated development environment (IDE), is now transitioning into highly modular, reusable, and testable codebases driven by modern DevOps workflows.
In previous articles, we explored how to build a modern CMake build system [1] for embedded development and how to apply Test-Driven Development (TDD) techniques effectively in that environment.
Today, we will explore another game-changing tool: West, a meta-tool from the Zephyr RTOS ecosystem [2]. Even if you don’t use Zephyr, West offers several valuable lessons for managing complex embedded projects with many components, targets, and repositories.
In this article, we’ll walk through:
- What West is and why it matters.
- How Zephyr uses West to manage code at scale.
- How to use West in your own embedded projects.
- How it complements a modern build system.
- Practical examples to demonstrate reusable, portable architecture with West.
Let’s dive in.
What is West?
At its core, West is a project and workspace management tool. Originally developed as part of the Zephyr RTOS project, it was designed to solve a recurring pain point in embedded development—managing multiple Git repositories across layers of dependencies.
You can think of West as a wrapper for Git, CMake, and custom build commands that makes it easy to:
- Clone and manage multiple repositories in a workspace.
- Build complex projects with multiple targets or boards.
- Run test, flash, or debug commands with consistent behavior.
- Define and manage extensions or subprojects in a reproducible way.
While Zephyr is the canonical user of West, nothing stops you from using it to manage your own RTOS, middleware, applications, and even continuous integration (CI) workflows.
Why You Should Care (Even if You Don’t Use Zephyr)
Embedded development is increasingly modular. In fact, as you look at more and more devices being connected to the Internet, there are plenty of opportunities for reuse.
For example, your current projects might already be pulling in:
- Board support packages (BSPs) from silicon vendors.
- RTOS source trees (FreeRTOS, Zephyr, etc.)
- Third-party middleware such as MQTT, BLE stacks, or file systems.
- Custom reusable libraries across multiple products.
Managing all of this by hand is a nightmare. Git submodules are finicky. Build configurations drift. Manual integration becomes fragile. West solves these problems by:
- Defining project manifests in a single YAML file.
- Providing commands to fetch, sync, and build projects.
- Offering per-project overrides for build flags, remotes, and directories.
Let’s look at how Zephyr uses West to scale. Then, we’ll walk through adapting it for your own systems.
How Zephyr Uses West (and What We Can Learn From It)
If you’ve spent any time exploring Zephyr RTOS, you know it’s a beast. We’re talking about a massive project that supports hundreds of boards, SoCs, and modules. It’s impressive, but also intimidating if you’re coming from a more traditional embedded workflow.
So how does Zephyr keep it all straight? The answer is West.
Zephyr uses West to manage its sprawling codebase and keep development sane. And even if you never plan to use Zephyr in a product, there are some key lessons you can apply to your own projects.
First, Zephyr is broken into dozens of repositories. Here are just a few of the major components:
- zephyr/ — the kernel and base operating system
- hal_stm32/, hal_nordic/, etc. — hardware abstraction layers for different vendors
- cmsis/, mcuboot/ — peripheral libraries and bootloaders
- modules/ – networking stacks, middleware, and more
If you tried to clone and maintain these manually, it would be a nightmare. Git submodules? Good luck. Manual scripts? Been there, done that—never again.
Instead, Zephyr uses a single west.yml manifest to define all its repositories and where they belong in the workspace. The manifest looks something similar to Figure 1.

Zephyr uses a single west.yml manifest to define all its repositories and where they belong in the workspace.
Once that manifest is in place, you run two simple commands:
west init
west update
…and just like that, your entire workspace is populated with the exact versions of each repository. There are no mismatched commits. No searching GitHub for the right tag. Everything lands precisely where it should, ready to build.
It’s like infrastructure-as-code, but for your entire firmware stack.
Second, Zephyr uses West to build, flash, and debug. For example, if you wanted to build your project for the STM32F446RE Nucleo board, you’d use a command such as:
west build -b nucleo_f446re path/to/app
Once the project is compiled, you can use the following command to flash the code to your target with:
west flash
That command will just program the application to the target. It won’t let you debug it. If you want to do that, you need to use the following command:
west debug
As simple as these two examples may seem, they standardize the entire workflow—from code retrieval to deployment—so you can focus on developing features instead of configuring tools.
Getting Started with West in Your Own Projects
So now that we’ve seen how Zephyr uses West to manage a massive project, you might be thinking, “That’s great for Zephyr. But I don’t have a giant RTOS project with 50 repositories. Can I still use West in my own stuff?”
Absolutely.
In fact, West can be even more powerful in smaller projects because it helps you organize your codebase before it grows out of control. Whether you’re managing reusable drivers, different applications, or just want a cleaner dev setup, West gives you a consistent, reproducible way to get the job done.
Let’s walk through how you can use it in your own embedded development workflow.
Step 1—Set Up a Manifest Repository: Every West-based project starts with a manifest. Think of this as the blueprint for your workspace. It’s where you define what repositories you’re using, where they live, and what version of each one should be checked out.
Let’s say you’ve got a setup such as the exmaple shown in Figure 2. Instead of manually cloning each repo or setting up fragile relative paths in your build system, you can define everything in a west.yml file, as seen in Figure 3.
Once the manifest is ready, you set up the workspace like this:
west init -m https://github.com/myorg/my_workspace_manifest
west update
That’s it. All your components are pulled into the right place, at the correct version, without any guesswork. You’ve just leveled up your repo hygiene.
Step 2—Integrate with Your CMake Build System: West doesn’t replace your build system, it complements it. You can use the same modern CMake setup we’ve previously discussed. Just organize your projects using CMakeLists.txt files and point to your shared libraries using paths that West sets up automatically.
Here’s an example CMakeLists.txt for your sensor_node app:
cmake_minimum_required(VERSION 3.20)
project(sensor_node)
— ADVERTISMENT—
—Advertise Here—
add_subdirectory(${WEST_ROOT}/common_libs/drivers)
add_executable(sensor_node main.c)
Now you can build your app like this:
west build -b custom_board . — -DCMAKE_TOOLCHAIN_FILE=toolchain-host.cmake
No more messing with include paths, copying driver code between apps, or hardcoding toolchain settings. It all flows through one system.
Step 3—Create a Developer Workflow that Just Works: You don’t need to memorize long build commands or create a dozen different shell scripts. West lets you streamline your workflow with clean, consistent commands for common tasks.
Need to test something?
Need to rebuild and flash firmware?
Need to debug over SWD?
You can customize your workflow using simple commands that your whole team can follow. And if you really want to go deep, you can even add custom West extensions for things such as unit tests, static analysis, or CI automation. We’ll talk more about that in the next section.
Step 4—Extend West with Custom Commands: One of the coolest things about West and, something that most developers overlook, is that it’s not just for pulling repos and building code. You can actually extend it with your own commands.
That means you’re no longer tied to a patchwork of shell scripts, Make targets, or README instructions. You can give your team a consistent, discoverable interface for common tasks, just like Zephyr does.
Let’s walk through what that looks like.
Why Add Custom Commands?
If you’ve ever:
- Written a run_tests.sh script for unit tests.
- Created a dozen README instructions on “how to build for board X.”
- Had to explain to your coworker (again) how to flash the firmware.
…then a custom West command is probably the better way.
By defining these commands once, you standardize the workflow and make it easy for anyone on your team (or future you) to do the right thing with a single, simple command.
Creating Your First Custom Command
Let’s say you want to add a West test command that runs your unit tests using ctest.
Here’s how to do it:
1) Create a directory in your repo (or workspace) called west_commands/.
2) Inside it, create a Python file called test.py with the content shown in Figure 4.
3) Update your west.yml to register the custom command seen in Figure 5.
— ADVERTISMENT—
—Advertise Here—
Once that’s set up, you can run your tests like this:
west test
That’s it. You’ve just replaced an entire section of your README with a real command that anyone can run anywhere, anytime.
The power here isn’t just in automation, it’s in standardization. Everyone runs the same commands. Everyone gets the same results. And no one has to guess how things are supposed to work.
That’s how you scale embedded software development without losing your sanity.
Reusability and Portability: Lessons from Zephyr’s Architecture
If there’s one thing we should all learn from Zephyr, it’s this—separate your application from your platform.
Zephyr’s architecture enables thousands of configuration options and forces you to think modularly. Drivers, applications, board support packages, and libraries are all broken into separate components, each with their own purpose and well-defined boundaries.
And that mindset? It’s one we should all adopt whether or not we use Zephyr.
Let’s unpack why.
Most embedded developers (my past self included) start by jamming everything into a single folder: application code, peripheral drivers, glue logic, and maybe a FreeRTOS folder tossed in for good measure.
It works—until it doesn’t.
Suddenly, you need to:
- Port your app to a new microcontroller.
- Reuse a driver in a different product.
- Run a unit test without bringing up hardware.
And now you’re untangling a web of tight coupling that you never meant to build.
That’s where West—and the architectural philosophy behind it—comes in.
By organizing your code into standalone, versioned components and managing them with a manifest, you make reuse and portability a built-in feature, not an afterthought.
— ADVERTISMENT—
—Advertise Here—
Here’s how you can set yourself up for success using West to help you architect your project for reuse:
- Break out drivers and middleware into their own repos (or at least directories).
- Use west.yml to pull in only the components you need for a given application.
- Swap hardware layers by changing a manifest entry, not by rewriting your app.
- Target different boards or platforms by passing new toolchain or build config arguments to west build
Want to reuse your thermostat control app across an STM32 and an NXP processor? You shouldn’t have to rewrite a single line of application code. Just update your HAL layer in the manifest and switch toolchains.
Done.
Want to share a driver with another team? No problem. Package it, point to it in your manifest, and use it just like any other dependency.
When everything is modular and version-controlled through a manifest, it also becomes easier to:
- Reproduce builds across environments.
- Run tests on subsets of components.
- Automate builds for multiple targets in parallel.
And let’s be honest, there’s no better feeling than knowing your system builds cleanly every time, from a fresh clone, on any machine.
It’s the difference between “Works on my laptop” and “This thing’s rock solid.”
Practical Example—Building a Sensor Node with a Reusable HAL
Let’s pull everything together with a real-world example.
Imagine you’re building a low-power sensor node. It’s going to ship on an STM32 platform, but you’re already planning to migrate to a different processor family next year—maybe NXP or Renesas. You want to keep your application logic untouched and simply swap out the hardware layer when needed.
This is exactly the kind of setup where West shines.
You might organize your workspace as shown in Figure 6. Your application is clean. It has no idea which vendor HAL is being used under the hood. That’s the way it should be.
In your manifest, you define each component as a separate project. A trimmed-down version can be seen in Figure 7.

A trimmed-down version of a manifest, where each component is defined as a separate project.
Need to switch from STM32 to an NXP platform? Just change hal_stm32 to hal_nxp and re-run west update. You don’t touch your app. You can use a single command to build the application:
west build -b custom_board apps/sensor_node
To run your tests, you can use:
west test
Final Thoughts
If you’ve been following along, you’ve now seen how West offers a clean, scalable, and efficient way to manage embedded software projects.
It doesn’t matter whether you’re working on a simple sensor node or a complex platform with multiple products. West gives you the structure, tools, and repeatability needed to build modern, maintainable systems.
At this point, you’ve got the tools to:
- Organize your project into modular components.
- Reuse code across platforms and products
- Separate hardware-specific logic from your core application.
- Simplify and standardize your build, test, and deployment workflows.
The key takeaway here is simple—West isn’t just for Zephyr. It’s a powerful tool you can adopt incrementally, starting with just a manifest and a few repositories. As your needs grow, West scales with you. You don’t need to change your entire development process overnight. You just need to take the first step.
Start by:
- Creating a basic west.yml manifest that defines your project structure.
- Refactoring one of your applications to separate the HAL from the core logic.
- Building it using West and your existing CMake setup.
- Running it on different targets with minimal changes to the application.
The sooner you start thinking in terms of portability and reusability, the easier your life becomes down the road. With a proper build foundation in place, you’re well-positioned to bring in other modern techniques such as simulation, DevOps, and continuous integration without rebuilding your toolchain every time. These practices not only streamline workflows but also enhance collaboration across teams, saving valuable time and resources.
Getting started doesn’t take much. But once you do, you’ll never look at embedded project organization the same way again. By adopting these principles early, you set yourself up for long-term success and adaptability in an ever-evolving technological landscape.
REFERENCES
[1] Modern Embedded CMake Build System Download
https://www.beningo.com/embedded-software-cmake-build-system
[2] West documentation:
https://docs.zephyrproject.org/latest/develop/west/index.html
PUBLISHED IN CIRCUIT CELLAR MAGAZINE • JUNE 2025 #419 – Get a PDF of the issue
Sponsor this Article





