cancel
Showing results for 
Search instead for 
Did you mean: 

Which software do I need to install to start with STM32N6570-DK?

Anhem
Associate II

I am a newbie with STM32N6570-DK.

My target is to deploy AI model on this board. Which software do I need to install to start with STM32N6570-DK? I means that all softwares.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Julian E.
ST Employee

Hello @Anhem ,

 

I would suggest you start with ST Model Zoo: 

STMicroelectronics/stm32ai-modelzoo: AI Model Zoo for STM32 devices

 

This github repository is composed of 2 parts:

  • ST Model Zoo: where you can download models
  • ST Model Zoo Services: Where you will find python scripts mainly to retrain models, do quantization and deployment on N6.

 

Make sure to follow the before you start in ST Model Zoo Services (at the end) to install everything correctly.

Also, to deploy model on N6, follow this document (example for object detection). You will need to download a few additional things:

stm32ai-modelzoo-services/object_detection/deployment/README_STM32N6.md at main · STMicroelectronics/stm32ai-modelzoo-services

 

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.

View solution in original post

17 REPLIES 17
Julian E.
ST Employee

Hello @Anhem ,

 

I would suggest you start with ST Model Zoo: 

STMicroelectronics/stm32ai-modelzoo: AI Model Zoo for STM32 devices

 

This github repository is composed of 2 parts:

  • ST Model Zoo: where you can download models
  • ST Model Zoo Services: Where you will find python scripts mainly to retrain models, do quantization and deployment on N6.

 

Make sure to follow the before you start in ST Model Zoo Services (at the end) to install everything correctly.

Also, to deploy model on N6, follow this document (example for object detection). You will need to download a few additional things:

stm32ai-modelzoo-services/object_detection/deployment/README_STM32N6.md at main · STMicroelectronics/stm32ai-modelzoo-services

 

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 E. 

Thank you. I am following with this link.

Step 1: I installed STM32CubeIDE and installed STEdgeAI (for generating C code from tflite/onnx).

Step 2: I also downloaded STM32N6 Getting Started V1.0.0 and copy application_code to modezoo-services https://github.com/STMicroelectronics/stm32ai-modelzoo-services/blob/main/application_code/object_detection/STM32N6/README_ModelZoo.md 

I have a question. Whether I need to instal CubeMX and install X-CUBE-AI in CubeMX.

As my understanding with STEdgeAI we can generated C code from tflite/onnx, why we need X-CUBE-AI more?

 

Moreover, I tried installed CubeMX and X-CUBE-AI inside CubeMX, it seems that I need to download STEdgeAI again and NPU Art inside CubeMX. This made me confuse because in the aboe step 1, we have already installed STEdgeAI and NPU Art.

 

Hello @Anhem ,

 

Sure, it is a little bit hard to understand.

 

CubeMX is useful to generate project when starting from zero.

The application codes were started using cubeMX.

In your case, you will use the application code, so you don't need it. In the future, if you want to start your project from blank, you will need it to configure the I/O, get the LL and HAL libraries etc.

 

For X Cube AI, I would explain it as a GUI in CubeMX for ST Edge AI core.

So if you were to add manually  an AI model in a new project, the easiest way would be to use X Cube AI for it to generate all your c files and generate a CubeIDE project with a template code.

You could use ST Edge AI, get your files, and manually add it to your project folder and add the path in CubeIDE for the builder to find your files.

With model zoo, it is the deployment script that will call st edge ai, get your model as c files and replace it automatically in the application codes.

 

To sum up, st edge ai core is the heart of everything, it is the software that does the conversion.

Most of the AI tool are way to use it: ST Dev cloud uses it in background, X Cube AI also and Model Zoo scripts

So, for now, you have installed everything that you need.

 

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 E. 

It is more clear for me. I want to understand about this point 

Moreover, I tried installed CubeMX and X-CUBE-AI inside CubeMX, it seems that I need to download STEdgeAI again and NPU Art inside CubeMX.

It means that STEdgeAI and NPU ART that I installed outside CubeMX is seperated with STEdgeAI and NPU ART in CubeMX. Is that right? STEdgeAI and NPU ART in CubeMX are used only when we use CubeMX. Is that right?

