config
birdnet_stm32.deploy.config
¶
Configuration resolution for deployment paths.
Resolves paths to X-CUBE-AI tools, models, and project directories from (in priority order): CLI arguments > environment variables > config file.
Supports both JSON (config.json) and TOML (config.toml) config files.
When a .toml file is provided, deploy-related keys are read from the
[deploy] table.
DeployConfig
dataclass
¶
Deployment configuration for STM32N6 target.
Attributes:
| Name | Type | Description |
|---|---|---|
x_cube_ai_path |
str
|
Root directory of X-CUBE-AI installation. |
model_path |
str
|
Path to the quantized .tflite model. |
output_dir |
str
|
Directory for stedgeai output artifacts. |
workspace_dir |
str
|
Directory for stedgeai workspace. |
n6_loader_config |
str
|
Path to n6_loader JSON config. |
cubeide_path |
str
|
Path to STM32CubeIDE (optional). |
arm_toolchain_path |
str
|
Path to arm-none-eabi toolchain (optional). |
stedgeai_path |
str
|
Full path to the stedgeai binary (derived). |
n6_loader_script |
str
|
Full path to n6_loader.py (derived). |
Source code in birdnet_stm32/deploy/config.py
__post_init__()
¶
Derive tool paths from x_cube_ai_path.
Source code in birdnet_stm32/deploy/config.py
resolve_deploy_config(cli_args=None, config_path='config.json')
¶
Resolve deployment configuration from CLI args, environment, and config file.
Priority: CLI arguments > environment variables > config file defaults.
If the specified config_path does not exist, the resolver also tries
config.toml (and vice-versa) as a fallback.
Environment variables
X_CUBE_AI_PATH: Root directory of X-CUBE-AI installation. STEDGEAI_PATH: Direct path to the stedgeai binary. CUBEIDE_PATH: Path to STM32CubeIDE. ARM_TOOLCHAIN_PATH: Path to arm-none-eabi toolchain. BIRDNET_MODEL_PATH: Path to the quantized .tflite model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cli_args
|
dict | None
|
Optional dict of CLI overrides. |
None
|
config_path
|
str
|
Path to JSON or TOML config file. |
'config.json'
|
Returns:
| Type | Description |
|---|---|
DeployConfig
|
Populated DeployConfig. |