Showing results for 
Search instead for 
Did you mean: 

Can you generate ai_model_config.h from cubeMX?

Associate II

The script in stm32ai-modelzoo/image_classification/getting_started generates an extra file, ai_model_config.h which is convenient as it contains the class names and other usefull defines.

Is there a way to generate this file from cubeMX?

Moreover, at the end of this config.h file, there are some defines which are related to the specific board (a nucleo H743ZI2 in my case). Where do these come from and how can someone modify them?
For example I would like to use an OV7670 camera in place of the one supported in the example.


ST Employee

Hello @AEfth

The ai_model_config.h file is completely generated by the python scripts of the ModelZoo, it is not generated by CubeMX. 

Can you be more specific about the defines you want to modify? 

To use the OV7670 camera you need to develop the drivers for this camera and modify the existing code to use them. 



I don't think these defines are a big deal. The rest of them would be good to have with cubeMX as that would simplify the workflow for some people.

Anyway, just the last two defines would need to change: CAMERA_SENSOR_OV5640 and CAMERA_SENSOR.

I searched through all the repo files in case they are in a .yaml, or the stmaic_xxx.conf files, or somewhere else, but they must be built-in somewhere. Maybe the defines which are unrelated to the neural model could be entered by the user in the stmaic_xx.conf file.

I had modified a previous version of the image classification getting started example for my Nucleo H743ZI2 to use OV7670 and an SPI LCD display. Back then the example did not support the nucleo board. 


Associate III

Hi AEfth

I am current working with image classification from model zoo. I am using the stm32h747i-disco board and B-Cams-OMV module. Hence I can follow the tutorial provided. However, now I am facing the problem that after I deploy the model, there is nothing flash to my board and no error showing. So I would like to ask you can you still able to deploy your model using the Python file Appreciate for you time. Thanks .

Associate II

I didn't use the script to actually deploy. I just wanted that file generated to continue with the getting started application without having to modify the existing code much.

I'm actually using cubeMX and after the code is generated, I move to platoformIO (on VScode). 

However, I did a quick check and the script does flash my board: Nucleo H743ZI2.


Associate III

I have try to use the file generated and the getting started application to deploy the model through stm32cube IDE version 1.10 and 1.14 and there are some warnings and after I fix the warnings there is still nothing shown on my board but I able to deploy the model using the scripts few months ago. Recently only facing this issue. By the way thanks for your reply.