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

Deployment functions for STM32N6 MCU and STM32MP MPU target devices. More...

Go to the source code of this file.

Namespaces

 deploy
 

Functions

None deploy.deploy (DictConfig cfg=None, Optional[str] model_path_to_deploy=None, list credentials=None)
 Key parameters: More...
 
None deploy.deploy_mpu (DictConfig cfg=None, Optional[str] model_path_to_deploy=None, list credentials=None)
 

Detailed Description

Deployment functions for STM32N6 MCU and STM32MP MPU target devices.

This module provides two deployment functions:

  • deploy() : Deploys a quantized INT8 model onto an STM32N6 MCU board (e.g., STM32N6570-DK) using GCC and STM32CubeIDE.
  • deploy_mpu() : Deploys a model onto an STM32MP MPU board (e.g., STM32MP257F-EV1) optionally with cloud-based NBG optimization.

    Deployment workflow for STM32N6 (MCU path):

  1. Read all deployment parameters from the Hydra config (YAML file).
  2. Generate the C header file ai_model_config.h via gen_h_user_file_n6(). This file contains model metadata (input shape, output shape, keypoints, etc.) that the C firmware application needs to configure itself at runtime.
  3. Select the board-specific ST Edge AI configuration file (.conf).
  4. Call stm32ai_deploy_stm32n6() from the common deployment module, which: a. Runs ST Edge AI Core (stedgeai) to convert the .tflite model to optimized C code. b. Copies the generated C files into the STM32CubeIDE project. c. Compiles the firmware using GCC via STM32CubeIDE. d. Flashes the resulting binary onto the connected STM32N6570-DK board via ST-Link.
Note
This file is part of the STM32AI Model Zoo Services repository by STMicroelectronics. Comments and 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

Definition in file deploy.py.