This project explains how to use the elastic-ai.runtime.enV5 as a submodule for further development. Although the elastic-ai.runtime.enV5 project is more automated, this project requires more steps to set up.
Purpose | Tool | Version |
---|---|---|
Build Script Generator | CMake | >= 3.13 |
Embedded Compiler | arm-non-eabi-gcc | |
Build Tool | Ninja | |
Bitfile Flashing | Python3 |
- Install all required tools (see Prerequisites)
- Clone the repo to your local machine
- Initialize all submodules with
git submodule update --init --recursive
- Open the project in your preferred C/C++ IDE
- OPTIONAL Create a virtual Python3 environment
- OPTIONAL Install Python3 dependencies from elastic-ai.runtime.enV5/bitfile_scripts/requirements.txt
Clion automatically detects targets and adds them to the configurations in the upper right corner. These can be built via one of the profiles. There are three profiles in total:
Debug
: build targets for the RP2040 with debug logsRelease
: build targets for the RP2040 without debug logsUnit Test
: regular unit test executables
Switching the profiles also "fixes" include paths, so if you have a unit test open, Clion will not recognize the
inclusion of the unity.h file, as it is only included under the Unit Test
profile.
This project contains various folders:
extern
: stores external git submodules, i.e. the elastic-ai.runtime.enV5out
: stores unit test executables, as well as .uf2 binary files for the enV5src
: contains Main.c, helpers and your source codetest
: contains unit tests and hardware tests in their respective folders
cmake -B build/debug -DDEBUG_OUTPUT:BOOL=ON -G Ninja .
cmake --build build/debug -j 4 --target main
If you omit the --target
flag, cmake will build every hardware target.
If you omit the -DDEBUG_OUTPUT:BOOL=ON
, than the PRINT_DEBUG
Macro will be disabled.
cmake -B build/debug -DDEBUG_OUTPUT:BOOL=ON -G Ninja .
cmake --build build/debug -j 4 --target hardware-test_MQTTPublish
If you omit the --target
flag, cmake will build every hardware target.
If you omit the -DDEBUG_OUTPUT:BOOL=ON
, than the PRINT_DEBUG
Macro will be disabled.
cmake -B build/unit-tests/test/unit -DUNIT_TEST:BOOL=ON -DDEBUG_OUTPUT:BOOL=ON -DCMAKE_BUILD_TYPE=DEBUG -G Ninja .
cmake --build build/unit-tests/test/unit -j 4 --clean-first
ctest --test-dir build/unit-tests/test/unit --output-on-failure
If you omit the -DDEBUG_OUTPUT:BOOL=ON
, than the PRINT_DEBUG
Macro will be disabled.
git submodule update --init --recursive --remote