Skip to content

es-ude/elastic-ai.runtime.network-validation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enV5 Base Project

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.

Setup

Prerequisites

Purpose Tool Version
Build Script Generator CMake >= 3.13
Embedded Compiler arm-non-eabi-gcc
Build Tool Ninja
Bitfile Flashing Python3

Local Setup

  1. Install all required tools (see Prerequisites)
  2. Clone the repo to your local machine
  3. Initialize all submodules with
git submodule update --init --recursive
  1. Open the project in your preferred C/C++ IDE
  2. OPTIONAL Create a virtual Python3 environment
  3. OPTIONAL Install Python3 dependencies from elastic-ai.runtime.enV5/bitfile_scripts/requirements.txt

Clion specific settings

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 logs
  • Release: build targets for the RP2040 without debug logs
  • Unit 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.

Project structure

This project contains various folders:

  • extern: stores external git submodules, i.e. the elastic-ai.runtime.enV5
  • out: stores unit test executables, as well as .uf2 binary files for the enV5
  • src: contains Main.c, helpers and your source code
  • test: contains unit tests and hardware tests in their respective folders

Build via CLI

How to build a binary

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.

How to build an integration Test

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.

How to build and run the unit tests

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.

Quickfix

Update all submodules to the latest release

git submodule update --init --recursive --remote

About

Project example that uses the elastic-ai.runtime.enV5 as a dependency

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 78.8%
  • CMake 21.2%