File tree Expand file tree Collapse file tree
samples/edge_impulse/hello_ei Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,8 +19,36 @@ target_include_directories(app PRIVATE
1919 src/include
2020)
2121
22- # Add Edge Impulse library as a separate module
23- add_subdirectory (edge_impulse )
22+ # Enable C linkage for Edge Impulse module (allows calling from C code)
23+ zephyr_compile_definitions (
24+ EI_C_LINKAGE=1
25+ EIDSP_SIGNAL_C_FN_POINTER=1
26+ )
27+
28+ # Suppress warnings generated by Edge Impulse SDK
29+ zephyr_compile_options (
30+ -Wno-double-promotion
31+ -Wno-unused
32+ -Wno-sign-compare
33+ -Wno-maybe-uninitialized
34+ )
35+
36+ # Expand any ${VARIABLES} in the path
37+ string (CONFIGURE ${CONFIG_EDGE_IMPULSE_PATH} CONFIG_EDGE_IMPULSE_PATH)
38+
39+ # Convert relative paths to absolute paths
40+ if (NOT IS_ABSOLUTE ${CONFIG_EDGE_IMPULSE_PATH} )
41+ # Using application source directory as base directory for relative path
42+ set (CONFIG_EDGE_IMPULSE_PATH ${APPLICATION_SOURCE_DIR } /${CONFIG_EDGE_IMPULSE_PATH} )
43+ endif ()
44+
45+ set (FETCH_CONTENT_NAME edge_impulse)
46+
47+ include (FetchContent )
48+
49+ FetchContent_Declare (
50+ ${FETCH_CONTENT_NAME}
51+ URL ${CONFIG_EDGE_IMPULSE_PATH}
52+ )
2453
25- # Link Edge Impulse library to application
26- target_link_libraries (app PRIVATE edge_impulse )
54+ FetchContent_MakeAvailable (${FETCH_CONTENT_NAME} )
Original file line number Diff line number Diff line change 66
77mainmenu "Hello Edge Impulse sample application"
88
9- config EDGE_IMPULSE_URI
10- string "Edge Impulse library URI "
11- default 'edge_impulse/nrf_accel_sim-v35 .zip'
9+ config EDGE_IMPULSE_PATH
10+ string "Edge Impulse library path "
11+ default 'ei_model_nrf_accel_sim_v39 .zip'
1212 help
13- Specify URI used to access archive with Edge Impulse library.
14- The library will be downloaded into the build directory. You can specify
15- more than one URI separated by a semicolon.
16- Make sure to specify the HTTP API key header as EI_API_KEY_HEADER
17- variable during build if the HTTP server uses it.
18- You can also specify the absolute file path of a local file. In that
19- case, only one URI has to be defined.
13+ Specifies local file path of an archive containing Edge Impulse library.
2014
2115config EDGE_IMPULSE_DEBUG_MODE
2216 bool "Run Edge Impulse library in debug mode"
Load diff This file was deleted.
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,3 +16,6 @@ CONFIG_FP16=n
1616CONFIG_REQUIRES_FULL_LIBCPP=y
1717CONFIG_CBPRINTF_FP_SUPPORT=y
1818CONFIG_FPU=y
19+
20+ # Enable Edge Impulse SDK
21+ CONFIG_EDGE_IMPULSE_SDK=y
Original file line number Diff line number Diff line change 77#include <zephyr/kernel.h>
88#include <zephyr/logging/log.h>
99
10- #include " edge-impulse-sdk/dsp/numpy_types.h"
11- #include " edge-impulse-sdk/classifier/ei_classifier_types.h"
10+ #include < edge-impulse-sdk/dsp/numpy_types.h>
11+ #include < edge-impulse-sdk/classifier/ei_classifier_types.h>
1212
1313#include "input_data.h"
1414
Original file line number Diff line number Diff line change @@ -18,5 +18,11 @@ manifest:
1818 revision : v3.2.0
1919 import : true
2020
21+ - name : edge-impulse-sdk-zephyr
22+ url : https://github.com/edgeimpulse/edge-impulse-sdk-zephyr
23+ path : modules/edge-impulse-sdk-zephyr
24+ revision : v1.82.3
25+ west-commands : west/west-commands.yml
26+
2127 self :
2228 path : edge-ai
You can’t perform that action at this time.
0 commit comments