|
1 | 1 | --- |
2 | | -title: Install and configure Workbench for Zephyr in VS Code |
| 2 | +title: Set up your environment |
3 | 3 | weight: 2 |
4 | 4 |
|
5 | 5 | ### FIXED, DO NOT MODIFY |
6 | 6 | layout: learningpathall |
7 | 7 | --- |
8 | 8 |
|
9 | | -## Set up your Zephyr development environment |
| 9 | +## The benefits of using Workbench for Zephyr Visual Code extension |
10 | 10 |
|
11 | | -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. |
| 11 | +Getting started with [Zephyr](https://zephyrproject.org/) RTOS development can be challenging. You often need to install SDKs, set up toolchains, and organize workspace directories by hand. The process is different for each operating system and board vendor, which can make setup confusing and lead to errors. |
12 | 12 |
|
13 | | -[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. |
| 13 | +[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. |
14 | 14 |
|
15 | | -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. |
| 15 | +In this Learning Path, you'll set up Workbench for Zephyr and configure a complete development environment on your computer. By the end, you can create, build, and debug applications for Arm Cortex-M boards using Zephyr RTOS. |
16 | 16 |
|
17 | | -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. |
| 17 | +Workbench for Zephyr makes it easy to set up your development environment with a single click. It automatically installs all the tools you need, such as Python, CMake, Ninja, and Git. You can import and manage different versions of the Zephyr SDK, choose the right architecture, and quickly initialize West workspaces. The extension lets you create board-specific applications from sample projects, build and flash them to your hardware, and debug your code, all within Visual Studio Code. You also get features like breakpoint debugging and memory usage insights when using a supported hardware probe. |
18 | 18 |
|
19 | | -## What you need before installing Workbench for Zephyr |
| 19 | +## Install dependencies |
20 | 20 |
|
21 | | -To get started with Workbench for Zephyr you need to have Visual Studio Code downloaded, installed, and running on your computer. |
| 21 | +To get started with Workbench for Zephyr, you need to have Visual Studio Code downloaded, installed, and running on your computer: |
22 | 22 |
|
23 | | -**Windows OS:** |
| 23 | + |
| 24 | +### Windows |
24 | 25 | For Windows, you need version 10 or later (64-bit x64), along with administrator privileges for installing runners and drivers. |
25 | 26 |
|
26 | | -**MacOS:** |
27 | | -On MacOS, the Homebrew package manager is required. To install Homebrew, run the following command: |
| 27 | +### macOS |
| 28 | +On macOS, the Homebrew package manager is required. To install Homebrew, run the following command: |
28 | 29 |
|
29 | 30 | ```bash |
30 | 31 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" |
31 | 32 | ``` |
32 | 33 |
|
33 | | -**Linux:** |
34 | | -- A recent 64-bit X64 distribution such as Ubuntu 20.04 or later, Fedora, Clear Linux OS, or Arch Linux |
35 | | -- Other distributions might work, but may require manual configuration of system packages |
36 | | -- After installation, use the Workbench host tools manager to verify that all required tools were installed correctly |
| 34 | +### Linux |
| 35 | +To use Workbench for Zephyr on Linux, install a recent 64-bit distribution such as Ubuntu 20.04 or later, Fedora, Clear Linux OS, or Arch Linux. Other distributions can work, but you might need to manually configure some system packages. After installing your operating system, use the Workbench host tools manager to check that all required tools are installed correctly. |
37 | 36 |
|
38 | 37 |
|
39 | 38 | 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. |
40 | 39 |
|
41 | | -## Configure the Workbench for Zephyr extension in Visual Studio Code |
42 | | - |
43 | | -This section covers installing the Zephyr Workbench extension and configuring your Arm development environment. |
44 | | - |
45 | | -### Install the extension |
| 40 | +## Install and configure the Zephyr Workbench extension |
46 | 41 |
|
47 | | -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. |
| 42 | +This section covers installing the Workbench for Zephyr extension and configuring your Arm development environment. |
48 | 43 |
|
49 | | -You can also use the keyboard shortcut `Ctrl+Shift+X` (Windows/Linux) or `Cmd+Shift+X` (macOS). |
| 44 | +To install the Workbench for Zephyr extension, open **Visual Studio Code**. In the **Activity Bar**, select the **Extensions** icon to open the **Extensions view**. |
50 | 45 |
|
51 | | -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. |
| 46 | +You can also use the keyboard shortcut **Ctrl+Shift+X** on Windows or Linux, or **Cmd+Shift+X** on macOS. |
52 | 47 |
|
53 | | -The extension icon appears in the Activity Bar, and a welcome message may appear confirming successful installation. |
| 48 | +In the search box, enter `Workbench for Zephyr`. Locate the official extension by **Ac6** and select **Install**. |
54 | 49 |
|
55 | | -Once installed, the Workbench for Zephyr icon appears in the sidebar with a welcome screen. |
| 50 | +After installation, the Workbench for Zephyr icon appears in the **Activity Bar**. A welcome screen confirms that the extension is ready to use. |
56 | 51 |
|
57 | | -### Install the required host tools |
| 52 | +## Install the required host tools |
58 | 53 |
|
59 | 54 | In the Workbench for Zephyr panel, select **Install Host Tools** to automatically install the required dependencies. |
60 | 55 |
|
61 | 56 | This process installs Python 3.x, CMake, the Ninja build system, Git, Device Tree Compiler (DTC), and the West meta-tool. |
62 | 57 |
|
63 | | - |
| 58 | + |
64 | 59 |
|
65 | 60 | {{% notice Note %}} |
66 | | -On Windows, you may be prompted for permission when tools are executed. Select "Allow" when requested. |
67 | | -{{% /notice %}} |
| 61 | +On Windows, you might see permission prompts when Workbench for Zephyr installs or runs tools. Select **Allow** to continue with the setup.{{% /notice%}} |
| 62 | + |
| 63 | +When the installation completes, select **Verify Host Tools** to confirm that each required package is installed and up to date. The panel displays the version and status for Python, CMake, Ninja, Git, and Device Tree Compiler. If any tool is missing or out of date, follow the prompts to resolve the issue before continuing. |
| 64 | +## Import and configure the Zephyr toolchain |
| 65 | + |
| 66 | +To build and debug Zephyr applications for Arm Cortex-M boards, you need to import and configure the Zephyr toolchain using Workbench for Zephyr. |
68 | 67 |
|
69 | | -When the installation completes, select **Verify Host Tools** to check the version of each installed package. |
| 68 | +In the Workbench for Zephyr panel, select **Import Toolchain**. This opens a guided setup panel. |
70 | 69 |
|
71 | | -### Import and configure the toolchain |
| 70 | +In the **Import Toolchain** panel, configure the following options to set up your Zephyr toolchain for Arm development: |
72 | 71 |
|
73 | | -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. |
| 72 | +- **Toolchain Family**: select *Zephyr SDK* to use the official Zephyr toolchain. |
| 73 | +- **SDK Type**: select *Minimal* to install only the essential components needed for development. |
| 74 | +- **Version**: select the Zephyr SDK release you want to use, such as v0.17.0 or v0.17.3. |
| 75 | +- **Target Architectures**: select *arm* to target Arm-based boards. |
74 | 76 |
|
75 | | -Select your desired version (such as v0.17.4... your version may vary a little) and choose the target architectures. For this Learning Path, you only need to select *arm*. |
| 77 | +These settings ensure your environment is optimized for Arm Cortex-M development. After configuring these options, continue with the import process to download and install the selected SDK. |
76 | 78 |
|
77 | | -Specify the parent directory for SDK installation and select **Import** to download and install the SDK. |
| 79 | +Next, specify the directory where you want to install the SDK. Select **Import** to start the download and installation process. When the import completes, the panel displays a confirmation that the toolchain is ready. |
78 | 80 |
|
79 | | - |
| 81 | +If you see errors during import, check your internet connection and confirm you have at least 2 GB of free disk space. For more troubleshooting tips, review the extension's documentation or check the Visual Studio Code output panel. |
80 | 82 |
|
81 | 83 |
|
82 | | -### Initialize the Zephyr project workspace |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +## Initialize the Zephyr project workspace |
83 | 88 |
|
84 | 89 | 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. |
85 | 90 |
|
86 | | -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`. |
| 91 | +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`. |
87 | 92 |
|
88 | 93 | Choose a target-specific template (such as STM32 or NXP) and select your Zephyr version (such as v4.3.0... your version may vary a bit). Specify the directory for your workspace, keeping in mind that initialization takes approximately 10 minutes to complete. |
89 | 94 |
|
90 | 95 | Select **Import** to create and update the workspace. |
91 | 96 |
|
92 | | - |
| 97 | + |
93 | 98 |
|
94 | 99 | {{% notice Note %}} |
95 | | -The workspace initialization downloads the Zephyr source code and dependencies. This process may take several minutes depending on your internet connection speed. |
96 | | - |
97 | | -Additionally, the selected revision you select may be a bit different from the one shown above. |
| 100 | +The workspace initialization downloads the Zephyr source code and dependencies. This process can take several minutes depending on your internet connection speed. |
98 | 101 | {{% /notice %}} |
99 | 102 |
|
100 | | -### Verify setup |
| 103 | +## Verify setup |
101 | 104 |
|
102 | 105 | 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. |
| 106 | +{{% notice Troubleshooting Tips %}} If you have trouble installing host tools on Windows, try running Visual Studio Code as an administrator. Make sure your firewall allows internet access so dependencies can download. Before importing the SDK, confirm you have at least 2 GB of free disk space.{{% /notice %}} |
103 | 107 |
|
104 | | -{{% notice Note %}} |
105 | | -**Troubleshooting tips:** |
106 | | -- Run VS Code as Administrator if host tool installation fails on Windows |
107 | | -- Ensure internet access is allowed through your firewall |
108 | | -- Check for minimum 2 GB free disk space before importing SDK |
109 | | -{{% /notice %}} |
110 | | - |
111 | | -You're ready to create and build your first Zephyr application targeting an Arm Cortex-M board. |
| 108 | +You're now ready to create and build your first Zephyr application targeting an Arm Cortex-M board. |
0 commit comments