cancel
Showing results for 
Search instead for 
Did you mean: 

Error “Range [0, -1] out of bounds for length 44” when debugging STM32 AI Model Zoo project on STM32N6

Goat_abdalla
Associate II

 

Hello,

I have been trying for several weeks to run the Getting Started Object Detection demo from the STM32 GitHub repository.
I followed both the GitHub and all the steps from the official guide:
“How to run AI models from model zoo on STM32N6” by @B.Montanari   (ST Employee)— but the STM32CubeIDE part does not work for me.

Each time I try to open the Debug Configuration or start the debugger, I get the following error:

An error has occurred. See error log for more details.
Range [0, -1] out of bounds for length 44

I saw that @Ghofrane GSOURI (ST Employee) suggested removing this line from the .project file:

<nature>com.st.stm32cube.ide.mcu.MCUAppSProjectNature</nature

After doing that, I can open the Debug Configuration and start debugging,
but when I upload the project to my STM32N6570-DK board, the demo doesn’t run properly(black screen or the ia doesn't work).

Here is what I have already tried:

  • Following the full official STM32 AI / Model Zoo setup guide step by step

  • Using different STM32CubeIDE versions (1.17.0, 1.19.0 etc.)

  • Testing multiple AI models

  • Reimporting and rebuilding the project

  • Switching workspaces and reinstalling the IDE,.metadata deleting,

Unfortunately, the issue persists — I can’t successfully debug or run any of the models.

Since I’m currently working on a school project, I really need to get this demo running to continue my work.

Could someone from ST or the community please help me solve this problem?
Thank you very much for your support.

Best regards, xoxo
Abdalla

 

Goat_abdalla_0-1760807368813.png

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Goat_abdalla,

 

I tried your object_detection_all_project and successfully ran it.

I had to delete the /debug, build the project and then delete the debug configuration.

JulianE_0-1761205739054.png

 

I never encountered the range error.

 

Please try what I did, we never know, else, is it possible for you to uninstall any cubeIDE on your pc and then reinstall the version 1.18.1 (prior to 1.19.0) and see if it helps?

If it doesn't, please create a thread on the tools forum board as this seems to be purely a cubeIDE issue...

 

Let me know what results your tests give.

 

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

8 REPLIES 8
Julian E.
ST Employee

Hi @Goat_abdalla,

 

The Range error should be only present in 1.19.0. In your screenshot you are using this version, but it seems that you also get this error on other CubeIDE versions? (It would be strange)

 

When using model zoo, make sure to use the yaml file in the same folder as the model (and edit it to deploy the model) Could you please share the logs you get?

 

Could you please try to deploy this one:stm32ai-modelzoo/object_detection/st_yolo_x/ST_pretrainedmodel_custom_dataset/st_person/st_yolo_x_nano_480 at main · STMicroelectronics/stm32ai-modelzoo

using the yaml alongside the model.

 

Make sure to install the model zoo services in a virtual env as explain in the main readme.

 

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.

Hello, julian

Thank you so much for your help.

I confirm that I'm using the YAML file in the same folder as the model as recommended.
However, I still get the same "Range [0, -1) out of bounds" error.

I have also tested with STM32CubeIDE version 1.17.0, and I still encounter the same problem.

image.png

​STM32N6/
│
├── 📁 Application/                    
│   │
│   ├── 📁 NUCLEO-N657X0-Q/           (For NUCLEO board)
│   │   ├── Inc/                       (Header files)
│   │   │   ├── ai_model_config.h
│   │   │   ├── app_network.h
│   │   │   ├── FreeRTOSConfig.h
│   │   │   ├── main.h
│   │   │   ├── stm32n6xx_hal_conf.h
│   │   │   ├── stm32n6xx_it.h
│   │   │   └── ...
│   │   │
│   │   ├── Src/                       (Source files)
│   │   │   ├── ai_model_config.c
│   │   │   ├── app_network.c
│   │   │   ├── main.c
│   │   │   ├── stm32n6xx_hal_msp.c
│   │   │   ├── stm32n6xx_it.c
│   │   │   └── ...
│   │   │
│   │   ├── STM32CubeIDE/              
│   │   │   ├── .project
│   │   │   ├── .cproject
│   │   │   ├── STM32N657xx.ld        
│   │   │   ├── Debug/                 
│   │   │   └── ...
│   │   │
│   │   └── Makefile
│   │
│   └── 📁 STM32N6570-DK/              
│       ├── Inc/                        
│       │   ├── ai_model_config.h      
│       │   ├── app_network.h          
│       │   ├── FreeRTOSConfig.h
│       │   ├── main.h
│       │   ├── stm32n6xx_hal_conf.h
│       │   ├── stm32n6xx_it.h
│       │   └── ... (16 more headers)
│       │
│       ├── Src/                        (Source files)
│       │   ├── ai_model_config.c      (AI model init)
│       │   ├── app_network.c          (Network execution)
│       │   ├── main.c                 (Main application)
│       │   ├── stm32n6xx_hal_msp.c    (HAL MSP)
│       │   ├── stm32n6xx_it.c         (Interrupts)
│       │   └── ... (7 source files total)
│       │
│       ├── STM32CubeIDE/               
│       │   ├── .project                
│       │   ├── .cproject               
│       │   ├── STM32N657xx.ld          
│       │   │
│       │   ├── Debug/                  
│       │   │   ├── Application/
│       │   │   ├── Drivers/
│       │   │   ├── Middlewares/
│       │   │   ├── ll_aton/
│       │   │   ├── lib_vision_models_pp/
│       │   │   ├── STM32N6570-DK_GettingStarted_ObjectDetection.elf
│       │   │   ├── STM32N6570-DK_GettingStarted_ObjectDetection.bin
│       │   │   └── makefile
│       │   │
│       │   ├── Application/
│       │   ├── Drivers/
│       │   ├── ll_aton/
│       │   ├── Middlewares/
│       │   ├── Utilities/
│       │   └── STM32N6570-DK_GettingStarted_ObjectDetection Debug.launch
│       │
│       └── Makefile
│
├── 📁 Binary/                         
│   ├── ai_fsbl.hex                    
│   ├── NUCLEO-N657X0-Q_GettingStarted_ObjectDetection.hex
│   ├── NUCLEO-N657X0-Q_network_data.hex
│   ├── STM32N6570-DK_GettingStarted_ObjectDetection.hex
│   └── STM32N6570-DK_network_data.hex
│
├── 📁 Doc/                            
│   ├── Application-Overview.md
│   ├── Boot-Overview.md
│   ├── Build-Options.md
│   ├── Deploy-your-tflite-Model-NUCLEO-N657X0-Q.md
│   ├── Deploy-your-tflite-Model-STM32N6570-DK.md
│   └── Program-Hex-Files-STM32CubeProgrammer.md
│
├── 📁 Middlewares/                    
│   │
│   ├── 📁 AI_Runtime/                 (STM32 AI Runtime)
│   │   ├── Inc/                       (93 headers)
│   │   ├── Lib/                       (47 libraries)
│   │   ├── LICENSE.txt
│   │   └── Npu/                      
│   │
│   ├── 📁 ai-postprocessing-wrapper/  (Post-processing for AI)
│   │   ├── app_postprocess_od_st_yolox_ui.c    (YOLO X post-processing)
│   │   ├── app_postprocess_od_yolov2_ui.c
│   │   ├── app_postprocess_od_yolov8_ui.c
│   │   ├── app_postprocess_od_st_ssd_uf.c      (SSD post-processing)
│   │   ├── app_postprocess_od_fd_blazeface_ui.c (Face detection)
│   │   ├── app_postprocess.h
│   │   └── ... (25 files total)
│   │
│   ├── 📁 Camera_Middleware/          
│   │   ├── cmw_camera.c
│   │   ├── cmw_camera.h
│   │   ├── ISP_Library/               
│   │   ├── sensors/                   
│   │   │   ├── imx335/
│   │   │   ├── steval_55g1mbi/
│   │   │   └── steval_66gymai/
│   │   └── README.md
│   │
│   ├── 📁 lib_vision_models_pp/       
│   │   └── lib_vision_models_pp/
│   │       ├── od_pp_st_yolox.c
│   │       ├── od_pp_yolov2.c
│   │       ├── od_pp_yolov8.c
│   │       ├── od_pp_ssd_st.c
│   │       └── ... (45 files)
│   │
│   └── 📁 screenl/                    
│       ├── display.c
│       ├── display.h
│       └── ... (38 files)
│
├── 📁 Model/                          
│   │
│   ├──  st_yolo_x_nano_480_1.0_0.25_3_st_int8.tflite    
│   ├──   st_yolo_x_nano_480_1.0_0.25_3_config.yaml     
│   │
│   ├──  quantized_tiny_yolo_v2_224_.tflite            
│   │
│   ├── 📁 my_mpools/                  (Memory pool configs)
│   │   ├── stm32n6-app2_NUCLEO-N657X0-Q.mpool
│   │   └── stm32n6-app2_STM32N6570-DK.mpool
│   │
│   ├── 📁 NUCLEO-N657X0-Q/            
│   │   ├── network_data.hex
│   │   ├── network.c
│   │   └── ...
│   │
│   ├── 📁 STM32N6570-DK/             
│   │   ├── network.c                  
│   │   ├── network.h                  
│   │   ├── network_ecblobs.h          
│   │   ├── network_generate_report.txt
│   │   ├── st_yolo_x_nano_480_1.0_0.25_3_st_int8_OE_3_2_0_Q.json
│   │   └── st_yolo_x_nano_480_1.0_0.25_3_st_int8_OE_3_2_0.onnx
│   │
│   ├── 📁 st_ai_output/               
│   │   ├── network.c
│   │   ├── network.h
│   │   ├── network_ecblobs.h
│   │   └── ... (9 files)
│   │
│   ├── 📁 st_ai_ws/                   
│   │   ├── build_network/
│   │   ├── network.h
│   │   └── neural_art__network/
│   │
│   ├──  generate-n6-model_NUCLEO-N657X0-Q.sh
│   ├──  generate-n6-model_STM32N6570-DK.sh
│   ├── user_neuralart_NUCLEO-N657X0-Q.json
│   ├──  user_neuralart_STM32N6570-DK.json
│   └──  LICENSE.md
│
├── 📁 STM32Cube_FW_N6/                
│   ├── Drivers/                       
│   │   ├── BSP/
│   │   ├── CMSIS/
│   │   └── STM32N6xx_HAL_Driver/     (1817 files)
│   │
│   ├── Middlewares/                   (1593 files)
│   │   ├── FreeRTOS/
│   │   ├── USB_Device/
│   │   └── ...
│   │
│   ├── Utilities/                     (24 files)
│   └── sbom_cdx.json
│
├── 📁 _htmresc/                      
│   ├── ASPECT_RATIO_MODE1.png
│   ├── BasicAppOverview.png
│   ├── Dev_mode.png
│   ├── Software_architecture.png
│   └── ... (20+ images)
│
├──  stmaic_NUCLEO-N657X0-Q.conf     (STM32 AI config for NUCLEO)
├──  stmaic_STM32N6570-DK.conf       (STM32 AI config for DK)
│
Model/
│
├── 📁 my_mpools/
│   ├── stm32n6-app2_NUCLEO-N657X0-Q.mpool
│   └── stm32n6-app2_STM32N6570-DK.mpool
│
├── 📁 NUCLEO-N657X0-Q/
│   ├── network_data.hex
│   ├── network_data.xSPI2.bin
│   ├── network_ecblobs.h
│   └── network.c
│
├── 📁 STM32N6570-DK/
│   ├── LICENSE.txt
│   ├── network_atonbuf.xSPI2.raw
│   ├── network_c_info.json
│   ├── network_ecblobs.h
│   ├── network_generate_report.txt
│   ├── network.c
│   ├── network.h
│   ├── st_yolo_x_nano_480_1.0_0.25_3_st_int8_OE_3_2_0_Q.json
│   └── st_yolo_x_nano_480_1.0_0.25_3_st_int8_OE_3_2_0.onnx
│
├── 📁 st_ai_output/               
│   ├── LICENSE.txt
│   ├── network_atonbuf.xSPI2.raw
│   ├── network_c_info.json
│   ├── network_ecblobs.h
│   ├── network_generate_report.txt
│   ├── network.c
│   ├── network.h
│   ├── st_yolo_x_nano_480_1.0_0.25_3_st_int8_OE_3_2_0_Q.json
│   └── st_yolo_x_nano_480_1.0_0.25_3_st_int8_OE_3_2_0.onnx
│
├── st_ai_ws/                   
│   ├── build_network/
│   ├── network.h
│   └── neural_art__network/
│
├──  generate-n6-model_NUCLEO-N657X0-Q.sh    (Generation scripts)
├──  generate-n6-model_STM32N6570-DK.sh
│
├──  LICENSE.md
│
├──  quantized_tiny_yolo_v2_224_.tflite      
│
├── st_yolo_x_nano_480_1.0_0.25_3_st_int8.tflite    
│
├──  st_yolo_x_nano_480_1.0_0.25_3_config.yaml    
│
├── user_neuralart_NUCLEO-N657X0-Q.json
└─ user_neuralart_STM32N6570-DK.json

 

 

 

 

 

 

 

 

 

 

general:
  project_name: st_yolo_x_480_deployment
  model_path: ../../application_code/object_detection/STM32N6/Model/st_yolo_x_nano_480_1.0_0.25_3_st_int8.tflite
  model_type: st_yolo_x
  logs_dir: logs
  saved_models_dir: saved_models
  display_figures: false
  global_seed: 127

operation_mode: deployment

dataset:
  name: coco_2017_person
  class_names: [person]

preprocessing:
  rescaling:
    scale: 1/127.5
    offset: -1
  resizing:
    aspect_ratio: fit
    interpolation: nearest
  color_mode: rgb

postprocessing:
  yolo_anchors: [0.5, 0.5, 0.07, 0.25, 0.23, 0.7]
  confidence_thresh: 0.001
  NMS_thresh: 0.5
  IoU_eval_thresh: 0.5
  max_detection_boxes: 100

tools:
  stedgeai:
    version: 10.2.0
    optimization: balanced
    on_cloud: False
    path_to_stedgeai: C:/Users/@/STM32Cube/Repository/Packs/STMicroelectronics/X-CUBE-AI/10.2.0/Utilities/windows/stedgeai.exe
  path_to_cubeIDE: C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/stm32cubeide.exe

deployment:
  c_project_path: ../../application_code/object_detection/STM32N6/
  IDE: GCC
  verbosity: 1
  hardware_setup:
    serie: STM32N6
    board: STM32N6570-DK

mlflow:
  uri: ./experiments_outputs/mlruns

hydra:
  run:
    dir: ./experiments_outputs/${general.project_name}

 

 

 

 

 

 

image.png

image.png

Hello @Goat_abdalla,

 

I am not sure to understand, in all your screens, you seem to use cubeIDE 1.19.0.

Really, this range error was only observed in 1.19.0.

 

In your yaml, you have this:

tools:
  stedgeai:
    version: 10.2.0
    optimization: balanced
    on_cloud: False
    path_to_stedgeai: C:/Users/@/STM32Cube/Repository/Packs/STMicroelectronics/X-CUBE-AI/10.2.0/Utilities/windows/stedgeai.exe
  path_to_cubeIDE: C:/ST/STM32CubeIDE_1.19.0/STM32CubeIDE/stm32cubeide.exe

Which also suggest that you use the 1.19.0.

 

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.
Goat_abdalla
Associate II

Hi,julian I tried with version 17. I managed to unlock the debug option, but after the second “Next”, I ran into an error.

have a good day,

 

 

 

 

 

image.pngimage.png

Hi @Goat_abdalla,

 

You are using the version 1.19 on windows and 1.17 on mac? Is that right?

We do not guarantee the support on mac for model zoo, I believe, this could cause some issue...

 

Could you try on a not version 1.19 on windows please? And attach your generated project in a .zip if you still have an issue please?

 

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.
Goat_abdalla
Associate II

Hi Julian, thank you so much for your support 

I just tried again with version 17 on my Windows PC, but I’m still getting the same errors. I can’t even start debugging  I can’t get into debug mode at all, it’s still showing the same error (44, etc.)

 

I’m really grateful for your help Julian, thank you.

Hi @Goat_abdalla,

 

I tried your object_detection_all_project and successfully ran it.

I had to delete the /debug, build the project and then delete the debug configuration.

JulianE_0-1761205739054.png

 

I never encountered the range error.

 

Please try what I did, we never know, else, is it possible for you to uninstall any cubeIDE on your pc and then reinstall the version 1.18.1 (prior to 1.19.0) and see if it helps?

If it doesn't, please create a thread on the tools forum board as this seems to be purely a cubeIDE issue...

 

Let me know what results your tests give.

 

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,

I managed to upload my code on my Windows without any errors! I uninstall all IDE and try 
I used the IDE version 1.18, and it works perfectly.

Thank you so much for all your support and follow-up, i really appreciate it.
Wish you all the best and continued success!

Best regards,
Abdalla