Getting Started with Zephyr

Last Modified: Aug 1, 2025Supports Zephyr™ OS for Edge Connected Devices

Contents of this document

  • 1

    Set it up
  • 2

    Build, Run
  • 3

    Create
  • 4

    Developer Experience

1. Set it up

1.1 Preparing Zephyr Environment

Welcome, in this video, we’ll walk you through the essential steps to get your Zephyr development environment up and running on a Windows operating system using Visual Studio Code and the MCUXpresso extension.

The goal is to make setup quick and easy, so you can start developing your application today—without getting bogged down in the details.

  1. Download and Install Visual Studio Code
    Get the latest version of VS Code for Windows.
  2. Install the MCUXpresso Extension for VS Code
    Add NXP’s official extension to enable embedded development features.
  3. Run the MCUXpresso Installer
    Use the installer to set up the SDK, toolchain and environment.
  4. Install the Zephyr Repository
    Clone and configure the Zephyr repo to complete your setup.
  5. Install MCUXpresso Config Tools
    Pin tool support for Zephyr is available for version 25.03 and higher.
  6. Install MCUXpresso Secure Provisioning Tool

1.2 Install Your Toolchain

NXP offers a complimentary extension for VSCode called MCUXpresso for VS Code. Download VS Code to access the extension library.

Visual Studio Code

Get VS Code

Learn how to install VS Code for your host PC with the following tutorial.

1.3 Jump Start Your Design with Zephyr Developer

The MCUXpresso Installer includes an option called the 'Zephyr Developer', this option will download all necessary components, tools and dependencies needed in addition to the Zephyr SDK. The Zephyr Software Development Kit (SDK) contains toolchains for each of Zephyr’s supported architectures, which include a compiler, assembler, linker and other programs required to build Zephyr applications.

Find the MCUXpresso Installer inside the "Quickstart Panel" of the MCUXpresso for VSCode.

GS-ZEPHYR-IMG1.3

1.4 MCUXpresso Config Tools

The MCUXpresso Config Tool is an integrated suite of configuration tools that guides users in creating new MCUXpresso SDK projects, and also provides pin and clock tools to generate initialization C code for custom board support. The Pins Tool has a GUI to help select all the desired signals used by the application, and configure the pinmux and pin settings. Starting with release v25.03, the Config Tool can generate Zephyr board pinctrl files for the i.MX RT1xxx and MCX devices. Zephyr uses pinctrl to configure the pins and pinmux settings of an SOC.

Click the Get MCUXpresso Config Tools below to get the Config Tools installer.

MCUXpresso Config Tools

Get MCUXpresso Config Tools

1.5 Programming and Provisioning Tools

The MCUXpresso Secure Provisioning (SEC) Tool is a GUI-based application provided to simplify the generation and provisioning of bootable executables on NXP MCU devices. We recommend all users to begin with the MCUXpresso Secure Provisioning (SEC) tool for trial run and mass production use. It supports secure programming and device provisioning on NXP's microcontrollers at the production stage. After downloading the tool, you can find the user guide under the ‘Help’ tab. Follow the instructions for your board in the ‘Processor-specific workflow’ chapter.

SEC

Download SEC

1.6 Get Familiar with MCUXpresso for VS Code

Key Features to Know in MCUXpresso for VS Code

When getting started with MCUXpresso for VS Code, it's helpful to be aware of a few key features and tools that will streamline your development experience. This section is meant to give you a high-level overview—not a deep dive—so you can get oriented quickly and explore further as needed.

Quickstart Panel

Your launchpad for creating, importing and managing projects. It provides shortcuts to common tasks. Here the most commonly used will be "Import Example from Repository" and "Open MCUXpresso Installer".

Projects View

This is where your workspace and project files are organized. Understanding how the zephyr projects are structured will help you navigate and manage your code more effectively.

Getting Started with Zephyr

Device Tree

The device tree describes the hardware layout and configuration.After compiling the Zephyr Project and refreshing the DEVICE TREE view, it will be populated with a tree-like view of the hardware hierarchy of the project. You can inspect the nodes and their associated values.

Getting Started with Zephyr

Pristine Build

Use this to clean and rebuild your project from scratch. It’s especially useful when switching configurations or resolving build issues.

Getting Started with Zephyr

Debug

MCUXpresso for VSCode integrates with various debuggers. Learn how to set breakpoints, step through code, and inspect variables to troubleshoot effectively.

Getting Started with Zephyr

Terminal and Serial Monitor

The terminal is designed to enable command-line interactions with the imported repositories. The serial terminal allows you to interact with your board via UART. Great for logging, debugging and real-time communication.

Getting Started with Zephyr

1.7 Preparing the Hardware

