Machine learning using stm32h755 chip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-29 6:14 PM
I am trying to integrate the a neural network machine learning model into the stm32h755 chip. I downloaded the stmCubeMx, installed X-Cube-Ai, selected the core, added the network using tflite file and then generated the code. I can't find the ai_model_data.c, ai_model_data.h, ai_model.h and some other important files. Could you please provide a detailed steps by step process to integrate the Neural Network in an ALREADY created/ EXISTING project?
Solved! Go to Solution.
- Labels:
-
STM32H7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-01 3:00 AM
Hello @slodh ,
If you have an already existing CubeMX project. Open your .ioc file with cubeMX and add X-Cube-AI as you would for a new project:
Then:
- Click cubeAI in the middleware and software packs
- Click add network
- Select as tflite
- Look for your model
- Analyse the model
Then you generate the Code.
Because you activated X-Cube-AI, you can access the documentation by clicking help>X-Cube-AI Documentation:
In there, in the Embedded Inference Client API, you will find a getting started - Minimal application code.
I think that you can start by adding that to your main.c and see how it goes first.
Another thing you can do is use ST Edge AI Developer Cloud to generate a working application in a few click and look at it to see how it is made. To do so:
- Go to ST Edge AI Developer Cloud
- Import your tflite model
- Pass/skip everystep until the last one
- Select the NUCLEO-H755ZI-Q as it also has a STM32H755
- Click to generate the STM32CubeIDE project
The code generate simply integrate the model given and do an inference with a random input (of the size of the input in the model) and output through serial, some information like the inference time.
I hope it helps.
Julian
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-01 3:00 AM
Hello @slodh ,
If you have an already existing CubeMX project. Open your .ioc file with cubeMX and add X-Cube-AI as you would for a new project:
Then:
- Click cubeAI in the middleware and software packs
- Click add network
- Select as tflite
- Look for your model
- Analyse the model
Then you generate the Code.
Because you activated X-Cube-AI, you can access the documentation by clicking help>X-Cube-AI Documentation:
In there, in the Embedded Inference Client API, you will find a getting started - Minimal application code.
I think that you can start by adding that to your main.c and see how it goes first.
Another thing you can do is use ST Edge AI Developer Cloud to generate a working application in a few click and look at it to see how it is made. To do so:
- Go to ST Edge AI Developer Cloud
- Import your tflite model
- Pass/skip everystep until the last one
- Select the NUCLEO-H755ZI-Q as it also has a STM32H755
- Click to generate the STM32CubeIDE project
The code generate simply integrate the model given and do an inference with a random input (of the size of the input in the model) and output through serial, some information like the inference time.
I hope it helps.
Julian
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-02 10:31 PM
Thanks a lot Julian, I followed the steps and generated the C++ code from the developer cloud. But I am not able to integrate (#include ) it. I have attached the photos for reference. Could you please help me fix this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-02 10:33 PM
Consider this  photo too
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-03 12:31 AM
Hello @slodh ,
As you think, it seems to be an error in the paths.
You other paths start with "../..", maybe try to put something like "../../sensor_model/"
Have a good day,
Julian
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-05 11:27 PM
Hey Julian,
Thank you for your support. I am having a lot of issues. Could you please get on a zoom call to resolve it ?
I am situated in Brisbane, Australia (AEST). Please let me know a suitable time according to your convenience at the earliest. Anytime tomorrow on Monday 7th October would do.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-07 1:24 AM - edited ‎2024-10-07 1:25 AM
Hello,
It would be easier for me to do it through ST Community to keep a trace for other that may have the same issues that you have. Also, I am based in Europe, so finding a time slot is not easy and I will probably need to contact experts depending on your questions to have the answers.
If you could describe where you are at, it would be great.
In the meantime, you can check this resource. The use case is different, but the CubeAI integration part may help you:
AI:How to perform motion sensing on STM32L4 IoTnode - stm32mcu
Julian.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-09 8:33 PM
I tried integrating it with my the current code that I have. I am getting this error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-10 12:46 AM - edited ‎2024-10-10 12:48 AM
Hello @slodh ,
These kinds of errors are outside of my knowledge and scope of the EdgeAI threads. Please open a new thread in the ST Community in the right section like here for example: STM32CubeIDE (MCUs) - STMicroelectronics Community
Have a good day.
Julian
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-26 3:24 AM
I appreciate the resources you've shared. I'll check the paths again and see if that resolves the integration issues. If I still have problems, I might start a new thread as you suggested.
