Can't run an EI classifier on Nordic hardware

I tried deploying a simple continuous motion recognition model to the nRF5340 Development Kit with the ADXL335 sensor. The sensor is connected to the analog pins of the development kit and I am able to successfully read the values returned using the onboard adc. The issues start when trying to integrate the C++ library built by Edge Impulse.
I’m using VS Code with nRF Connect SDK 2.2.0 and nRF Connect Toolchain 2.2.0.I started by getting the following error “fatal error: ei_run_classifier.h: No such file or directory” even though this file exists inside the project. Using the explicit path to the header file proved effective but I had to do that for every header file used so I quickly abandoned this idea. Next I added a macro to the project’s CMakeLists.txt file that recursively goes through all the directories in the project folder and includes every header file found.This solution proved very effective but soon enough I found myself face to face with another error “project/continuous-motion-recognition/edge-impulse-sdk/dsp/numpy.hpp:32:10: fatal error: cfloat: No such file or directory”. After unsuccessfully trying to solve this issue I resorted to moving all the files found in ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/include/c++/12.1.0 to the project folder. The error did indeed disappear when trying to build the project but countless others appeared. Those can be found in the errorlog.txt file.When trying to use nRF Connect SDK 1.9.1 I’m getting the following error “project/boards/nrf5340dk_nrf5340_cpuapp_ns.overlay:7:11: fatal error: zephyr/dt-bindings/adc/adc.h: No such file or directory”
Github link to the project and the error log file GitHub - justnicu/Continuous-Motion-Recognition: Continuous Motion Recognition model built using Edge Impulse. This model is to be deployed on the nRF5340 Development Kit that makes use of the ADXL335 sensor.

Hi @niculaandrei
First of all, our SDK currently supports NCS 1.9.1. The newest NCS is not tested (and we already know there are some issues), so that could be the first source of your issues. Try to fall back to NCS 1.9.1.
As for the ADC error, it seems the ADC is not selected correctly in prj.conf file. Did you use west to enable ADC? Did you enable it in the Device Tree?
Also, please take a look at our firmware source code for nRF53 DK: GitHub - edgeimpulse/firmware-nordic-nrf52840dk-nrf5340dk: Edge Impulse firmware for nRF52840 DK and nRF5340 DK

Best regards,
Mateusz

Hello @mateusz thanks for the quick response! I enabled ADC in the device tree and it worked using NCS 2.2.0. I get the errors mentioned above regarding ADC only after switching to 1.9.1. I will take a look at the firmware source code. In the meantime if you have any more suggestions they’ll be very much appreciated.

Hi @niculaandrei
It seems like an issue with the configuration of ADC. It is out of Edge Impulse scope, so please check Nordic DevZone for help. Here are a few links that may help you:

Best regards,
Mateusz