SEGGER Embedded Studio external-tool configuration files are structured using XML syntax for its simple construction and parsing.

Tool configuration files

The SEGGER Embedded Studio application will read the tool configuration file when it starts up. By default, SEGGER Embedded Studio will read the file $(StudioUserDir)/tools.xml.

Structure

All tools are wrapped in a tools element:

<tools></tools>

Inside the tools element are item elements that define each tool:

<tools>
  <item name="logical name"></item>
</tools>

The item element requires an name attribute, which is an internal name for the tool, and has an optional wait element. When SEGGER Embedded Studio invokes the tool on a file or project, it uses the wait element to determine whether it should wait for the external tool to complete before continuing. If the wait attribute is not provided or is set to yes, SEGGER Embedded Studio will wait for external tool to complete.

The way that the tool is presented in SEGGER Embedded Studio is configured by elements inside the

menu

The menu element defines the wording used inside menus. You can place a shortcut to the menu using an ampersand, which must be escaped using &amp in XML, before the shortcut letter. For instance:

<menu>&amp;PC-lint (Unit Check)</menu>
text

The optional text element defines the wording used in contexts other than menus, for instance when the tool appears as a tool button with a label. If text is not provided, the tool's textual appearance outside the menu is taken from the menu element (and is presented without an shortcut underline). For instance:

<text>PC-lint (Unit Check)</text>
tip

The optional tip element defines the status tip, shown on the status line, when moving over the tool inside SEGGER Embedded Studio:

<tip>Run a PC-lint unit checkout on the selected file or folder</tip>
key

The optional key element defines the accelerator key, or key chord, to use to invoke the tool using the keyboard. You can construct the key sequence using modifiers Ctrl, Shift, and Alt, and can specify more than one key in a sequence (note: Windows and Linux only; OS X does not provide key chords). For instance:

<key>Ctrl+L, Ctrl+I</key>
message

The optional message element defines the text shown in the tool log in SEGGER Embedded Studio when running the tool. For example:

<message>Linting</message>
match

The optional match element defines which documents the tool will operator on. The match is performed using the file extension of the document. If the file extension of the document matches one of the wildcards provided, the tool will run on that document. If there is no match element, the tool will run on all documents. For instance:

<match>*.c;*.cpp</match>
output

The optional output element defines the name of the output file created by the tool. If this element is specified the the output file will be opened in the editor when the tool has finished execution. The macros $(InputPath) and $(InputBaseName) can be used to name the output file. For Instance:

<output>$(InputBaseName).txt</output>
commands

The commands element defines the command line to run to invoke the tool. The command line is expanded using macros applicable to the file derived from the current build configuration and the project settings. Most importantly, the standard $(InputPath) macro expands to a full pathname for the target file.

Additional macros constructed by SEGGER Embedded Studio are:

For instance:

<commands>
  &quot;$(LINTDIR)/lint-nt&quot; -i$(LINTDIR)/lnt &quot;$(LINTDIR)/lnt/co-gcc.lnt&quot;
  $(DEFINES) $(INCLUDES) -D__GNUC__ -u -b +macros -w2 -e537 +fie +ffn -width(0,4) -hF1
  &quot;-format=%f:%l:%C:s%t:s%m&quot; &quot;$(InputPath)&quot;
</commands>

In this example we intend $(LINTDIR) to point to the directly where PC-lint is installed and for $(LINTDIR) to be defined as a SEGGER Embedded Studio global macro. You can set global macros using Tools > Options > Building > Global Macros.

Note that additional &quot entities are placed around pathnames in the commands section—this is to ensure that paths that contain spaces are correctly interpreted when the command is executed by SEGGER Embedded Studio.