This example runs an impulse on the STEVAL-BCN002V1 multi-sensor board, classifying data in real-time from the LSM6DSO IMU. An example Edge Impulse project can be found here: https://studio.edgeimpulse.com/public/48988/latest - you can clone this project and use the data forwarder to add new data, or train new gestures.
- Continuous Motion Recognition - Gestures - ST BlueTile Low Memory Edge Impulse project: https://studio.edgeimpulse.com/public/48988/latest
- Fan Monitoring - Advanced Anomaly Detection - ST BlueTile Low Memory Edge Impulse project: https://studio.edgeimpulse.com/public/111797/latest
Note: This is an example, and not a fully supported development board.
Note: This inference test repo only utilizes the accelerometer (LSM6DSO) sensor onboard the STEVAL-BCN002V1, to create an inference application using one of the other sensors, you will need to add the driver code from the STSW-BLUETILE-DK SDK into the mbed-os target folder and update the sensor init code in main.cpp.
To update the existing Edge Impulse continuous motion recognition library in this repository with a new accelerometer Edge Impulse C++ library deployment, follow these instructions:
- Delete the following directories:
edge-impulse-sdk
,model-parameters
,tflite-model
- Extract the .zip file of your new Edge Impulse C++ library and copy/paste the following directories into the root of this project:
edge-impulse-sdk
,model-parameters
,tflite-model
- Change the following code in
edge-impulse-sdk/porting/mbed/ei_classifier_porting.cpp
from:to.../** * Cancelable sleep, can be triggered with signal from other thread */ EI_WEAK_FN EI_IMPULSE_ERROR ei_sleep(int32_t time_ms) { #if MBED_VERSION >= MBED_ENCODE_VERSION((5), (11), (0)) rtos::ThisThread::sleep_for(time_ms);
/** * Cancelable sleep, can be triggered with signal from other thread */ EI_WEAK_FN EI_IMPULSE_ERROR ei_sleep(int32_t time_ms) { #if MBED_VERSION >= MBED_ENCODE_VERSION((5), (11), (0)) wait_ms(time_ms);
Now you are ready to build and flash your new accelerometer Edge Impulse machine learning application to the STEVAL-BCN002V1!
-
Install the Mbed CLI.
-
Install the GNU Arm Embedded Toolchain 7.
-
Configure the Mbed CLI, and point it to the toolchain:
$ echo 'ROOT=.' > .mbed $ mbed config GCC_ARM_PATH ~/toolchains/gcc-arm-none-eabi-7-2018-q2-update/bin/
-
Build the project:
$ mbed compile -t GCC_ARM -m STEVAL_IDB008V2 --profile=develop.json
-
Install the STSW-BNRGFLASHER (Windows only).
-
Open the flash application, and flash
./BUILD/STEVAL_IDB008V2/GCC_ARM-DEVELOP/bluenrg-inference-test.bin
to address0x10040000
and check "Entire Memory". -
Open a serial terminal to the device on baud rate
9600
to see the inference results.
This work is based on an Mbed OS port for the BlueTile by ntoni92.