JSON description
The commands for Run config command are accepted through JSON file interface. These include:
Hierarchy
JSON file introduces several layers of abstractions that serve different purposes.
| Abstraction | Description |
|---|---|
| JSON File | Highest level of abstraction. Depicts a superset of use-cases. |
| Command Group | Use-case level. Depicts a series of commands that is used to achieve one outcome. |
| Command | Lowest level of abstraction. Depicts a single command to execute. |
JSON File
Structure
{
"schema-version": 1.0,
"content": [
// add command groups here
]
}
Properties
| Name | Type | Optional/Required | Description |
|---|---|---|---|
| schema-version | number | required | Version of syntax used in JSON file. |
| content | list | required | List of command group objects. |
Command Group
Structure
{
"name": "Command Group Name", // Command Group name
"description": "Command Group Description", // Command Group description
"enabled": true, // Enable or Disable this Command Group
"commands": [
// add commands here
]
}
Properties
| Name | Type | Optional/Required | Description |
|---|---|---|---|
| name | string | required | Command Group name. Used for readability and debugging purposes. |
| description | string | optional | Command Group description. Used for readability purposes only. |
| enabled | boolean | optional | Enabling Command Group can be enabled or disabled. Disabled command group will not be executed. Default: false. |
| commands | list | required | List of command objects. |
Command
Structure
{
"command": "extract-payload", // Command name
"inputs": [ // Command inputs
{
"description": "Input description",
"file": "input.hex"
}
],
"outputs": [ // Command outputs
{
"description": "Output description",
"file": "output.bin"
}
]
}
Properties
| Name | Type | Optional/Required | Description |
|---|---|---|---|
| command | string | required | Command name. Available values: add-signature, custom-script, extract-payload, hex-segment, merge, shift and sign. |
| inputs | list | required | Command inputs. Different commands may have different requirements for this field. |
| outputs | list | optional | Command outputs. Different commands may have different requirements for this field. |
Example
{
"schema-version": 1.0,
"content": [
{
"name": "Shift command example",
"description": "Shifts a hex segment to a secondary address",
"enabled": true,
"commands": [
{
"command": "shift",
"inputs": [
{
"description": "CM33 Secure + CM33 Non-Secure application",
"file": "rram_3.hex",
"address" : "0x32030000"
}
],
"outputs": [
{
"description": "CM33 Secure + CM33 Non-Secure application shifted to secure region",
"address": "0x3202A000",
"file": "shifted_rram_3.hex"
}
]
}
]
}
]
}
Generating extra launch configurations
When you create a new ModusToolbox™ project, it contains set of common launch configurations. When customizing output hex files, you may need to generate additional Eclipse or VS Code Debug launch configurations for the specific hex files. To do this, insert a special "extra_config" section into the json file. Then, regenerate the launch configurations. For Eclipse, click the "Generate Launches for ..." link in the Quick Panel, or run "make eclipse" in a bash terminal (modus-shell for Windows). For VS Code, run "make vscode".
Extra_config properties
| Name | Type | Optional / Required | Description |
|---|---|---|---|
| project | string | required | Project name that requires debugging. (This is used to determine the main elf file. The debug session will start from the beginning of main() defined in this elf). The launch config will be bound to this project. |
| debug_config_name | string | required | Specifies the output launch config name in the form [debug_config_name] Debug [probe]. |
| build_dependency | string | optional | Specifies whether the generated launch config should build a particular project or the entire application. Default is "project". Valid values are "project" or "application". |
| default | boolean | optional | If set to true, this hex file will be used for make program and the Program Application config. Default is "false". |
| extra_elf_path | string | optional | Allows you to set additional elf file(s) to be used for debugging. It requires the path to the extra elf file relative to the Application-level directory. Supported for TrustZone-enabled devices. |
Extra_config example
{
"schema-version": 1.0,
"content": [
{
"name": "Shift command example",
"description": "Shifts a hex segment to a secondary address",
"enabled": true,
"commands": [
{
"command": "shift",
"inputs": [
{
"description": "CM33 Secure + CM33 Non-Secure application",
"file": "rram_3.hex",
"address" : "0x32030000"
}
],
"outputs": [
{
"description": "CM33 Secure + CM33 Non-Secure application shifted to secure region",
"address": "0x3202A000",
"file": "shifted_rram_3.hex"
}
],
"extra_config": [
{
"project": "proj_cm0p",
"debug_config_name": "Debug_proj_cm0p",
"build_dependency": "application",
"default": true,
"extra_elf_path": ["proj_cm33_ns/build/$(TARGET) /Debug/proj_cm33_ns.elf"]
}
]
}
]
}
]
}