Skip to main content

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.

AbstractionDescription
JSON FileHighest level of abstraction. Depicts a superset of use-cases.
Command GroupUse-case level. Depicts a series of commands that is used to achieve one outcome.
CommandLowest level of abstraction. Depicts a single command to execute.

JSON File

Structure

{    
"schema-version": 1.0,
"content": [
// add command groups here
]
}

Properties

NameTypeOptional/RequiredDescription
schema-versionnumberrequiredVersion of syntax used in JSON file.
contentlistrequiredList 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

NameTypeOptional/RequiredDescription
namestringrequiredCommand Group name. Used for readability and debugging purposes.
descriptionstringoptionalCommand Group description. Used for readability purposes only.
enabledbooleanoptionalEnabling Command Group can be enabled or disabled. Disabled command group will not be executed. Default: false.
commandslistrequiredList 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

NameTypeOptional/RequiredDescription
commandstringrequiredCommand name. Available values: add-signature, custom-script, extract-payload, hex-segment, merge, shift and sign.
inputslistrequiredCommand inputs. Different commands may have different requirements for this field.
outputslistoptionalCommand 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

NameTypeOptional / RequiredDescription
projectstringrequiredProject 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_namestringrequiredSpecifies the output launch config name in the form [debug_config_name] Debug [probe].
build_dependencystringoptionalSpecifies whether the generated launch config should build a particular project or the entire application. Default is "project". Valid values are "project" or "application".
defaultbooleanoptionalIf set to true, this hex file will be used for make program and the Program Application config. Default is "false".
extra_elf_pathstringoptionalAllows 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"]
}
]
}
]
}
]
}