Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Install and configure Zephyr Workbench in VS Code
title: Install and configure Workbench for Zephyr in VS Code
weight: 2

### FIXED, DO NOT MODIFY
Expand All @@ -10,45 +10,53 @@ layout: learningpathall

Setting up a [Zephyr](https://zephyrproject.org/) RTOS development environment from scratch can be challenging, requiring you to manually install SDKs, configure toolchains, and initialize workspace directories. These steps often vary across operating systems and board vendors, leading to a fragmented and error-prone setup process.

[Zephyr Workbench](https://zephyr-workbench.com/) is an open-source Visual Studio Code extension that transforms Zephyr RTOS development into a streamlined IDE experience. Created by [Ac6](https://www.ac6.fr/en/), it automates toolchain setup, project management, and debugging, making Zephyr projects faster to start and easier to scale.
[Workbench for Zephyr](https://zephyr-workbench.com/) is an open-source Visual Studio Code [extension](https://marketplace.visualstudio.com/items?itemName=Ac6.zephyr-workbench) that transforms Zephyr RTOS development into a streamlined IDE experience. Created by [Ac6](https://www.ac6.fr/en/), it automates toolchain setup, project management, and debugging, making Zephyr projects faster to start and easier to scale.

In this Learning Path, you'll learn the essential steps to install Zephyr Workbench and configure a complete development environment on your local machine. Once complete, you'll be ready to create, build, and debug applications for Arm Cortex-M platforms using Zephyr RTOS.
In this Learning Path, you'll learn the essential steps to install Workbench for Zephyr and configure a complete development environment on your local machine. Once complete, you'll be ready to create, build, and debug applications for Arm Cortex-M platforms using Zephyr RTOS.

Zephyr Workbench provides one-click environment setup that automatically installs the required tools including Python, CMake, Ninja, and Git. It supports importing and managing Zephyr SDKs with version and architecture selection, while initializing west workspaces and creating board-specific applications from samples. The extension builds Zephyr applications and flashes hardware directly from the VS Code interface. It also provides breakpoint debugging and memory usage insights with hardware probe support.
Workbench for Zephyr provides one-click environment setup that automatically installs the required tools including Python, CMake, Ninja, and Git. It supports importing and managing Zephyr SDKs with version and architecture selection, while initializing west workspaces and creating board-specific applications from samples. The extension builds Zephyr applications and flashes hardware directly from the VS Code interface. It also provides breakpoint debugging and memory usage insights with hardware probe support.

## What you need before installing Zephyr Workbench
## What you need before installing Workbench for Zephyr

To get started with Zephyr Workbench you need to have Visual Studio Code downloaded, installed, and running on your computer.
To get started with Workbench for Zephyr you need to have Visual Studio Code downloaded, installed, and running on your computer.

For Windows, you need version 10 or later (64-bit), along with administrator privileges for installing tools and drivers.
**Windows OS:**
For Windows, you need version 10 or later (64-bit x64), along with administrator privileges for installing runners and drivers.

On macOS, the Homebrew package manager is required. To install Homebrew, run the following command:
**MacOS:**
On MacOS, the Homebrew package manager is required. To install Homebrew, run the following command:

```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

Zephyr Workbench supports STM32 development boards (STM32 Discovery, Nucleo series), Nordic Semiconductor boards (nRF52, nRF53, nRF91 series), NXP development boards (FRDM, LPCXpresso series), Espressif boards (ESP32-based boards), and many other Zephyr-supported platforms. You need a development board to try out the code examples.
**Linux:**
- A recent 64-bit X64 distribution such as Ubuntu 20.04 or later, Fedora, Clear Linux OS, or Arch Linux
- Other distributions might work, but may require manual configuration of system packages
- After installation, use the Workbench host tools manager to verify that all required tools were installed correctly

## Configure the Zephyr Workbench extension in Visual Studio Code

Zephyr Workbench supports STM32 development boards (STM32 Discovery, Nucleo series), Nordic Semiconductor boards (nRF52, nRF53, nRF91 series), NXP development boards (FRDM, LPCXpresso series), Espressif boards (ESP32-based boards), and many other Zephyr-supported platforms like Renesas, Silabs or Infineon. You need a development board to try out the code examples.

## Configure the Workbench for Zephyr extension in Visual Studio Code

This section covers installing the Zephyr Workbench extension and configuring your Arm development environment.

### Install the extension

To install the Zephyr Workbench extension, open Visual Studio Code and navigate to the Extensions view by selecting the Extensions icon in the Activity Bar.
To install the Workbench for Zephyr extension, open Visual Studio Code and navigate to the Extensions view by selecting the Extensions icon in the Activity Bar.

You can also use the keyboard shortcut `Ctrl+Shift+X` (Windows/Linux) or `Cmd+Shift+X` (macOS).

In the search box, type "Zephyr Workbench" and locate the official "Zephyr Workbench" extension by Ac6. Select **Install** to add the extension to VS Code.
In the search box, type "Workbench for Zephyr" and locate the official "Workbench for Workbench" extension by Ac6. Select **Install** to add the extension to VS Code.

The extension icon appears in the Activity Bar, and a welcome message may appear confirming successful installation.

Once installed, the Zephyr Workbench icon appears in the sidebar with a welcome screen.
Once installed, the Workbench for Zephyr icon appears in the sidebar with a welcome screen.

### Install the required host tools

In the Zephyr Workbench panel, select **Install Host Tools** to automatically install the required dependencies.
In the Workbench for Zephyr panel, select **Install Host Tools** to automatically install the required dependencies.

This process installs Python 3.x, CMake, the Ninja build system, Git, Device Tree Compiler (DTC), and the West meta-tool.

Expand All @@ -62,7 +70,7 @@ When the installation completes, select **Verify Host Tools** to check the versi

### Import and configure the toolchain

Next, download and configure the toolchain by selecting **Import Toolchain** in the Zephyr Workbench panel. Select the toolchain family (*Zephyr SDK*) and configure the SDK Type by choosing *Minimal* for basic functionality.
Next, download and configure the toolchain by selecting **Import Toolchain** in the Workbench for Zephyr panel. Select the toolchain family (*Zephyr SDK*) and configure the SDK Type by choosing *Minimal* for basic functionality.

Select your desired version (such as v0.17.0 or v0.17.3) and choose the target architectures. For this Learning Path, you only need to select *arm*.

Expand All @@ -73,9 +81,9 @@ Specify the parent directory for SDK installation and select **Import** to downl

### Initialize the Zephyr project workspace

Zephyr uses a Git-based workspace manager called West to organize its source code, modules, and samples. Use Zephyr Workbench to initialize your first West workspace.
Zephyr uses a Git-based workspace manager called West to organize its source code, modules, and samples. Use Workbench for Zephyr to initialize your first West workspace.

In the Zephyr Workbench panel, select **Initialize Workspace** to set up your project environment. Configure the workspace settings by selecting "Minimal from template" for the source location and using the default path `https://github.com/zephyrproject-rtos/zephyr`.
In the Workbench for Zephyr panel, select **Initialize Workspace** to set up your project environment. Configure the workspace settings by selecting "Minimal from template" for the source location and using the default path `https://github.com/zephyrproject-rtos/zephyr`.

Choose a target-specific template (such as STM32 or NXP) and select your Zephyr version (such as v3.7.0 or v4.1.0). Specify the directory for your workspace, keeping in mind that initialization takes approximately 10 minutes to complete.

Expand All @@ -89,7 +97,7 @@ The workspace initialization downloads the Zephyr source code and dependencies.

### Verify setup

Test your setup by confirming that the Zephyr Workbench panel shows all components as installed successfully. Verify the host tools are installed, the SDK is imported and detected, and the West workspace is initialized. Ensure no error messages appear in the VS Code output panel.
Test your setup by confirming that the Workbench for Zephyr panel shows all components as installed successfully. Verify the host tools are installed, the SDK is imported and detected, and the West workspace is initialized. Ensure no error messages appear in the VS Code output panel.

{{% notice Note %}}
**Troubleshooting tips:**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ layout: learningpathall

## Create and build your first Zephyr application

In this session, you'll learn how to create and build your first Zephyr application using Zephyr Workbench. This step prepares you to customize, test, and expand real firmware projects on Arm Cortex-M boards.
In this session, you'll learn how to create and build your first Zephyr application using Workbench for Zephyr. This step prepares you to customize, test, and expand real firmware projects on Arm Cortex-M boards.

For demonstration, you'll use an [NXP FRDM-MCXN947](https://www.nxp.com/design/design-center/development-boards-and-designs/FRDM-MCXN947) development board as the target device. However, the same steps apply to any Zephyr-supported Arm Cortex-M board.
You can find the full list of supported boards in the [Supported Boards](https://docs.zephyrproject.org/latest/boards/#).

Depending on your board, you might need to install a different debug tool. The next module covers this setup.
Depending on your board, you might need to install a different debug tool aka `runner`. The next module covers this setup.

### Create application

Expand All @@ -30,7 +30,7 @@ In the Zephyr Workbench panel:

### Build the application

Select the **Build** button in Zephyr Workbench or press `Ctrl+Shift+B`.
Select the **Build** button in Workbench for Zephyr or press `Ctrl+Shift+B`.

The build system compiles your application and links it against the Zephyr kernel and board-specific drivers.

Expand All @@ -43,11 +43,11 @@ To enable debugging on your target hardware, you might need to install additiona
For the NXP FRDM-MCXN947, download and install the LinkServer debug utility:
- LinkServer for Microcontrollers: [NXP LinkServer Download Page](https://www.nxp.com/design/design-center/software/development-software/mcuxpresso-software-and-tools-/linkserver-for-microcontrollers:LINKERSERVER)

Once installed, Zephyr Workbench attempts to detect it automatically during a debug session.
Once installed, Workbench for Zephyr attempts to detect it automatically during a debug session.
If you're using a different board, see your vendor's documentation to install the appropriate debug utility.

{{% notice Note %}}
If Zephyr Workbench doesn't automatically detect the installed debug runner, you can manually configure it.
If Workbench for Zephyr doesn't automatically detect the installed debug runner, you can manually configure it.
Open the **Debug Manager** from the Zephyr sidebar, and enter the full path to the runner executable.
{{% /notice %}}

Expand All @@ -68,11 +68,11 @@ The following code shows a basic Zephyr application that prints a message to the

```c
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/stdio.h>

int main(void)
{
printk("Hello World! %s\n", CONFIG_BOARD); // Prints board name to serial console
printk("Hello World! %s\n", CONFIG_BOARD_TARGET); // Prints board name to serial console
return 0;
}
```
Expand All @@ -83,4 +83,4 @@ int main(void)

Now that the app works, try editing the message in `printk()` or changing the board target in the application settings. Then rebuild and observe the output. This helps verify that your toolchain and workspace respond correctly to code and config changes.

With your first Zephyr application successfully built, you're ready to take the next step—debugging. In the next module, you'll launch a debug session, set breakpoints, and perform memory analysis using Zephyr Workbench. These skills help you validate and optimize applications running on real Arm Cortex-M hardware.
With your first Zephyr application successfully built, you're ready to take the next step—debugging. In the next module, you'll launch a debug session, set breakpoints, and perform memory analysis using Workbench for Zephyr. These skills help you validate and optimize applications running on real Arm Cortex-M hardware.
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ layout: learningpathall

## Analyze and debug Zephyr applications in VS Code

In this module, you'll learn how to inspect memory usage and perform live debugging on your Zephyr applications using Zephyr Workbench. These capabilities are essential for diagnosing bugs and optimizing embedded firmware performance on Arm Cortex-M platforms.
In this module, you'll learn how to inspect memory usage and perform live debugging on your Zephyr applications using Workbench for Zephyr. These capabilities are essential for diagnosing bugs and optimizing embedded firmware performance on Arm Cortex-M platforms.

## Analyze memory usage

Understanding how your application uses memory is crucial for optimizing embedded firmware on resource-constrained Arm Cortex-M systems. Zephyr Workbench provides built-in tools to generate detailed memory usage reports after a successful build, helping you identify ROM and RAM consumption hotspots early in development.
Understanding how your application uses memory is crucial for optimizing embedded firmware on resource-constrained Arm Cortex-M systems. Workbench for Zephyr provides built-in tools to generate detailed memory usage reports after a successful build, helping you identify ROM and RAM consumption hotspots early in development.

### Generate memory reports

After building your Zephyr application, analyze how memory is allocated and used. Zephyr Workbench offers built-in memory reporting tools that help you visualize RAM and ROM usage, identify inefficient memory patterns, and guide optimization efforts. These insights are especially useful when working with constrained Arm Cortex-M platforms.
After building your Zephyr application, analyze how memory is allocated and used. Workbench for Zephyr offers built-in memory reporting tools that help you visualize RAM and ROM usage, identify inefficient memory patterns, and guide optimization efforts. These insights are especially useful when working with constrained Arm Cortex-M platforms.

To generate memory reports, open the **Zephyr Workbench** panel and select **Memory Analysis** after a successful build. The tool generates detailed reports showing RAM usage (stack, heap, static variables), ROM usage (code size, constants), and **Puncover** analysis for binary analysis including function size, call graphs, and timing on Arm Cortex-M processors.

The following steps show how to generate and review memory reports:

- Open the **Zephyr Workbench** panel
- Open the **Workbench for Zephyr** panel
- Select **Memory Analysis** after a successful build
- Review detailed memory reports:
- **RAM usage**: stack, heap, static variables
Expand Down Expand Up @@ -159,22 +159,22 @@ Root
```


## Install and configure debug tools
## Install and configure debug Runners

Depending on your board, different debug utilities might be required. Zephyr Workbench integrates several common runners:

Go to **Host Tools > Install Debug Tools** in Zephyr Workbench. Debug tools vary depending on your target board.
Depending on your board, different debug utilities may be required. Workbench for Zephyr integrates and discovers several common runners:

- **OpenOCD**: Generic open-source debugger
- **LinkServer**: For NXP targets
- **STM32CubeProgrammer**: For STM32 boards
- **J-Link**: For SEGGER debug probes

### Install debug utilities
Workbench for Zephyr will automatically detect these tools when they are installed in their default locations and available on your system `PATH`. If a tool is installed in a custom location, you can either update your `PATH` or configure your environment so that Workbench for Zephyr can find it.

### Install Runners Utilities

To install debug tools for your specific board, go to **Host Tools > Install Debug Tools** in the Zephyr Workbench panel and select the tools applicable to your board.

![Debug Tools](images/install_debug_tools.png)
![Debug Runners](images/install_runners.png)

## Configure debug settings

Expand All @@ -193,15 +193,15 @@ Choose the runner from OpenOCD, J-Link, LinkServer, or PyOCD. If the system does

### Manual debug runner configuration

If Zephyr Workbench doesn't automatically detect the installed debug runner, open the **Debug Manager** from the sidebar and locate your board profile to enter the path to the runner executable manually.
If Workbench for Zephyr doesn't automatically detect the installed debug runner, open the **Debug Manager** from the sidebar and locate your board profile to enter the path to the runner executable manually.

{{% notice Note %}}
Manual configuration might be required on first-time setups or if using custom runner versions.
{{% /notice %}}

## Launch and use the debugger

You can start debugging from Zephyr Workbench by selecting **Debug**, or from VS Code by going to **Run and Debug** (`Ctrl+Shift+D`), selecting the debug config, and selecting **Run**.
You can start debugging from Workbench for Zephyr by selecting **Debug**, or from VS Code by going to **Run and Debug** (`Ctrl+Shift+D`), selecting the debug config, and selecting **Run**.

![Debug Application](images/debug_app.png)

Expand All @@ -222,4 +222,4 @@ The debugger provides comprehensive inspection capabilities including breakpoint

If using `pyocd`, target support might take a few seconds to initialize.

In this Learning Path, you explored how to analyze memory usage and debug Zephyr applications using Zephyr Workbench in VS Code. You learned to generate memory reports, install and configure debug tools, and launch interactive debug sessions. These steps help you troubleshoot and optimize embedded applications for Arm Cortex-M boards.
In this Learning Path, you explored how to analyze memory usage and debug Zephyr applications using Workbench for Zephyr. You learned to generate memory reports, install and configure debug tools, and launch interactive debug sessions. These steps help you troubleshoot and optimize embedded applications for Arm Cortex-M boards.
Loading