Zephyr now supports the eIQ Neutron NPU on MCX N and i.MX RT700. This article will describe how to get Zephyr and use the eIQ Neutron NPU libraries and examples.
Some previous experience with eIQ Neutron NPU enablement is assumed, so ensure you're familiar with the eIQ Neutron SDK, converting models for eIQ Neutron NPU, and basic ML concepts by going through the MCX N or i.MX RT700 NPU bare-metal lab guides for VS Code before continuing on below.
Install Software
- Run the MCUXpresso Installer tool and install three key components:
- Zephyr Developer
- Arm GNU Toolchain
- Zephyr SDK
- LinkServer
- Install LinkServer and add LinkServer to the PATH
- Install VS Code and MCUxpresso VS Code plugin
Download Zephyr
- Open VSCode
- Go to the MCUXpresso for VSCode plugin and click on Import Repository
- Go to the Remote tab and select the Zephyr repository. Choose it a directory name and location to download the repository to, and then click on Import.
- It will take approximately 30 minutes to download the repository. Near the end of the download there will be several prompts in the terminal asking to accept licenses. Type “y” to accept and hit enter. There will be about 10 of these prompts at the end.
- Open the MCUXpresso Venv Terminal which has a Python virtual environment with all the paths preconfigured that were installed by MCUXpresso Installer.
- In the terminal that pops up, type “1” to select the default environment.
- Then navigate to the directory you downloaded Zephyr into
- Run the following commands to get TensorFlow:
west config manifest.project-filter -- +tflite-micro
west update
- Go into the zephyr subdirectory folder
cd zephyr
- Now need to explicitly download the Pull Request (PR) that enables eIQ Neutron. This eventually won’t be necessary when Zephyr 4.5 is released in October, but until then will need to type the following In the command prompt to get it:
git remote -v
git remote add upstream https://github.com/zephyrproject-rtos/zephyr.git
git remote -v
git stash
git fetch upstream pull/108834/head:pr-108834
git checkout pr-108834
- After this command you should see there’s now a folder at \ \zephyr\samples\boards\nxp\tflm_neutron with example source code.
Compile and Run a Zephyr eIQ Neutron NPU example
- Compile the project with west:
west build -p auto -b frdm_mcxn947/mcxn947/cpu0 samples/boards/nxp/tflm_neutron
west build -p auto -b mimxrt700_evk/mimxrt798s/cm33_cpu0 samples/boards/nxp/tflm_neutron
- Open TeraTerm or other serial terminal program, and connect to the virtual COM port that board enumerated as when you plugged in the USB cable. Use 115200 baud, 1 stop bit, no parity.
- Flash the resulting code with west flash
- The serial terminal should show the following:

- Can debug with west debug
Run your own NPU accelerated ML model in Zephyr
Make sure you've gone through the MCX N or i.MX RT700 hands-on labs so you're familiar with the enablement. The same steps for converting a model with the Neutron Converter tool inside eIQ Neutron SDK, updating the eIQ Neutron libraries, modfiying the operator list, and adding a new model are relevant when using Zephyr, but the file locations will be Zephyr specific. Also note that the header file generated by the Neutron Converter tool will need to be updated to match the header of the model.hpp file.
Also note that the README.rst file in the Zephyr Neutron example mentions using eIQ Toolkit but that information is outdated and been superseded by eIQ Neutron SDK.
- eIQ Neutron example is at \zephyr\samples\boards\nxp\tflm_neutron
- Neutron libraries are at \modules\hal\nxp\zephyr\blobs\neutron\
- Model data is at \zephyr\samples\boards\nxp\tflm_neutron\src\models\mcxn\model.hpp
- Labels file is at \zephyr\samples\boards\nxp\tflm_neutron\src\labels.h
- kTensorArenaSize variable is set in \zephyr\samples\boards\nxp\tflm_neutron\src\main_functions.cpp (line 40) and is set to 60KB by default
- OpResolver is set in \zephyr\samples\boards\nxp\tflm_neutron\src\main_functions.cpp (line 65)
- The model is selected in \zephyr\samples\boards\nxp\tflm_neutron\src\main_functions.cpp (line 11)
Additional References: