Skip to main content
The Edge Impulse Zephyr Module Deployment introduces a new way to integrate your Edge Impulse project and SDK directly into Zephyr Applications, removing manual setup steps and enabling deployment across more than 850 supported hardware targets.
Select Zephyr library in Edge Impulse Deployment tab

Choose Zephyr Library Deployment in Edge Impulse

For more on the Zephyr module system and how it differs from west projects, see the official Zephyr modules documentation By the end of this guide, you will be able to:
  • Set up a Zephyr project with the Edge Impulse SDK as a Zephyr module.
  • Deploy your trained Edge Impulse model as a Zephyr library.
  • Use custom West commands for streamlined Edge Impulse workflows.
To get started quickly, you can clone and initialize the example standalone inferencing project with the Edge Impulse SDK Zephyr module included, and it will pull in all required dependencies with west (the Zephyr meta-tool):
west init -m https://github.com/edgeimpulse/example-standalone-inferencing-zephyr-module
Your development environment should look similar to this by the end of the guide:
Zephyr Workspace

Edge Impulse Zephyr Module, Workspace and sample project

Deploying to a device will look like this:
west flash
Inference results

Flash with programmer

View inference results:
Inference results

Inference results

Let’s get started.

Prerequisites

Make sure you’ve followed one of the tutorials and have a trained impulse. For the purpose of this tutorial, we’ll assume you trained a Continuous motion recognition model. Also install the following software:
  • Edge Impulse CLI.
  • Choose and set up your Zephyr-compatible hardware. You can find a list of supported boards in the Zephyr documentation.
  • Install Zephyr or Nordic (for nRF based devices) NCS and its dependencies:
    • Zephyr SDK: Follow the Zephyr getting started guide to install the Zephyr SDK and set up your environment. We also recommend following their Blinky tutorial to verify your setup.
    • Nordic NCS : Depending on your target hardware, you may need to install additional toolchains. For Nordic Semiconductor boards, follow the Nordic NCS installation guide.
  • West : West is the meta-tool used to manage Zephyr projects and their dependencies. Install it using pip: pip install -U west

Quick Start (5-10 minutes)

This guide is quite long, so here is a quick summary of the steps to get started with the Edge Impulse Zephyr module and command extensions.

Command Extension Architecture

# 1. Initialize project
west init -m https://github.com/edgeimpulse/example-standalone-inferencing-zephyr-module
cd example-standalone-inferencing-zephyr-module
west update

# 2. Build model in Studio and download
west ei-build -k ei_abc123... -p 12345
west ei-deploy -k ei_abc123... -p 12345
unzip ei_model.zip -d ./model

# 3. Build firmware and flash
west build -b nrf52840dk_nrf52840 --pristine
west flash
For detailed explanations, continue reading below. Used versions for the development of the example project are as follows:
  • ZEPHYR_SDK_VERSION =0.17.4
  • west version = “1.5.0”
  • zephyr main repo: v3.7.1

Zephyr Modules

Zephyr applications can import additional functionality through modules, which are managed by the west tool.
The Edge Impulse SDK is distributed as a Zephyr module so it can be seamlessly pulled into your project.
Using the Zephyr module has several benefits over manually copying the C++ library:
  • Automatic updates: Easily update to the latest SDK version with west update.
  • Cleaner integration: No need to manage third-party source code directly.
  • Native Zephyr build support: The SDK is recognized as a standard module within the Zephyr ecosystem.

Edge Impulse Zephyr Module

Whether starting from scratch or adding Edge Impulse to an existing Zephyr app, you can get up and running in minutes.

Deploy your impulse as a Zephyr library

Select Zephyr library in Edge Impulse Deployment tab

Choose Zephyr Library Deployment in Edge Impulse

Manual Deployment via Studio

Head over to your Edge Impulse project:
  1. Go to the Deployment tab.
  2. Select Zephyr Module as the target.
  3. Click Build to generate the library.
