The System Manager Config Tool Command Line Interface is a Python-based configuration tool designed for NXP's System Manager firmware. SMCT serves as a bridge between human-readable configuration files and the low-level header files required for embedded system compilation.
- Overview
- Prerequisites
- Installation
- Quick start guide
- SMCT command line options
- JSON configuration files
- SM project file structure
- Common use cases
- Workflow examples
- Compiling SM using SMCT CLI instead of configtool.pl
- Common errors and solutions
SMCT provides a complete workflow for managing System Manager configurations:
- Configuration Parsing: Converts legacy CFG files into a structured JSON format for easier manipulation and version control
- Resource Management: Maintains a comprehensive database of hardware resources, constraints, and capabilities
- Validation: Ensures configuration consistency and catches conflicts before compilation
- Code Generation: Produces C header source code files for integration with firmware builds
- Legacy Support: Maintains compatibility with existing perl-based toolchains
- Operating Systems: Windows, Linux, macOS
- Python 3.10 or higher
- Create and activate a virtual environment (venv, pipenv) to avoid conflicts with other packages (recommended)
- Upgrade pip to the latest version
- Get the System Manager Firmware (SM FW) project, it can be downloaded from https://github.com/nxp-imx/imx-sm
- Place the SMCT CLI tool either within the SM FW project root directory or at the same hierarchical level (recommended)
- Default SM FW root directory path is
../(can be overridden with--sm_dir)
- Default SM FW root directory path is
To install SMCT from the GitHub repository sources:
git clone https://github.com/nxp-imx/imx-smct.gitcd imx-smctCreate and activate the virtual environment and install the dependencies using the TOML configuration:
python3 -m venv venvsource venv/bin/activatepython -m pip install --upgrade pippip install -U -e .Alternatively, install dependencies:
pip install -r requirements.txtThis section provides brief instructions for getting started with SMCT.
Ensure that SMCT is properly located in relation to your SM FW project:
smct.py --versionShow the help message with all available options:
smct.py --helpConvert an existing CFG file to header files (the most common use case):
smct.py -c ../configs/mx95evk.cfg -o my_project -fThis generates C header files in sm_fw_root/configs/my_project/ ready for firmware compilation.
For complete project setup with JSON intermediate files for future editing:
smct.py -c ../configs/mx95evk.cfg -o my_project --store_db my_project --store_conf my_project --store_log my_project -fValidate the existing CFG configuration and generate an enhanced CFG file with complete configuration and detailed comments:
smct.py -c ../configs/mx95evk.cfg --store_cfg_file ../configs/mx95evk_complete.cfg --store_log my_project -fThis creates a comprehensive CFG file with all available parameters, descriptions, and validation results - It can be used for documentation and sharing configurations.
Check the generated files:
- Header files:
sm_fw_root/configs/my_project/config_*.h - JSON config:
sm_fw_root/configs/my_project/smct_configs/user_configuration.json - Enhanced CFG:
sm_fw_root/configs/mx95evk_complete.cfg(if using step 4) - Validation log:
sm_fw_root/configs/my_project/smct_configs/error_log.json
- Modify configuration: Edit
user_configuration.jsonand regenerate with-i my_project -o my_project -f - Validate changes: Check
error_log.jsonfor any configuration issues - Share configurations: Use enhanced CFG files for better team collaboration
- Integration: Include generated headers in your SM FW build
The SM FW Makefile uses the SMCT environment variable to locate the SMCT CLI configuration tool during make cfg execution. Either pass a relative path to the SMCT tool when invoking make, or set the SMCT environment variable to an absolute path to the tool. The Makefile automatically verifies Python and the tool functionality and uses the SMCT if possible, otherwise it falls back to using the legacy configtool.pl.
Using Makefile, compile the SM firmware application with the specified configuration in CFG using the SMCT CLI:
make cfg config=mx95evk SMCT=../smctAlternatively:
make all config=mx95evk SMCT=../smctFor more details, see the SM FW documentation.
| Task | Command Pattern | Example |
|---|---|---|
| CFG β Headers | -c CFG -o DIR -f |
smct.py -c mx95evk.cfg -o my_proj -f |
| CFG β JSON + Headers | -c CFG -o DIR --store_* DIR -f |
smct.py -c mx95evk.cfg -o proj --store_conf proj -f |
| JSON β Headers | -i DIR -o DIR -f |
smct.py -i proj -o proj -f |
| CFG β Extended CFG | -c CFG --store_cfg_file DIR |
smct.py -c mx95evk.cfg --store_cfg_file ../configs/mx95evk_ext.cfg |
| Validate Only | -c CFG --store_log DIR |
smct.py -c mx95evk.cfg --store_log validation |
The following options can be used to run SMCT CLI
-v, --version Show the version of the SMCT CLI tool.
Parameters: None (flag only)
-h, --help Show the help message with all available options and exit.
Parameters: None (flag only)
--sm_dir Overwrite the root directory of the System Manager FW repository/project, default: '[this_tool_path]/..'.
Parameters: Absolute or relative path string
Example: --sm_dir /path/to/sm_fw_root
--soc_dir Overwrite the directory to SoC static resources (sm_model), default: '[this_tool_path]/sm_model'. This option is supported for the SM GUI tool.
Parameters: Path to SoC resources named sm_model
Example: --soc_dir /path/to/soc_resources
-c, --load_cfg Load the System Manager user configuration from the board CFG file.
Parameters: Absolute path to the .cfg file or the configuration file name to be found in the loaded SM FW project
Example: -c ../configs/mx95evk.cfg or -c mx95evk.cfg
-i, --input Load the System Manager user configuration from the JSON file by setting the input directory of the user_configuration.json file located in 'smct_configs'.
Parameters: Absolute/relative path to the 'smct_configs' directory or a path relative to the 'sm_fw_root/configs/' path
Example: -i project_name or -i /absolute/path/to/project_name
-o, --output Generate output by setting the output directory where configuration header files are stored (requires --force flag if directory exists).
Parameters: Absolute/relative path to store the generated output or a path relative to the default 'sm_fw_root/configs/' path
Example: -o project_name or -o /path/to/project_name
--store_db Store JSON database files 'atomic_resources.json', 'macro_resources.json' and 'chip_data.json'
to the 'smct_configs' folder (requires --force flag if directory exists).
Parameters: Absolute/relative path where the 'smct_configs' directory is created or a path relative to the 'sm_fw_root/configs/' path
Example: --store_db project_name or --store_db /path/to/project_name
--store_conf Store user configuration 'user_configuration.json'
to the 'smct_configs' folder (requires --force flag if directory exists).
Parameters: Absolute/relative path where the 'smct_configs' directory is created or a path relative to the 'sm_fw_root/configs/' path
Example: --store_conf project_name or --store_conf /path/to/project_name
--store_log Store problem reports log 'error_log.json'
to the 'smct_configs' folder (requires --force flag if directory exists).
Parameters: Absolute/relative path where the 'smct_configs' directory is created or a path relative to the 'sm_fw_root/configs/' path
Example: --store_log project_name or --store_log /path/to/project_name
--store_cfg_file Store the existing configuration in the original CFG file format. Specify a full path to the destination file with the .cfg extension.
(requires --force flag if file exists)
Parameters: Full file path where the new CFG is stored.
Example: --store_cfg_file output/board_config.cfg
-l, --load_device Load SM FW files related to a specific device. This option requires additional options -d/--device and -b/--board to be specified.
The purpose is to parse device files in the SM GUI tool.
Parameters: None (flag only)
-b, --board Enforce a specific board name (identifier) that exists in the 'sm_fw_root/boards' directory.
Parameters: SM FW board identifier
Example: -b mcimx95evk
-d, --device Enforce a specific device/SoC name (identifier) that exists in the 'sm_fw_root/devices' directory.
Parameters: SM FW device (SoC) identifier
Example: -d MIMX95
-f, --force Force overwriting of existing output files. It applies to all stored JSON files and generated source code output.
**Warning:** it overwrites all files without confirmation.
Parameters: None (flag only)
Options that require a PATH parameter, such as -i, --input, -o, --output and storage options support:
- Simple project names: Resolved relative to the
configsfolder in the SM FW project root - Absolute paths: Full filesystem paths for temporary or custom locations
- Relative paths: Relative to the current working directory
The SMCT tool works with three main types of JSON files stored in the smct_configs subfolder:
- Purpose: Contains complete hardware resource definitions and capabilities
- Files: atomic_resources.json, macro_resources.json, chip_data.json
- Content:
- Atomic resources: pins, clocks, power domains, ...
- Macro resources - hardware peripheral definitions
- SoC-specific resource constraints - Default configurations - Generated from: SM header files and SoC model definitions
- Usage: Serves as the foundation for configuration validation and generation
- Purpose: Contains user-specific board configuration choices
- Files: user_configuration.json
- Content:
- User-selected board configuration parameters
- Custom board-specific definitions - Generated from: Board CFG files (for example, mx95evk.cfg)
- Usage: Defines the actual configuration to be applied to the target board
- Purpose: Contains validation results, information, warnings, and error reports from configuration processing
- Files: error_log.json
- Content:
- Configuration validation errors and warnings
- Processing status and diagnostic information
- Troubleshooting details for failed operations - Generated from: SMCT validation and processing operations
- Usage: Provides detailed feedback for debugging configuration issues and ensuring system reliability.
Error log analysis
The error_log.json file contains structured error information:
- π΄
fatals: Critical issues that prevent from processing (tool stops) - π
errors: Issues that cause compilation or build failures - π‘
warnings: Non-critical issues that may affect functionality - βΉοΈ
info: Processing status and diagnostic information
π imx-smct/ β SM Config Tool CLI root
β βββ π smct.py β Main SMCT CLI tool
β βββ π readme.md β SMCT documentation
β βββ π sm_model/ β SM and SOC resource files
β βββ π smct/ β SMCT source code modules
β
π sm_fw_root/ β SM Firmware root
βββ π configs/
β βββ π my_project/ β Your project folder, generated files (for example, mx95evk)
β βββ π smct_configs/ β JSON database and config
β β βββ π user_configuration.json β Board configuration (edit this file)
β β βββ π atomic_resources.json β Hardware low-level resources
β β βββ π macro_resources.json β Peripheral definitions, subsystems
β β βββ π chip_data.json β SoC information
β β βββ π error_log.json β Validation results
β βββ π config_*.h β Generated headers
βββ π devices/ β Supported SM FW devices
β βββ π [device_name]/ β SoC/device-specific definitions (for example, MIMX95)
β βββ π sm/ β Device header files
β βββ π configtool/ β Device CFG files
βββ π boards/ β Supported SM FW boards
βββ π [board_name]/ β Board-specific definitions (for example, mcimx95evk)
βββ π sm/ β Board header files
Directory descriptions:
- configs/project_name/: The user project workspace containing JSON database, configurations, and generated output files.
- devices/: Contains SoC/device-specific hardware definitions and capabilities for different chip families stored as SM FW header files and configuration tool CFG definitions.
- boards/: Contains board-specific hardware layout, pin assignments, and peripheral connections for different development boards stored as SM FW header files.
Convert the CFG configuration file to a JSON format and generate the output configuration headers:
smct.py -c ../configs/mx95evk.cfg -o project_name --store_db project_name --store_conf project_name --store_log project_name -fWhat this does:
- Loads the board configuration from the CFG file
- Generates configuration header files in the output directory
- Creates a JSON resource database for future use
- Creates a JSON user configuration for future modifications
- Creates a JSON problem report log
- Forces overwrite of existing files
Note: To refresh (update) database only, omit --store_conf option to run the command without overwriting of existing (modified) user configuration. Otherwise, the original configuration defined in mx95evk.cfg is used.
Regenerate header files from previously created JSON files:
smct.py -i project_name -o project_name --store_log project_nameWhat this does:
- Reads JSON files from
project_name/smct_configs/ - Generates fresh configuration header files
- Preserves the existing JSON configuration files
- Updates the validation log with processing results
Export the existing JSON configuration to a CFG format with additional comments and complete configuration, including the device.cfg default settings:
smct.py -i project_name --store_cfg_file output/enhanced_board_config.cfg --store_log project_name -fWhat this does:
- Reads the existing JSON configuration files from
project_name/smct_configs/ - Exports the configuration in a legacy CFG format with enhanced comments
- Includes a superset of all available configuration parameters
- Adds descriptive comments for better understanding
- Creates a validation log for export process
- Useful for documentation, sharing configurations, or creating configurations used in automation builds such as Yocto
Process and re-export the CFG file directly with enhanced formatting and comments:
smct.py -c ../configs/mx95evk.cfg --store_cfg_file output/enhanced_mx95evk.cfg --store_log project_name -fWhat this does:
- Loads the original CFG file and processes it through SMCT
- Re-exports CFG with enhanced comments and formatting
- Includes superset of configuration parameters with descriptions
- Validates the original configuration and adds helpful annotations
- Creates a validation log with processing results and any issues found
- Creates an improved CFG file for better readability and documentation
Use absolute paths for temporary or non-standard locations:
smct.py -i C:\Temp\sm\my_project -o C:\Temp\sm\my_project_outputRequirements:
- The input directory must contain the
smct_configssubfolder with valid JSON files - The output directory is created if it does not exist
Direct conversion without JSON intermediate files (legacy mode):
smct.py -c ../configs/mx95evk.cfg -o mx95evk -fWhat this does:
- Converts CFG directly into header files
- Skips creation of intermediate JSON files
- Ensures compatibility with the legacy perl script workflow
- Provides the fastest option for generating output configurations
- Ensure that SMCT is properly located in relation to to your SM FW project or use the
--sm_diroption to set the valid SM FW project directory with every command - Run
smct.py --versionto verify installation and compatibility
- Create a board CFG file or modify a similar existing board CFG file, for example from
../configs/directory - Run:
smct.py -c board.cfg -o board_name --store_db board_name --store_conf board_name --store_log board_name -f - Review generated headers (and, optionally, JSON files)
- Optionally, modify the JSON user configuration as needed and regenerate:
smct.py -i board_name -o board_name --store_log board_name -f
- Edit the JSON user configuration file manually
- Regenerate headers:
smct.py -i project_name -o project_name --store_log project_name -f - Test and repeat as needed
- Import the existing configuration:
smct.py -c mx95evk.cfg --store_cfg_file mx95evk_extended.cfg --store_log mx95evk -f - Review the validation log for any issues or warnings
- Use a validated re-exported CFG file to review the complete configuration
- Validate the configuration automatically:
smct.py -c ${BOARD_CONFIG} --store_log ci_validation_${BUILD_ID} - Generate build headers:
smct.py -c ${BOARD_CONFIG} -o ${OUTPUT_DIR} -f - Archive an extended configuration:
smct.py -c ${BOARD_CONFIG} --store_cfg_file artifacts/${BOARD_NAME}_${BUILD_ID}.cfg -f
Note: This flow can be executed in one single command.
The SM application can be fully compiled using the Makefile. For more details, see the SM FW documentation.
- Create a board CFG file, modify a similar existing board CFG file or export an extended CFG configuration
- Run:
make cfg config=mx95evk SMCT=../smctormake all config=mx95evk SMCT=../smct
Note: The SMCT variable can be configured in the mak file or passed as a command-line argument to specify the path to the SMCT tool. Make sure that it points to the correct relative or absolute path of the SMCT CLI tool. See the Quick start's guide Section 7 above for more details.
| Error Message | Cause | Solution |
|---|---|---|
SM FW root directory not found |
SMCT cannot find the SM firmware project | Use --sm_dir /path/to/sm_fw or ensure SMCT is in the correct location |
Permission denied |
Files already exist | Add -f flag to force overwrite |
Configuration validation failed |
Invalid CFG parameters | Check error_log.json for specific issues |
Python version not supported |
Python < 3.10 | Upgrade to Python 3.10+ |