-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
84 lines (72 loc) · 3.11 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#
# Copyright (c) 2022 Edge Impulse
#
#
cmake_minimum_required(VERSION 3.13.1)
# If project is build with WiFi shiled using the command line
# west build -b thingy53_nrf5340_cpuapp -p -- -DSHIELD=nrf7002eb
# then the SHIELD variable is set to nrf7002eb and additional configuratio for project is added
if("${SHIELD}" STREQUAL "nrf7002eb")
set(CONF_FILE ${CMAKE_CURRENT_SOURCE_DIR}/boards/shield-nrf7002eb.conf; ${CMAKE_CURRENT_SOURCE_DIR}/boards/thingy53_nrf5340_cpuapp.conf; ${CMAKE_CURRENT_SOURCE_DIR}/prj.conf)
endif()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
list(APPEND ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/drivers/vm3011 )
##########################################################################
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project("firmware-nordic-thingy53-internal"
VERSION 0.1)
##########################################################################
add_subdirectory(ei-model/edge-impulse-sdk/cmake/zephyr)
# Needed for colorful output
zephyr_compile_options(-fdiagnostics-color=always)
# Use hardware acceleration for DSP and Neural Network code
# You'll need to disable these on non-Arm cores
add_definitions(-DEIDSP_USE_CMSIS_DSP=1
-DEIDSP_LOAD_CMSIS_DSP_SOURCES=1
-DEI_CLASSIFIER_TFLITE_ENABLE_CMSIS_NN=1
-DEIDSP_QUANTIZE_FILTERBANK=0
-DARM_MATH_LOOPUNROLL
-DMBEDTLS_PLATFORM_ZEROIZE_ALT
)
# Edge impulse SDK include directories
set(INCLUDES
.
drivers
ei-model
ei-model/tflite-model
ei-model/model-parameters
src
src/libs
)
include_directories(${INCLUDES})
RECURSIVE_FIND_FILE(MODEL_FILES "ei-model/tflite-model" "*.cpp")
RECURSIVE_FIND_FILE(BME68X_FILES "drivers/bme68x" "*.c")
RECURSIVE_FIND_FILE(FIRMWARE_SDK_FILES "firmware-sdk" "*.cpp")
RECURSIVE_FIND_FILE(FIRMWARE_SDK_C_FILES "firmware-sdk" "*.c")
RECURSIVE_FIND_FILE(LIB_MBEDTLS_FILES "src/libs/mbedtls_hmac_sha256_sw/mbedtls/src" "*.c")
RECURSIVE_FIND_FILE(SENSORS_FILES "src/sensors" "*.cpp")
RECURSIVE_FIND_FILE(INFERENCE_FILES "src/inference" "*.cpp")
list(APPEND SOURCE_FILES ${MODEL_FILES})
list(APPEND SOURCE_FILES ${BME68X_FILES})
list(APPEND SOURCE_FILES ${FIRMWARE_SDK_FILES})
list(APPEND SOURCE_FILES ${FIRMWARE_SDK_C_FILES})
list(APPEND SOURCE_FILES ${LIB_MBEDTLS_FILES})
list(APPEND SOURCE_FILES ${LIB_SENSOR_AQ_MBEDTLS_FILES})
list(APPEND SOURCE_FILES ${SENSORS_FILES})
list(APPEND SOURCE_FILES ${INFERENCE_FILES})
# add all sources to the project
target_sources(app PRIVATE ${SOURCE_FILES})
target_sources(app PRIVATE src/ble/ei_ble_com.cpp)
target_sources(app PRIVATE src/ble/nus.c)
target_sources(app PRIVATE src/ble/ble_nus.cpp)
if("${SHIELD}" STREQUAL "nrf7002eb")
target_sources(app PRIVATE src/wifi/wifi.cpp)
target_sources(app PRIVATE src/wifi/ei_ws_client.cpp)
endif()
target_sources(app PRIVATE src/ei_base64_encode.cpp)
target_sources(app PRIVATE src/ei_at_handlers.cpp)
target_sources(app PRIVATE src/ei_device_thingy53.cpp)
target_sources(app PRIVATE src/ei_sampler.cpp)
target_sources(app PRIVATE src/flash_memory.cpp)
target_sources(app PRIVATE src/main.cpp)