This creates a .zip archive containing your impulse and all required libraries.
Zephyr library build options and EON compiler selection

Review Model Settings and Export

Automated Deployment with West Commands (Early Access Preview)

The Edge Impulse Zephyr module includes custom West extension commands that integrate directly with Edge Impulse Studio APIs for streamlined model deployment workflows.

west ei-build - Build your model in Studio

Use west ei-build to trigger a new build of your Edge Impulse model deployment in Studio:
# Build the latest model configuration from your Edge Impulse project
west ei-build -k ei_abc123... -p 12345

# With optional parameters
west ei-build -k ei_abc123... -p 12345 -e tflite-eon -t int8 -i 1
Required arguments:
  • -k, --api-key - Your Edge Impulse API key
  • -p, --project - Your Edge Impulse project ID (integer)
Optional arguments:
  • -i, --impulseid - Specific impulse ID to build (default: 1)
  • -e, --engine - Build engine: tflite or tflite-eon (default: tflite-eon)
  • -t, --modeltype - Model type: int8 or float32 (default: int8)
This command:
  • Calls the Edge Impulse Build On-Device Model API
  • Triggers a fresh build of your Zephyr library deployment in Studio
  • Waits for the build to complete
  • Useful when you’ve made changes to your impulse configuration
This command builds your model in Edge Impulse Studio, not locally. It’s equivalent to clicking “Build” in the Deployment tab.

west ei-deploy - Download deployment artifacts

Use west ei-deploy to download your pre-built Edge Impulse model deployment:
# Download the latest built model from your Edge Impulse project
west ei-deploy -k ei_abc123... -p 12345

# With optional parameters
west ei-deploy -k ei_abc123... -p 12345 -e tflite-eon -t int8 -i 1

# The zip file is downloaded as ei_model.zip
# Extract it to the model/ directory
unzip ei_model.zip -d ./model
Required arguments:
  • -k, --api-key - Your Edge Impulse API key
  • -p, --project - Your Edge Impulse project ID (integer)
Optional arguments:
  • -i, --impulseid - Specific impulse ID to download (default: 1)
  • -e, --engine - Build engine: tflite or tflite-eon (default: tflite-eon)
  • -t, --modeltype - Model type: int8 or float32 (default: int8)
This command:
  • Calls the Edge Impulse Download Deployment API
  • Downloads the latest Zephyr library deployment as ei_model.zip
  • You must manually extract it to the model/ directory
You can find your API key in Edge Impulse StudioDashboardKeys.
Your project ID is visible in the URL: studio.edgeimpulse.com/studio/12345

Complete workflow example

Here’s a typical development workflow using the extension commands:
# 1. Initialize your project
west init -m https://github.com/edgeimpulse/example-standalone-inferencing-zephyr-module
cd example-standalone-inferencing-zephyr-module
west update

# 2. Build your model in Studio (if you made impulse changes)
west ei-build -k ei_abc123... -p 12345

# 3. Download the built model
west ei-deploy -k ei_abc123... -p 12345

# 4. Extract the model to the model/ directory
unzip ei_model.zip -d ./model

# 5. Build firmware locally
west build -b nrf52840dk_nrf52840 --pristine

# 6. Flash to device
west flash

Updating your model

Option A: Use existing Studio build If you already built your model in Studio (via Deployment tab):
# Download the latest deployment
west ei-deploy -k ei_abc123... -p 12345

# Extract to model directory
unzip ei_model.zip -d ./model

# Build and flash firmware
west build --pristine
west flash
Option B: Build in Studio first If you made changes to your impulse configuration:
# Trigger a new build in Studio
west ei-build -k ei_abc123... -p 12345

# Download the new build
west ei-deploy -k ei_abc123... -p 12345

# Extract to model directory
unzip ei_model.zip -d ./model

# Build and flash firmware
west build --pristine
west flash
Always use --pristine when building firmware after deploying a new model to ensure a clean build with the updated artifacts.

Build vs Deploy - When to use which?

