Run your Edge Impulse model on any Zephyr-supported board using the new Zephyr Module Deployment, no manual SDK integration required.
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.
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 documentationBy 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):
Copy
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:
Edge Impulse Zephyr Module, Workspace and sample project
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:
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
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.
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.
Use west ei-deploy to download your pre-built Edge Impulse model deployment:
Copy
# Download the latest built model from your Edge Impulse projectwest ei-deploy -k ei_abc123... -p 12345# With optional parameterswest 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/ directoryunzip 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)
Here’s a typical development workflow using the extension commands:
Copy
# 1. Initialize your projectwest init -m https://github.com/edgeimpulse/example-standalone-inferencing-zephyr-modulecd example-standalone-inferencing-zephyr-modulewest update# 2. Build your model in Studio (if you made impulse changes)west ei-build -k ei_abc123... -p 12345# 3. Download the built modelwest ei-deploy -k ei_abc123... -p 12345# 4. Extract the model to the model/ directoryunzip ei_model.zip -d ./model# 5. Build firmware locallywest build -b nrf52840dk_nrf52840 --pristine# 6. Flash to devicewest flash
Option A: Use existing Studio buildIf you already built your model in Studio (via Deployment tab):
Copy
# Download the latest deploymentwest ei-deploy -k ei_abc123... -p 12345# Extract to model directoryunzip ei_model.zip -d ./model# Build and flash firmwarewest build --pristinewest flash
Option B: Build in Studio firstIf you made changes to your impulse configuration:
Copy
# Trigger a new build in Studiowest ei-build -k ei_abc123... -p 12345# Download the new buildwest ei-deploy -k ei_abc123... -p 12345# Extract to model directoryunzip ei_model.zip -d ./model# Build and flash firmwarewest build --pristinewest flash
Always use --pristine when building firmware after deploying a new model to ensure a clean build with the updated artifacts.
Typical workflow: Make changes in Studio → west ei-build -k KEY -p ID → west ei-deploy -k KEY -p ID → unzip ei_model.zip -d ./model → west build --pristine → west flashQuick workflow: If model is already built in Studio → west ei-deploy -k KEY -p ID → unzip ei_model.zip -d ./model → west build --pristine → west flash
West extension commands don’t support environment variables directly, but you can create shell aliases:
Copy
# Add to your ~/.bashrc or ~/.zshrcexport EI_API_KEY=ei_abc123...export EI_PROJECT_ID=12345# Create aliasesalias 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 commandsei-buildei-deployunzip ei_model.zip -d ./model
Security Note: Never commit API keys to version control. Store them in environment variables or a .env file:
Copy
# .env (add to .gitignore)export EI_API_KEY=ei_abc123...export EI_PROJECT_ID=12345# Load in your shellsource .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:
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:
Standalone Example Project
Integrate into existing Zephyr Project
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:
Copy
# Create a new directory for your Zephyr project Workspacemkdir zephyrprojectcd zephyrproject
To set up the project and fetch all required modules, run:
Copy
# Initialize west with the example project manifestwest init -m https://github.com/edgeimpulse/example-standalone-inferencing-zephyr-modulecd example-standalone-inferencing-zephyr-modulewest update
# Set your credentialsexport EI_API_KEY=ei_abc123...export EI_PROJECT_ID=12345# Build model in Studiowest ei-build -k $EI_API_KEY -p $EI_PROJECT_ID# Download the modelwest ei-deploy -k $EI_API_KEY -p $EI_PROJECT_ID# Extract to model directoryunzip ei_model.zip -d ./model
The model will be extracted to the model/ directory.
Download the model from Edge Impulse Studio:
Copy
# Go to the Deployment page of your Edge Impulse project.# Choose the Zephyr library option.# Extract the .zip in the project folder.mkdir -p modelunzip -o ~/Downloads/your_model.zip -d model
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:
Copy
nano src/main.cpp
Paste the copied features into the features array:
Copy
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};
Add Test Features in main.cpp
We are going to present two ways how you can integrate the module into your own Zephyr project. Update the west.yml file of your Zephyr main repository, or use this project as a manifest repository.
Add the following lines to your Zephyr repository’s west.yml, then call west update to download the SDK:Set SDK_VERSION to latest e.g. v1.75.4 see tags
Copy
- name: edge-impulse-sdk-zephyr path: modules/edge-impulse-sdk-zephyr revision: ${SDK_VERSION} # e.g., v1.75.4 see [tags](https://github.com/edgeimpulse/example-standalone-inferencing-zephyr-module/tags) url: https://github.com/edgeimpulse/edge-impulse-sdk-zephyr west-commands: scripts/west-commands.yml # Required for ei-build and ei-deploy commands
# From your project directory (manifest repo)cd example-standalone-inferencing-zephyr-module# Build model in Studiowest ei-build -k ei_abc123... -p 12345# Download the deploymentwest ei-deploy -k ei_abc123... -p 12345# Extract to model directoryunzip ei_model.zip -d ./model
Go to the Deployment page of your Edge Impulse project.Choose the Zephyr library option.Extract the .zip in your project folder:
Copy
mkdir -p modelunzip -o ~/Downloads/your_model.zip -d model
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.