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

Central configuration header for the STM32N6570-DK pose estimation firmware application. More...

#include "arm_math.h"
Include dependency graph for app_config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define USE_DCACHE
 Enable the ARM Cortex-M55 Data Cache (D-Cache). More...
 
#define CAMERA_FLIP   CMW_MIRRORFLIP_NONE
 Camera mirror/flip mode — no transformation applied. More...
 
#define ASPECT_RATIO_CROP   (1)
 Crop mode — both camera pipes are cropped to the NN input aspect ratio. More...
 
#define ASPECT_RATIO_FIT   (2)
 Fit mode — both pipes are resized to the NN input aspect ratio. More...
 
#define ASPECT_RATIO_FULLSCREEN   (3)
 Fullscreen mode — camera image is resized to fill the entire LCD. More...
 
#define ASPECT_RATIO_MODE   ASPECT_RATIO_CROP
 Active aspect ratio mode for this deployment. More...
 
#define POSTPROCESS_TYPE   POSTPROCESS_SPE_MOVENET_UF
 Select postprocessing pipeline: Single Person Estimation with MoveNet. More...
 
#define NN_HEIGHT   (192)
 Neural network input image height in pixels. More...
 
#define NN_WIDTH   (192)
 Neural network input image width in pixels. More...
 
#define NN_BPP   3
 Bytes per pixel of the NN input tensor. More...
 
#define COLOR_BGR   (0)
 BGR channel order (OpenCV convention) More...
 
#define COLOR_RGB   (1)
 RGB channel order (TFLite/TensorFlow convention) More...
 
#define COLOR_MODE   COLOR_RGB
 Active color format: RGB. More...
 
#define AI_POSE_PP_CONF_THRESHOLD   (0.4)
 Minimum confidence threshold for accepting a detected keypoint. More...
 
#define AI_POSE_PP_POSE_KEYPOINTS_NB   (13)
 Number of body keypoints output by the model. More...
 
#define AI_SPE_MOVENET_POSTPROC_HEATMAP_WIDTH   (NN_WIDTH / 4)
 Width of the MoveNet output heatmap in pixels. More...
 
#define AI_SPE_MOVENET_POSTPROC_HEATMAP_HEIGHT   (NN_HEIGHT / 4)
 Height of the MoveNet output heatmap in pixels. More...
 
#define AI_SPE_MOVENET_POSTPROC_NB_KEYPOINTS   (AI_POSE_PP_POSE_KEYPOINTS_NB)
 Number of keypoints for the MoveNet postprocessor. More...
 
#define WELCOME_MSG_0   "Single/multi pose estimation - Hand landmark"
 Welcome screen line 0 — application description. More...
 
#define WELCOME_MSG_1   "st_movenet_lightning_heatmaps_192_int8_pc.tflite"
 Welcome screen line 1 — active model filename. More...
 
#define WELCOME_MSG_2   "Model Running in STM32 MCU internal memory"
 Welcome screen line 2 — memory configuration note. More...
 

Detailed Description

Central configuration header for the STM32N6570-DK pose estimation firmware application.

Author
GPM Application Team — documented by Politecnico di Milano

This file is the single source of truth for the entire firmware application. It is automatically regenerated by the ModelZoo Services deployment script (gen_h_user_file_n6() in src/utils.py) every time a new model is deployed, injecting the correct values from user_config.yaml.

It configures four aspects of the application:

1. Camera pipeline:

  • Mirror/flip orientation of the camera sensor
  • Aspect ratio handling between the camera resolution and the NN input size

2. Neural network input dimensions:

  • Width, height, and bytes-per-pixel of the model's input tensor
  • Color format (RGB vs BGR)

3. Postprocessing:

  • Selects between SPE (Single Person Estimation) and MPE (Multi Person Estimation)
  • Confidence threshold for keypoint acceptance
  • Number of keypoints (13 for MoveNet ST variant, 17 for YOLOv8n standard)
  • Heatmap dimensions for MoveNet decoder

4. Display:

  • Welcome screen messages showing the active model name
Note
This file is part of the STM32AI Model Zoo Services repository. 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 app_config.h.