CommandPurposeWhen to useAPI Called
west ei-buildBuild model in StudioAfter changing impulse configuration/jobs/build-on-device-model
west ei-deployDownload pre-built modelAfter Studio build completes/deployment/download
Typical workflow: Make changes in Studio → west ei-build -k KEY -p IDwest ei-deploy -k KEY -p IDunzip ei_model.zip -d ./modelwest build --pristinewest flashQuick workflow: If model is already built in Studio → west ei-deploy -k KEY -p IDunzip ei_model.zip -d ./modelwest build --pristinewest flash

Advanced: Using environment variables

West extension commands don’t support environment variables directly, but you can create shell aliases:
# Add to your ~/.bashrc or ~/.zshrc
export EI_API_KEY=ei_abc123...
export EI_PROJECT_ID=12345

# Create aliases
alias ei-build='west ei-build -k $EI_API_KEY -p $EI_PROJECT_ID'
alias ei-deploy='west ei-deploy -k $EI_API_KEY -p $EI_PROJECT_ID'

# Now use simplified commands
ei-build
ei-deploy
unzip ei_model.zip -d ./model
Security Note: Never commit API keys to version control. Store them in environment variables or a .env file:
# .env (add to .gitignore)
export EI_API_KEY=ei_abc123...
export EI_PROJECT_ID=12345

# Load in your shell
source .env
This project differs from our example-standalone-inferencing-zephyr because it uses the Edge Impulse SDK Zephyr module and Zephyr library deployment for the model, instead of copying the C++ library export.
However, if you’d like to see complete reference Zephyr examples with full sensor integrations, check out our official Nordic Semiconductor firmware repositories:

Using the Edge Impulse Zephyr module

As we have already deployed our model as a Zephyr library (either manually or using west ei-deploy), we can now use it in our example project or integrate it into our own Zephyr project. To use the Edge Impulse SDK in your own Zephyr project, you need to add it as a module dependency. There are two ways to do this - see “Integrate into Existing Project” below:
We are going to explain how you can integrate your model with the Edge Impulse SDK Zephyr module in a standalone example project.Navigate to your Zephyr workspace and clone the example project:
# Create a new directory for your Zephyr project Workspace
mkdir zephyrproject 
cd zephyrproject 
To set up the project and fetch all required modules, run:
# Initialize west with the example project manifest
west init -m https://github.com/edgeimpulse/example-standalone-inferencing-zephyr-module
cd example-standalone-inferencing-zephyr-module
west update

Add the model to your project

Your project structure should now look like this:
Model placed in the Zephyr project directory

Place model in the project directory

Test with sample features from the Live classification page

To do this, first head back to the studio and click on the Live classification tab. Then load a validation sample, and click on a row under ‘Detailed result’.

Selecting the row with timestamp '320' under 'Detailed result'.

To verify that the local application classifies the same result, we need the raw features for this timestamp. To do so click on the ‘Copy to clipboard’ button next to ‘Raw features’. This will copy the raw input values from this validation file, before any signal processing or inferencing happened.

Copying the raw features.

Next, update the sample you want to test in main.cpp:
nano src/main.cpp
Paste the copied features into the features array:
static const float features[] = {
    // copy raw features here (for example from the 'Live classification' page)
    // see https://docs.edgeimpulse.com/docs/running-your-impulse-locally-zephyr
};
Adding features and run_classifier() call in main.cpp

Add Test Features in main.cpp

Compile and flash

Quick workflow: Use the West extension commands for the most efficient development cycle. See the West Extension Commands section above.
Run the following commands to compile and flash your application:
west build output showing Edge Impulse SDK compilation

Build the Zephyr Firmware

Build the project

Here you can specify the board you want to test by modifying .west/config or by building with west:

Specify the board

cd your_zephyr_project
nano .west/config
Specify the board you want to test by modifying .west/config. Add your board name under the [build] section:
[build]
board = <your_board>