Thank you.

Anhem
Associate II

Hi @Julian E. 

I follow this link https://github.com/STMicroelectronics/stm32ai-modelzoo-services/blob/main/object_detection/deployment/README_STM32N6.md and I got this error.

My PC do not have GPU so I commented out some code in stm32ai.py

2025-03-20 13:56:14.310314: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2025-03-20 13:56:14.310329: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
[INFO] : Running `deployment` operation mode
2025/03/20 13:56:16 INFO mlflow.tracking.fluent: Experiment with name '<unnamed>' does not exist. Creating a new experiment.
[INFO] : ClearML config check
[INFO] : The random seed for this simulation is 123
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
[INFO] : Generating C header file for Getting Started...
[INFO] : This TFLITE model doesnt contain a post-processing layer
loading model.. model_path="../../stm32ai-modelzoo/object_detection/ssd_mobilenet_v2_fpnlite/ST_pretrainedmodel_public_dataset/coco_2017_person/ssd_mobilenet_v2_fpnlite_035_192/ssd_mobilenet_v2_fpnlite_035_192_int8.tflite"
loading conf file.. "../../application_code/object_detection/STM32N6/stmaic_STM32N6570-DK.conf" config="None"
"n6 release" configuration is used
[INFO] : Selected board :  "STM32N6570-DK Getting Started Object Detection (STM32CubeIDE)" (stm32_cube_ide/n6 release/stm32n6)
[INFO] : Compiling the model and generating optimized C code + Lib/Inc files:  ../../stm32ai-modelzoo/object_detection/ssd_mobilenet_v2_fpnlite/ST_pretrainedmodel_public_dataset/coco_2017_person/ssd_mobilenet_v2_fpnlite_035_192/ssd_mobilenet_v2_fpnlite_035_192_int8.tflite
setting STM.AI tools.. root_dir="", req_version=""
 Cube AI Path: "/opt/ST/STEdgeAI/2.0/Utilities/linux/stedgeai".
[INFO] : Offline CubeAI used; Selected tools:  10.0.0 (x-cube-ai pack)
loading conf file.. "../../application_code/object_detection/STM32N6/stmaic_STM32N6570-DK.conf" config="None"
"n6 release" configuration is used
compiling... "ssd_mobilenet_v2_fpnlite_035_192_int8_tflite" session
 model_path  : ['../../stm32ai-modelzoo/object_detection/ssd_mobilenet_v2_fpnlite/ST_pretrainedmodel_public_dataset/coco_2017_person/ssd_mobilenet_v2_fpnlite_035_192/ssd_mobilenet_v2_fpnlite_035_192_int8.tflite']
 tools       : 10.0.0 (x-cube-ai pack)
 target      : "STM32N6570-DK Getting Started Object Detection (STM32CubeIDE)" (stm32_cube_ide/n6 release/stm32n6)
 options     : --st-neural-art default@../../application_code/object_detection/STM32N6/Model/user_neuralart.json --input-data-type uint8 --inputs-ch-position chlast
[returned code = 255 - FAILED]
$ cwd:  None
$ args: /opt/ST/STEdgeAI/2.0/Utilities/linux/stedgeai generate --target stm32n6 -m ../../stm32ai-modelzoo/object_detection/ssd_mobilenet_v2_fpnlite/ST_pretrainedmodel_public_dataset/coco_2017_person/ssd_mobilenet_v2_fpnlite_035_192/ssd_mobilenet_v2_fpnlite_035_192_int8.tflite --output /media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/experiments_outputs/2025_03_20_13_56_16 --workspace /media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/experiments_outputs/2025_03_20_13_56_16 --st-neural-art default@../../application_code/object_detection/STM32N6/Model/user_neuralart.json --input-data-type uint8 --inputs-ch-position chlast
ST Edge AI Core v2.0.0-20049

