How to integrate the Edge Impulse SDK into an ncs3.3.0 project to run EI models

I have installed ncs3.3.0 and want to keep ncs unaffected. According to the document docs.nordicsemi.com/.../sdk_setup.html, I should choose to import the edge impulse SDK as an additional Zephyr module into the project. Then I use git clone --branch v2.0.0 github.com/.../sdk-edge-ai to pull this project onto my computer, and add set(EXTRA_ZEPHYR_MODULES "C:/ncs/ei_sdk/sdk-edge-ai") in the project's CMakeLists.txt to specify the path for edge AI, and add

CONFIG_CPP=y
CONFIG_REQUIRES_FULL_LIBCPP=y
CONFIG_STD_CPP11=y
CONFIG_EDGE_IMPULSE_SDK=y
CONFIG_EI_WRAPPER=n
CONFIG_FP16=n
CONFIG_EDGE_IMPULSE_PATH="F:/nrf54l15_app/ei_ml_test/ei_zephyr_eon_model.zip"

in prj.conf.

Finally I started compiling, but what I got was F:/nrf54l15_app/ei_ml_test_3.3.0/prj.conf:51: warning: attempt to assign the value 'y' to the undefined symbol EDGE_IMPULSE_SDK

F:/nrf54l15_app/ei_ml_test_3.3.0/prj.conf:54: warning: attempt to assign the value '"F:/nrf54l15_app/ei_ml_test/ei_zephyr_eon_model.zip"' to the undefined symbol EDGE_IMPULSE_ PATH
These two error messages.

What is the reason for this?

  • Hi,

    It is normal that "CONFIG_EDGE_IMPULSE_PATH" is not recognized as this is a custom Kconfig added from the sample "hell_ei". It is used in the "CMakeLists.txt" to specify a local file path of an archive containing the Edge Impulse library. So not exactly what you used it for.

    If you want to implement "CONFIG_EDGE_IMPULSE_PATH", you can add this to your "Kconfig" file:

    config EDGE_IMPULSE_PATH
    	string "Edge Impulse library path"
    	default 'ei_model_nrf_accel_sim_cpu_v55.zip'
    	help
    	  Specifies local file path of an archive containing Edge Impulse library.

    and this to your "CMakeLists.txt":

    # Expand any ${VARIABLES} in the path
    string(CONFIGURE ${CONFIG_EDGE_IMPULSE_PATH} CONFIG_EDGE_IMPULSE_PATH)
    
    # Convert relative paths to absolute paths
    if(NOT IS_ABSOLUTE ${CONFIG_EDGE_IMPULSE_PATH})
      # Using application source directory as base directory for relative path
      set(CONFIG_EDGE_IMPULSE_PATH ${APPLICATION_SOURCE_DIR}/${CONFIG_EDGE_IMPULSE_PATH})
    endif()
    
    set(FETCH_CONTENT_NAME edge_impulse)
    
    include(FetchContent)
    
    FetchContent_Declare(
        ${FETCH_CONTENT_NAME}
        URL ${CONFIG_EDGE_IMPULSE_PATH}
    )
    
    FetchContent_MakeAvailable(${FETCH_CONTENT_NAME})

    Best regards,

    Simon D-M

  • Hi

    Understood, thank you very much for your help

Related