Workbench for Zephyr

Workbench for Zephyr is a Visual Studio Code (VS Code) extension that adds Zephyr development support, including SDK management, project creation wizard, build/flash, and debugging.

Check the Getting started tutorial for a walkthrough.

Key features

  • Install native Host Tools (Python, CMake, …)

  • Install and assign toolchains (Zephyr SDK, IAR, …)

  • Import West workspaces

  • Create and import Zephyr applications

  • Build and flash applications

  • Debug applications

  • Install runners automatically

  • Perform memory and static analysis

Compatibility

  • Windows 10-11

  • Linux (x86_64)

    • Ubuntu

    • Debian

    • Fedora

    • Other distributions may also work (not tested)

  • macOS

Getting started

  1. Install the extension

    Install Workbench for Zephyr from the VS Code Marketplace.

  2. Open the Workbench for Zephyr extension

    In the Activity Bar, click the Workbench for Zephyr icon.

  3. Install Host Tools

    Click Install Host Tools to download and install the native tools (typically into ${HOME}/.zinstaller).

    Installing Host Tools in Workbench for Zephyr

    Note

    Some host tools may require administrator privileges. On Windows, this is required when installing 7z. On Linux, this is required when installing tools using the package manager, for example when running apt install.

  4. Import a toolchain

    Click Import Toolchain, choose a toolchain, and select the destination folder.

    A toolchain provides the compiler and debugger required to build and debug Zephyr applications. The Zephyr SDK is the recommended option and can be installed as either the full package or a minimal target-specific version. Workbench also supports other toolchains, such as IAR.

  5. Initialize / Import a West workspace

    Click Initialize workspace and fill the workspace information.

    Initializing a West workspace in Workbench for Zephyr

    Workbench will create the workspace and parse the west manifest to configure projects.

  6. Create a new application

    On Workbench for Zephyr, new projects are based on samples from Zephyr sources.

    • Click Create New Application.

    • Select the West Workspace to attach to.

    • Select the Zephyr SDK to use.

    • Select the target Board (for example, ST STM32F4 Discovery).

    • Select the Sample project to base on (for example, hello_world).

    • Enter the project name.

    • Enter the project location.

    Creating a new application from a sample in Workbench for Zephyr
  7. Build the application

    Click Build in the status bar, or select the application folder to build. Build output is shown in the integrated terminal.

  8. Configure and run a debug session

    Use Debug Manager to generate/update a debug configuration (.vscode/launch.json):

    • Generated ELF (Program Path)

    • SVD file (optional)

    • GDB/port/address (if needed)

    • Debug server/runner (OpenOCD, J-Link, LinkServer, pyOCD, …)

    Debug Manager in Workbench for Zephyr

    Then start debugging normally via Run and Debug

Install Runners

Workbench for Zephyr can provide installers for some runners (for example, OpenOCD and STM32CubeProgrammer). Use Install Runners to view supported tools and install them (or open the vendor website).