Showing results for 
Search instead for 
Did you mean: 

How to change a network called in FP-AI-CTXAWARE1 package?


Hello, I recently bought the STEVAL-MKSBOX1V1 card ( I would like to perform emotion recognition from speech through a convolutional network of my own creation. I downloaded the FP-AI-CTXAWARE1 package and opened the project on STM32 CUBE IDE in order to modify the network called by the package since the preprocessing on the audio wave is the same. I can't figure out how to change this call because in the ai_common.c end (line 511) the ai_run function calls nn_name without ever using it. Can anyone explain to me how this call works or just how to replace the network?

Federica Bossi
ST Employee

Hi @FRana​ ,

Welcome to ST Community!

The nn_nam is just a variable that the user can use to know which is the used network, but the main focus of the program is the net_ctx variable (pointer). 

That one is populated through the function aiInit() (in ai_common.c file), that refers to this define:

#define AI_ASC_MODEL_NAME         "asc"

If you already generated your network files through Cubemx.AI, you should replace any asc.c and .h references with yours so that the Init function knows what to initialize (then, when net_ctx is initialized and is the only network in the firmware, it is the only one running).

I hope I've been helpful to you!

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.