PASS:   0%|          | 0/82 [00:00<?, ?it/s]
PASS:   9%|▊         | 7/82 [00:00<00:04, 15.86it/s]
PASS:  11%|█         | 9/82 [00:00<00:05, 12.90it/s]
PASS:  13%|█▎        | 11/82 [00:00<00:05, 12.68it/s]
PASS:  17%|█▋        | 14/82 [00:01<00:04, 14.12it/s]
PASS:  26%|██▌       | 21/82 [00:01<00:02, 23.07it/s]
PASS:  29%|██▉       | 24/82 [00:01<00:02, 20.97it/s]
PASS:  33%|███▎      | 27/82 [00:01<00:02, 19.90it/s]
PASS:  37%|███▋      | 30/82 [00:01<00:02, 18.26it/s]
PASS:  39%|███▉      | 32/82 [00:01<00:02, 17.69it/s]
PASS:  41%|████▏     | 34/82 [00:01<00:02, 17.63it/s]
PASS:  44%|████▍     | 36/82 [00:02<00:02, 17.23it/s]
PASS:  46%|████▋     | 38/82 [00:02<00:02, 17.30it/s]
PASS:  49%|████▉     | 40/82 [00:02<00:02, 17.31it/s]
PASS:  52%|█████▏    | 43/82 [00:02<00:02, 19.02it/s]
PASS:  55%|█████▍    | 45/82 [00:02<00:02, 18.37it/s]
PASS:  60%|█████▉    | 49/82 [00:02<00:01, 21.31it/s]
PASS:  63%|██████▎   | 52/82 [00:02<00:01, 20.05it/s]
PASS:  67%|██████▋   | 55/82 [00:03<00:01, 17.26it/s]
PASS:  70%|██████▉   | 57/82 [00:03<00:01, 16.71it/s]
PASS:  72%|███████▏  | 59/82 [00:03<00:01, 16.15it/s]
PASS:  74%|███████▍  | 61/82 [00:03<00:01, 15.85it/s]
PASS:  77%|███████▋  | 63/82 [00:03<00:01, 14.18it/s]
PASS:  80%|████████  | 66/82 [00:03<00:00, 16.11it/s]
PASS:  84%|████████▍ | 69/82 [00:03<00:00, 17.32it/s]
PASS:  87%|████████▋ | 71/82 [00:04<00:00, 16.69it/s]
PASS:  89%|████████▉ | 73/82 [00:04<00:00, 16.22it/s]

 >>>> EXECUTING NEURAL ART COMPILER

PASS:  89%|████████▉ | 73/82 [00:06<00:00, 16.22it/s]

   /opt/ST/STEdgeAI/2.0/Utilities/linux/atonn -i "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/experiments_outputs/2025_03_20_13_56_16/ssd_mobilenet_v2_fpnlite_035_192_int8_OE_3_1_0.onnx" --json-quant-file "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/experiments_outputs/2025_03_20_13_56_16/ssd_mobilenet_v2_fpnlite_035_192_int8_OE_3_1_0_Q.json" -g "network.c" --load-mdesc "/opt/ST/STEdgeAI/2.0/Utilities/configs/stm32n6.mdesc" --load-mpool "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/application_code/object_detection/STM32N6/Model/my_mpools/stm32n6-app2.mpool" --save-mpool-file "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/experiments_outputs/2025_03_20_13_56_16/neural_art__network/stm32n6-app2.mpool" --out-dir-prefix "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/experiments_outputs/2025_03_20_13_56_16/neural_art__network/" --all-buffers-info --no-hw-sw-parallelism --cache-maintenance --enable-virtual-mem-pools --native-float --optimization 3 --Os --Omax-ca-pipe 4 --Ocache-opt --enable-epoch-controller --output-info-file "c_info.json"

PASS:  89%|████████▉ | 73/82 [00:06<00:00, 16.22it/s]

   Unable to execute the command "['/opt/ST/STEdgeAI/2.0/Utilities/linux/atonn', '-i', '/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/experiments_outputs/2025_03_20_13_56_16/ssd_mobilenet_v2_fpnlite_035_192_int8_OE_3_1_0.onnx', '--json-quant-file', '/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/experiments_outputs/2025_03_20_13_56_16/ssd_mobilenet_v2_fpnlite_035_192_int8_OE_3_1_0_Q.json', '-g', 'network.c', '--load-mdesc', '/opt/ST/STEdgeAI/2.0/Utilities/configs/stm32n6.mdesc', '--load-mpool', '/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/application_code/object_detection/STM32N6/Model/my_mpools/stm32n6-app2.mpool', '--save-mpool-file', '/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/experiments_outputs/2025_03_20_13_56_16/neural_art__network/stm32n6-app2.mpool', '--out-dir-prefix', '/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/experiments_outputs/2025_03_20_13_56_16/neural_art__network/', '--all-buffers-info', '--no-hw-sw-parallelism', '--cache-maintenance', '--enable-virtual-mem-pools', '--native-float', '--optimization', '3', '--Os', '--Omax-ca-pipe', '4', '--Ocache-opt', '--enable-epoch-controller', '--output-info-file', 'c_info.json']"
   [Errno 13] Permission denied: '/opt/ST/STEdgeAI/2.0/Utilities/linux/atonn'

