Hi, here’s a quick guide on how to build the C++ Library using STM32CubeIDE.
Export as C++ Library from the Deployment tab in Edge Impulse.
Add the edge-impulse-sdk, tflite-model and model-parameters folder to the Core directory of your project [1]
Right click on the project, select Properties > C/C++ Build > Settings > Tool Settings and add these lines to the ‘Include paths’ for both the GCC and G++ Compiler:
[1] Me neither, which is part of my dislike for Eclipse
I also recommend adding those includes to Debug and Release configurations as well. The Debug configuration will automatically add the -DDEBUG flag, which causes tflite inference to run much more slowly.
If there’s any GCC specific code in the library that prevents us from compiling with ARMCC let us know (I don’t think there’s a lot) though - I don’t have a KEIL license.
@ArtoK This looks like just a folder, not a project. Could you import the directory via Import > Existing project into workspace ? You should have a similar icon as I had afterwards…
I think I was able to add that libraray now in my project.
Is there any guidance how can I use the library in my project? How to launch the algorithm and where to get results?
I followed Build C++ Library with STM32CubeIDE to add created C++ libraries.
After that I continued the tutorial from ’ Configuring printf’ but after adding those lines in the main.cpp I get compilation error
In file included from …/Core/Src/main.cpp:73:0:
C:/Users/ett14229/STM32CubeIDE/workspace_1.5.0/ML_WachingMachine/Core/edge-impulse-sdk/classifier/ei_run_classifier.h:89:10: fatal error: tflite-model/trained_model_compiled.h: No such file or directory #include “tflite-model/trained_model_compiled.h”
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
How should I continue to get my libraries in use.
@ArtoK have you updated your include settings? Could you post a screenshot of Properties > C/C++ Build > Settings > Tool settings > G++ Compiler > Includes ?
You are correct. It was there but not anymore. Strange. I copied it back and not it is going further.
Stucks here.
…/Core/Src/main.cpp:80:28: error: ‘huart1’ was not declared in this scope
HAL_UART_Transmit(&huart1, (uint8_t*)string, strlen(string), 0xffffff); // send message via UART
^~~~~~
I’ll check .ioc file next.
Thanks.
For some reason the last part of the guide does not work. ‘Seeing the output’.
I’m using Putty and similar setup with it gives me console output if I update the firmware.