Blog post

Announcing the Edge Impulse Zephyr Module

edge ai
By Eoin Jordan
Announcing the Edge Impulse Zephyr Module

The Edge Impulse Zephyr Module Deployment is a new way to integrate your Edge Impulse project and SDK directly into Zephyr, removing many manual setup steps and enabling deployment across 850 hardware targets.

The Zephyr Project is a Real-Time Operating System (RTOS) that has become one of the most flexible foundations for building embedded and IoT products, spanning everything from low-power sensor nodes to industrial gateways and connected wearables.

A small sample of the vast range of supported hardware

The Edge Impulse Zephyr Module Deployment improves the current Zephyr development experience; no manual SDK copies, no CMake edits, and no extra file management.

What is a Zephyr Module?

A Zephyr Module is a structured way to extend Zephyr RTOS with additional features or libraries, such as device drivers, middleware, or third-party SDKs. Modules are managed by the west tool and integrated automatically during the build process.

Edge Impulse Zephyr Module deployment option

Zephyr depends on several categories of modules, including but not limited to:

Why does this matter?

Until now, integrating Edge Impulse with Zephyr required manually exporting and copying the C++ SDK into your project.

With just one west command, you can install the Edge Impulse SDK, and keep it up to date:

west init -m https://github.com/edgeimpulse/example-standalone-inferencing-zephyr-module

With the new Zephyr Module approach and a single west command, you can:

Edge Impulse Zephyr Module

The Edge Impulse Zephyr Module is a externally maintained module that enables developers to:

Edge Impulse Zephyr Module — deployment contents

In short, it moves Edge Impulse from a manually copied C++ library into a first-class Zephyr component that behaves like any other dependency in your firmware.

Get started today

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

Starting from scratch: Clone the example project

We have created a example project to get started with which uses our traditional continuous motion gestures project. 

west init -m https://github.com/edgeimpulse/example-standalone-inferencing-zephyr-module

Use West to initialize the Edge Impulse Zephyr Module

Use west update to pull the latest

This command initializes the workspace from the example manifest and pulls in Zephyr along with the latest Edge Impulse SDK module.

Import the Edge Impulse SDK

There are different ways to import the Edge Impulse SDK Zepyhr module to be used with this project.

Option 1: Add to your Zephyr manifest (global settings)

Update the west.yml of your Zephyr repo adding the lines below for the SDK then call west update to download the SDK into your Zephyr repo.

Add the following lines to your Zephyr repo’s west.yml, then call west update to download the SDK:

- name: edge-impulse-sdk-zephyr
  path: modules/edge-impulse-sdk-zephyr
  revision: ${SDK_VERSION}
  url: https://github.com/edgeimpulse/edge-impulse-sdk-zephyr

Option 2: Add to your project manifest (local settings)

From the root of your project folder:

west init --local .
cd ..
west update

Again we need the edge-impulse-sdk-zephyr added to the west.yml

- name: edge-impulse-sdk-zephyr
  path: modules/edge-impulse-sdk-zephyr
  revision: ${SDK_VERSION}
  url: https://github.com/edgeimpulse/edge-impulse-sdk-zephyr

SDK_VERSION should match the tag of your chosen Edge Impulse SDK e.g. v1.75.4

west update

This will pull or update all required modules.

Now select one of the 850+ DevKits

You can preconfigure a chosen board or define one at buildtime, to preconfigure go to .west The list is impressive, from Arduino Opta PLC to STM32 Nucleo U585ZI-Q and more. See some of the commented out boards in my list below:

[manifest]
path = example-standalone-inferencing-zephyr-module
file = west.yml

[zephyr]
base = zephyr

[build]
board = arduino_nano_33_ble

## Select your board by uncommenting the corresponding line

## STM32 Nucleo U585ZI-Q
#board = nucleo_u585zi_q

# Renesas RA6M5 Evaluation Kit
##board 3 ek_ra6m5

## 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

Set a default target - Nano BLE 33 to .west

Now select the DevKit that you wish to flash to from the list of hardware targets
west build

The default at build time will pick what we set earlier: arduino_nano_33_ble (Arduino nano BLE 33)

west build -b esp32_cam/esp32/procpu

Or we could choose to override and set another target: Espressif esp32

West give

Flash and enjoy:

west flash
west flash
example-standalone-inferencing-zephyr-module git:(main) ✗ west flash                             

-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner bossac
There are multiple serial ports available on this system:
    1. /dev/cu.debug-console
    2. /dev/cu.usbmodem1101
    3. /dev/cu.BeatsFlx
    4. /dev/cu.Bluetooth-Incoming-Port
Please select one (1-4, or EOF to exit): 2
Write 164408 bytes to flash (41 pages)
[==============================] 100% (41/41 pages)
Done in 6.533 seconds
Verify 164408 bytes of flash
[==============================] 100% (41/41 pages)
Verify successful
Done in 0.252 seconds
Set boot flash true

Flashing output from the nano

Then connect to your chosen board via serial with minicom:

minicom -D /dev/tty.usbmodem0010507972341 -b 115200

Serial connection to view the inference results

Enjoy the results:

Inference Results 🎉:

Check the Edge Impulse Zephyr Module Guide for more information.

Summary

By packaging the Edge Impulse SDK as a Zephyr module, we’re making embedded machine learning a native part of Zephyr’s ecosystem. No more manual SDK copies, just clean, versioned integration with all the benefits of Zephyr’s modular build system. Whether you’re building on any of the 859 supported (and counting!) boards:

Enjoy!

Comments

Subscribe

Are you interested in bringing machine learning intelligence to your devices? We're happy to help.

Subscribe to our newsletter