PASS:  89%|████████▉ | 73/82 [00:06<00:00, 16.22it/s]


   E103(CliRuntimeError): Error calling the Neural Art compiler - []
Error executing job with overrides: []
Traceback (most recent call last):
  File "/home/anhem/miniconda3/envs/stm_32/lib/python3.10/site-packages/clearml/binding/hydra_bind.py", line 230, in _patched_task_function
    return task_function(a_config, *a_args, **a_kwargs)
  File "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/stm32ai_main.py", line 228, in main
    process_mode(cfg)
  File "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/stm32ai_main.py", line 102, in process_mode
    deploy(cfg)
  File "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/../deployment/deploy.py", line 111, in deploy
    stm32ai_deploy_stm32n6(target=board, stlink_serial_number=stlink_serial_number, stm32ai_version=stm32ai_version, c_project_path=c_project_path,
  File "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/../../common/deployment/common_deploy.py", line 515, in stm32ai_deploy_stm32n6
    stmaic_local_call(session)
  File "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/../../common/deployment/common_deploy.py", line 489, in stmaic_local_call
    stmaic.compile(session=session, options=opt, target=session._board_config)
  File "/media/anhem/mnt/STM32N6570DK_dev/stm32ai-modelzoo-services-1dc52d8ef939fb7875c6e00e7a6f6311f07c5cb1/object_detection/src/../../common/stm32ai_local/compile.py", line 216, in cmd_compile
    raise Exception('Error during compilation')
Exception: Error during compilation

 What I need to do to fix it? Thank you

Hello @Anhem ,

 

If you install X Cube AI first, it will install the ST Edge AI Core (and the NPU if you install it also) here:

C:\Users\your_user\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AI\10.0.0\Utilities\windows\stedegeai.exe

 

If you use the standalone installer, I believe it install it in C:\ST\stedgeai\2.0.0\utilities\windows\stedgeai.exe

 

They are the same thing.

And because they are the same thing, if you install X Cube AI after installing the standalone, it will not install it again but use the second path I wrote.

 

I do think that the standalone installer doesn't look out for another version installed on your PC. It will install it no matter what, but I did not test it out.

 

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 E. 


@Julian E. wrote:

Hello @Anhem ,

 

If you install X Cube AI first, it will install the ST Edge AI Core (and the NPU if you install it also) here:

C:\Users\your_user\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-AI\10.0.0\Utilities\windows\stedegeai.exe

 

If you use the standalone installer, I believe it install it in C:\ST\stedgeai\2.0.0\utilities\windows\stedgeai.exe

 

They are the same thing.

And because they are the same thing, if you install X Cube AI after installing the standalone, it will not install it again but use the second path I wrote.

 

I do think that the standalone installer doesn't look out for another version installed on your PC. It will install it no matter what, but I did not test it out.

 

Have a good day,

Julian


That is cleared for me.

Could you give advice for the above error when I tried deploying tflite model on the board?

Hello @Anhem ,

 

Can you send me your user_config.yaml please.

 

Concerning the graphic card, did you get an error ? the code should use a GPU if it finds one, but should still works even if you don't have one.

 

In terms of steps while setting up everything, can you confirm that you:

  1. Cloned model zoo and followed the before you start
  2. Donwloaded the N6 getting started on st.com and copied it in modelzoo/application_code
  3. Installed ST Edge AI core and NPU
  4. Edited the yaml file in /use_case/src/
  5. Ran the command python stm32ai.py 

 

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.