cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6570-DK how to generate .c .h files from AI model

msingh08
Associate III

I have downloaded the x-cube-n6-ai-multi-pose-estimation-v1.0.0 and have managed to open it in CubeIde however when I try to build the project it displays the following error: 

"Please generate this file with STM32Cube.AI tools. See instruction in README.md." 

I have installed CubeAI (I think) however I am absolutely confused by the Readme.md file, as it seems to direct to "Doc/Download-and-deploy-model.md" when I open this file I downloaded "yolov8n_256_quant_pc_uf_pose_coco-st (1)" however I am not sure what to do next? 

 

If I understand now I only need to generate the .c and .h files from the AI model in the "...\x-cube-n6-ai-multi-pose-estimation-v1.0.0\Model" folder, but how do I do that? 

3 REPLIES 3
Julian E.
ST Employee

Hello @msingh08,

 

First, I would suggest using the latest version of this package (v2.0.0 GitHub - STMicroelectronics/x-cube-n6-ai-multi-pose-estimation: An AI software application package demonstrating multi-pose estimation use case on STM32N6 product.​)

 

Next, it is true that it is a bit confusing.

I would suggest to look at the other md: x-cube-n6-ai-multi-pose-estimation/Doc/Program-Hex-Files-STM32CubeProgrammer.md at main · STMicroelectronics/x-cube-n6-ai-multi-pose-estimation · GitHub

 

In here you see that the application required to flash 3 binary files:

  1. The weights of the model in external
  2. The application 
  3. The FSBL that will launch first and load the application in internal RAM

 

The other readme explains how to generate new weights. If you do follow this, you will obtain new weights and to run the application you need to flash these new weights (and the appli + FSBL if you did not do it already)

 

Let me know if you need further explanations.

 

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.

Hi Julian, 

 

Thanks for your reply, I have downloaded the latest version however i am still unsure what to do in order to be able to build the project. The objective of my project is to being able to track different individuals on the screen and their XY coordinates. that's why I'd like to being able to build the project and add extra code as required. 

 

I look forward to hearing from yourself

 

Hello @msingh08,

 

This could probably help, and the other video of the playlist:

STM32N6 demo workshop - 07 Neural Processing Unit (NPU) in practice

 

To deploy the getting started, you need to :

  1. Set the board in dev mode (pins to the left and restart the board)
  2. Open CubeProgrammer
  3. Connect the board and click connect
  4. Select the external loader of the DK
  5. JulianE_0-1756473336034.png
  6. Program the 3 hex files I mentioned in my last message
  7. JulianE_1-1756473375787.png
  8. Set the board in boot from flash mode (pins to the right and restart)

 

If you want to change the model, you need to follow x-cube-n6-ai-multi-pose-estimation/Doc/Download-and-deploy-model.md at main · STMicroelectronics/x-cube-n6-ai-multi-pose-estimation · GitHub

In short, generate the C file of your model with the ST Edge AI Core generate command, sign the file as the N6 is a secure MCU, edit the app_config.h with the right posprocessing (or create your own if you use a non-model zoo/supported mode). Then flash the new weight and application.

 

You can also edit the application to suits your needs the same way, save it, sign the binary, program it.

 

The FSBL will most likely never change.

Each time you modify the appli you need to sign and flash the new binary

Each time you change model, you need to generate, sign and flash the weights

 

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.