STM32N6 NPU Deployment — Politecnico di Milano  1.0
Documentation for Neural Network Deployment on STM32N6 NPU - Politecnico di Milano 2024-2025
common_deploy.py File Reference

Core deployment functions for STM32 MCU and MPU target devices. More...

Go to the source code of this file.

Namespaces

 common_deploy
 

Functions

None common_deploy._keep_internal_weights (str path_network_data_params)
 
None common_deploy._dispatch_weights (str internalFlashSizeFlash_KB, str kernelFlash_KB, str applicationSizeFlash_KB, str path_network_c_info, str path_network_data_params)
 
None common_deploy.stm32ai_deploy (bool target=False, str stlink_serial_number=None, str stm32ai_version=None, str c_project_path=None, str output_dir=None, str stm32ai_output=None, str optimization=None, str path_to_stm32ai=None, str path_to_cube_ide=None, list additional_files=None, str stmaic_conf_filename='stmaic_c_project.conf', int verbosity=None, bool debug=False, str model_path=None, str get_model_name_output=None, str stm32ai_ide=None, str stm32ai_serie=None, list credentials=None, bool on_cloud=False, bool check_large_model=False, cfg=None, Dict custom_objects=None)
 
None common_deploy.stm32ai_deploy_stm32n6 (bool target=False, str stlink_serial_number=None, str stm32ai_version=None, str c_project_path=None, str output_dir=None, str stm32ai_output=None, str optimization=None, str path_to_stm32ai=None, str path_to_cube_ide=None, list additional_files=None, str stmaic_conf_filename='stmaic_c_project.conf', int verbosity=None, bool debug=False, str model_path=None, str get_model_name_output=None, str stm32ai_ide=None, str stm32ai_serie=None, list credentials=None, bool on_cloud=False, bool check_large_model=False, str build_conf=None, cfg=None, Dict custom_objects=None, str input_data_type='', str output_data_type='', str inputs_ch_position='', str outputs_ch_position='')
 
None common_deploy.stm32ai_deploy_mpu (bool target=False, str board_ip_address=None, str board_deploy=None, List class_names=None, str c_project_path=None, int verbosity=None, bool debug=False, str model_path=None, cfg=None)
 

Detailed Description

Core deployment functions for STM32 MCU and MPU target devices.

This module is the engine of the entire ModelZoo Services deployment pipeline. It contains three public deployment functions and two private helper functions:

Public functions:

Private helper functions:

Deployment pipeline for STM32N6 (used in this project):

└── stmaic.load() # Create STMAi session with model
└── STMAiBoardConfig() # Load board .conf file (memory pools, NPU config)
└── _stmaic_local_call()
└── STMAiCompileOptions() # Set Neural-ART path, data types, channel format
└── stmaic.compile() # Run stedgeai: analyze + generate C code
└── stmaic.build() # STM32CubeIDE: compile + ST-Link flash
None stm32ai_deploy_stm32n6(bool target=False, str stlink_serial_number=None, str stm32ai_version=None, str c_project_path=None, str output_dir=None, str stm32ai_output=None, str optimization=None, str path_to_stm32ai=None, str path_to_cube_ide=None, list additional_files=None, str stmaic_conf_filename='stmaic_c_project.conf', int verbosity=None, bool debug=False, str model_path=None, str get_model_name_output=None, str stm32ai_ide=None, str stm32ai_serie=None, list credentials=None, bool on_cloud=False, bool check_large_model=False, str build_conf=None, cfg=None, Dict custom_objects=None, str input_data_type='', str output_data_type='', str inputs_ch_position='', str outputs_ch_position='')
Note
This file is part of the STM32AI Model Zoo Services repository by STMicroelectronics. Comments and Doxygen documentation added for educational purposes as part of the Multidisciplinary Project — Neural Network Deployment on STM32N6 NPU. Politecnico di Milano, A.Y. 2024-2025. Authors: Giacomo Colosio, Sebastiano Colosio, Patrizio Acquadro, Tito Nicola Drugman

Definition in file common_deploy.py.