Build C++ Library with STM32CubeIDE

Thanks Jan, That had fixed the compiler issue , but Question remains same why the Flash code is more(>30KiB) than what is mention at time of deployment?

So you have the features hardcoded right now, these take up 16000 * 4 bytes = 64K of flash. Normally you don’t have this hardcoded (it gets generated by your sensors on board) so you don’t have this overhead in a normal application/

Ohh then it will take more memory, but late say I would feed the audio raw data to library then what is the procedure to integrate such code?

@vikas You’ll need an audio buffer, but it can be small. E.g. 250ms. slice in int16 format. See https://docs.edgeimpulse.com/docs/continuous-audio-sampling for some docs on how to set this up. The example firmware for ST IoT Discovery Kit has this fully setup, and the Arduino libraries also come with examples on using PDM microphones.

I know it’s dated, but in case someone else is struggling with this, I wanted to share an alternative to this [1] issue stated at the beginning of this post.

A dual core project in STM32CubeIDE imposes a structure that’s not compatible with step 2. Tons of errors, unresolved includes, and missing definitions, even though the includes were added as in step 3.

In place if step 2 and 3, I made a separate folder at the project level and copied edge-impulse-sdk , tflite-model and model-parameters here.

Right click on the project and navigate to Properties > C/C++ General > Paths and Symbols The two tabs of interest here are Library Paths and Source Location. At both of these locations, click on Add/Add Folder or Link Folder and use the file system to provide the absolute path to the folder you created. After this, the folder should appear in the project explorer with an icon that indicates that it contains source files to be compiled.

Now to take care of the includes, just right click on the folder from the project explorer, and select Add/remove include path…

Hope this helps save someone time.

1 Like