### example boards: 
### Arduino
#board = arduino_nano_33_ble
###STM32 Nucleo U585ZI Q
#board = nucleo_u585zi_q
# Renesas RA6M5 Evaluation Kit
#board = ek_ra6m5
## Nordic Thingy:91
#board = thingy91_nrf9160ns
## Nordic nRF9160-DK
#board = nrf9160dk_nrf9160ns
## Nordic Thingy:53
#board = thingy53_nrf5340_cpuapp
## Nordic nRF7002-DK
#board = nrf7002dk_nrf5340_cpuapp
## Arduino Opta
#board = arduino_opta
## Arduino Portenta H7
#board = arduino_portenta_h7_m7
## Arduino Nicla Vision
#board = arduino_nicla_vision
## M5Stack Core2
#board = m5stack_core2
## Silicon Labs EFR32MG24
#board = efr32mg24_brd4186c
Then build the project with:
west build --pristine
Inference results

Build a clean version

Then flash with:
west flash
Optionally, you can also flash using a programmer specific to your board. For example, with Nordic nRF-based boards, you can use nrfjprog:
west flash --runner nrfjprog
For Silicon Labs boards, use J-Link:
west flash --runner jlink
Inference results

Flash with programmer

View inference results

Inference results

Inference results

You now have standalone inferencing with Edge Impulse on Zephyr!

Troubleshooting

If you encounter issues with west or Zephyr, ensure you have the required dependencies installed. You can install them using pip:
pip install -U west
pip install -U -r https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/main/scripts/requirements.txt

Common Issues

Symptoms:
west: unknown command "ei-build"; workspace does not define this extension command
Solutions:
  1. Run from the manifest repository directory:
# Wrong - from workspace root
cd /path/to/zephyrproject
west ei-build  # ❌ Fails

# Correct - from manifest repository
cd /path/to/zephyrproject/your-project-name
west ei-build  # ✅ Works
  1. Enable extension commands:
west config --local commands.allow_extensions true
  1. Verify your west.yml includes west-commands registration:
- name: edge-impulse-sdk-zephyr
  path: modules/edge-impulse-sdk-zephyr
  revision: v1.80.0
  url: https://github.com/edgeimpulse/edge-impulse-sdk-zephyr
  west-commands: scripts/west-commands.yml  # Required!
  1. Update workspace:
west update
west help  # Verify ei-build and ei-deploy appear
Cause: Invalid API key or project IDSolution:
  • Verify your API key in Edge Impulse Studio → Dashboard → Keys
  • Ensure your project ID matches the URL: studio.edgeimpulse.com/studio/YOUR_ID
  • Check API key has deployment permissions
  • Use correct flags: -k for API key, -p for project ID
Cause: Studio build is taking longer than expectedSolution:
  • Large models may take several minutes to build
  • Check build status in Edge Impulse Studio → Deployment tab
  • The command will wait for build completion
Cause: Studio has a cached buildSolution:
# Force a fresh build first
west ei-build -k ei_abc123... -p 12345
# Then download
west ei-deploy -k ei_abc123... -p 12345
# Extract
unzip ei_model.zip -d ./model
Cause: Forgot to extract ei_model.zipSolution:
# After downloading
west ei-deploy -k ei_abc123... -p 12345

# Extract to model directory
unzip ei_model.zip -d ./model

# Verify model/ contains:
ls model/
# Should see:
# - CMakeLists.txt
# - model-parameters/
# - tflite-model/
# - zephyr/

Next Steps

Summary

By packaging the Edge Impulse SDK and your model as a Zephyr module, you gain native integration within Zephyr’s build system. The custom West extension commands (west ei-build and west ei-deploy) further streamline your development workflow, making it easier to iterate on your machine learning models directly from the command line. This modular approach makes your firmware easier to maintain, update, and scale across 850+ supported boards. By packaging the Edge Impulse SDK and your model as a Zephyr module, you gain native integration within Zephyr’s build system.
This modular approach makes your firmware easier to maintain, update, and scale across supported boards.