This guide will walk you through the steps to get started with Zephyr using the FRDM-MCXN947 board as an example. However, you can follow the same general process with a different evaluation board of your choice.

  1. Choose Your Evaluation Board

    While this guide uses the FRDM-MCXN947, you may substitute it with another supported board. Make sure to:

    • Confirm Zephyr support for your board
    • Check for any board-specific setup instructions
  2. Update On-Board Debugger Firmware

    Most evaluation boards come with an on-board debugger. To ensure compatibility and stability: Verify that your board’s debugger firmware is up to date.

    Download the latest firmware from the LinkServer firmware page. Choose the appropriate firmware type:

    • CMSIS-DAP
    • Segger J-Link

    If your board does not have an on-board debugger, connect an external debugger to your target board.

  3. Powering the Board>

    You’ll need to power your board during development. Common methods include:

    • USB cable (most common)
    • Barrel jack connector (for some boards)
  4. Plug in your board

2. Build, Run

In this section, you'll learn how to import and build a Blinky LED example for the FRDM-MCXN947 board using MCUXpresso for VS Code. This process will walk you through selecting the example, configuring the build, compiling the project, and flashing it to your board—all within the VS Code environment. By the end, you’ll have a working LED blink application running on your hardware, giving you a solid starting point for your own Zephyr-based projects.

You may follow the same steps using a different board. Check out the supported boards page.

2.1 Importing and Building a Zephyr Blinky Example

  1. Open VS Code and Launch MCUXpresso Extension
  2. Expand the MCUXpresso Quickstart Panel (usually on the left sidebar).

    Getting Started with Zephyr
  3. Import the Blinky Example
  4. In the dialog:

    • Repository: Select Zephyr Repository
    • Zephyr SDK: Choose latest version available
    • Board: FRDM-MCXN947 CPU0
    • Template: Blinky Sample
    • App Type: Freestanding application
    • Name: blinky
    • Location: C:\FreestandingZephyrProjects\
    • Click Import to import the project
    Getting Started with Zephyr
  5. Build the Project
  6. In the Projects View, right-click the imported project folder. Select "Pristine Build/Rebuild Project"

    You should see the build process complete successfully in the terminal output.

    Getting Started with Zephyr
  7. Debug the Board
  8. Connect your FRDM-MCXN947 via USB (Type-C). In the Projects View, right-click the imported project folder.

    Select "Debug". This will intiate a debug session, in which you can start the application, step over instructions, step into or out of functions, pause or exit the debug session.

    Pressing the "Play/Continue" button will execute the application. The LED on the board should start blinking.

    Getting Started with Zephyr

3. Create

3.1 Creating a New Configuration for Zephyr RTOS Using Device Tree Editor

  1. Launch the DeviceTree Editor on the bottom left side of the MCUXpresso extension in VSCode. Click on the refresh icon to load the configuration
  2. Getting Started with Zephyr
  3. Navigate to the 'alias' section
  4. When clicking a node or property, the MCUXpresso Device Tree viewer will open the source location where that node is defined or a property is set.

    Getting Started with Zephyr Getting Started with Zephyr
  5. Follow the alias to the actual LED node. In this example we see that led0 is led_3. Open the 'leds' section and click on led_3 to view the code
  6. Getting Started with Zephyr Getting Started with Zephyr
  7. This is where theGPIO 0 pin 10 is defined for the Red LED
  8. Getting Started with Zephyr
  9. Let's add an additional GPIO pin
  10. However, lets use a different pin that we can connect to an external LED, a voltmeter or an oscilloscope that we can use to visualize the LED blinking. In this example I'll use GPIO 0 pin15 which is routed to J4 pin10 of the arduino header on the FRDM-MCXN947.

    Getting Started with Zephyr
  11. Go back to the alias section and add an alias for reference on our new external pin
  12. Getting Started with Zephyr
  13. Go to the main.c source under the project files in the src folder and let's replace led0 with led3 which is our new external LED
  14. Getting Started with Zephyr
  15. Rebuild the project
  16. Now, before running you can see in the device tree viewer that the additions are now visible.

    Getting Started with Zephyr
  17. Debug or flash the device
  18. Connect an external LED, a multimeter or an oscilloscope on the pin of the board to verify that it is toggling on and off as expected.

4.Developer Experience

4.1 Zephyr Developer Experience

Zephyr Portability Featuring MCX and i.MX RT Series

This video highlights the portability benefits of Zephyr by demonstrating how it optimizes two distinct MCU architectures. Using a face detection demo, it runs on both the MCX N947, which features a neural processing unit and basic display, and the i.MX RT1060, which has a built-in display interface. The tutorial explains how platform abstraction is achieved, with the application remaining unchanged across both versions. Click the link for the full video.