0% found this document useful (0 votes)
102 views440 pages

EmbeddedStudio Manual

Uploaded by

James Nelson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views440 pages

EmbeddedStudio Manual

Uploaded by

James Nelson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 440

Embedded Studio for

ARM Reference Manual


Version: 6.32b

Copyright 2014-2022 SEGGER Microcontroller GmbH


Copyright 1997-2022 Rowley Associates Ltd.
Embedded Studio for ARM Reference Manual

2
Embedded Studio for ARM Reference Manual Contents

Contents
Introduction ............................................................................................................................................................................................... 11
What is SEGGER Embedded Studio for ARM? ............................................................................................................... 12
What we don't tell you ........................................................................................................................................................... 14
Getting Started ........................................................................................................................................................................... 15
Text conventions ....................................................................................................................................................................... 16
SEGGER Embedded Studio User Guide .......................................................................................................................................... 19
SEGGER Embedded Studio standard layout ................................................................................................................. 20
Menu bar ........................................................................................................................................................................ 21
Title bar ........................................................................................................................................................................... 22
Status bar ....................................................................................................................................................................... 23
Editing workspace ...................................................................................................................................................... 25
Docking windows ....................................................................................................................................................... 26
Dashboard ...................................................................................................................................................................... 27
SEGGER Embedded Studio help and assistance .......................................................................................................... 28
Creating and managing projects ....................................................................................................................................... 30
Solutions and projects .............................................................................................................................................. 31
Creating a project ....................................................................................................................................................... 34
Adding existing files to a project ........................................................................................................................ 35
Adding new files to a project ................................................................................................................................ 36
Removing a file, folder, project, or project link ............................................................................................. 37
Building your application ...................................................................................................................................................... 38
Creating variants using configurations ............................................................................................................ 40
Project options ............................................................................................................................................................. 42

3
Embedded Studio for ARM Reference Manual Contents

Configurations and project options ................................................................................................................... 44


Project macros ............................................................................................................................................................. 46
Dependencies and build order ............................................................................................................................. 48
Linking and section placement ............................................................................................................................ 49
Using source control ................................................................................................................................................................ 52
Source control capabilities ..................................................................................................................................... 53
Configuring source-control providers ............................................................................................................... 54
Connecting to the source-control system ....................................................................................................... 55
File source-control status ........................................................................................................................................ 56
Source-control operations ...................................................................................................................................... 57
Adding files to source control .............................................................................................................................. 58
Updating files ............................................................................................................................................................... 59
Committing files .......................................................................................................................................................... 60
Reverting files ............................................................................................................................................................... 61
Locking files .................................................................................................................................................................. 62
Unlocking files .............................................................................................................................................................. 63
Removing files from source control ................................................................................................................... 64
Showing differences between files ..................................................................................................................... 65
Source-control properties ....................................................................................................................................... 66
Subversion provider .................................................................................................................................................. 67
CVS provider ................................................................................................................................................................. 69
Package management ............................................................................................................................................................ 71
Exploring your application ................................................................................................................................................... 75
Project explorer ........................................................................................................................................................... 76
Source navigator window ....................................................................................................................................... 81
References window .................................................................................................................................................... 83
Symbol browser window ......................................................................................................................................... 84
Stack usage window .................................................................................................................................................. 89
Memory usage window ............................................................................................................................................ 90
Bookmarks window ................................................................................................................................................... 93
Code Outline Window .............................................................................................................................................. 94
Analyzing Source Code ............................................................................................................................................ 95
Editing your code ...................................................................................................................................................................... 96
Basic editing .................................................................................................................................................................. 97
Moving the insertion point ...................................................................................................................... 98
Adding text ................................................................................................................................................... 100
Deleting text ................................................................................................................................................ 101
Using the clipboard .................................................................................................................................. 102
Undo and redo ............................................................................................................................................ 103
Drag and drop ............................................................................................................................................. 104
Searching ....................................................................................................................................................... 105

4
Embedded Studio for ARM Reference Manual Contents

Advanced editing ..................................................................................................................................................... 106


Indenting source code ............................................................................................................................. 107
Commenting out sections of code ..................................................................................................... 109
Adjusting letter case ................................................................................................................................ 110
Using bookmarks ...................................................................................................................................................... 111
Find and Replace window .................................................................................................................................... 113
Clipboard Ring window ......................................................................................................................................... 115
Mouse-click accelerators ....................................................................................................................................... 117
Regular expressions ................................................................................................................................................ 119
Debugging windows ............................................................................................................................................................. 121
Locals window ........................................................................................................................................................... 121
Globals window ........................................................................................................................................................ 123
Watch window ........................................................................................................................................................... 125
Register window ....................................................................................................................................................... 128
Memory window ....................................................................................................................................................... 131
Breakpoints window ............................................................................................................................................... 135
Call Stack window .................................................................................................................................................... 139
Threads window ....................................................................................................................................................... 142
Execution Profile window ..................................................................................................................................... 146
Execution Trace window ....................................................................................................................................... 147
Debug file search editor ........................................................................................................................................ 148
Debug Terminal window ...................................................................................................................................... 150
Breakpoint expressions ........................................................................................................................................................ 151
Debug expressions ................................................................................................................................................................. 152
Utility windows ........................................................................................................................................................................ 153
Terminal emulator window ................................................................................................................................. 153
Command-line options ....................................................................................................................................................................... 155
-D (Define macro) ................................................................................................................................................................... 156
-noclang (Disable Clang support) .................................................................................................................................... 157
-noload (Disable loading of last project) ..................................................................................................................... 158
-packagesdir (Specify packages directory) .................................................................................................................. 159
-permit-multiple-studio-instances (Permit multiple studio instances) ........................................................... 160
-rootuserdir (Set the root user data directory) .......................................................................................................... 161
-save-settings-off (Disable saving of environment settings) ............................................................................... 162
-set-setting (Set environment setting) .......................................................................................................................... 163
-templatesfile (Set project templates path) ................................................................................................................ 164
Uninstalling SEGGER Embedded Studio for ARM ................................................................................................................... 165
ARM target support ............................................................................................................................................................................. 169
Target startup code ............................................................................................................................................................... 171
Startup code .............................................................................................................................................................................. 173
Section Placement .................................................................................................................................................................. 176

5
Embedded Studio for ARM Reference Manual Contents

Using the SEGGER Assembler .......................................................................................................................................................... 179


Using the SEGGER Linker ................................................................................................................................................................... 181
Using the SEGGER Runtime Library .............................................................................................................................................. 183
C++ Library User Guide ...................................................................................................................................................................... 185
Standard template library .................................................................................................................................................. 187
Subset API reference ............................................................................................................................................................. 188
<new> - memory allocation ................................................................................................................................ 189
operator delete ......................................................................................................................................................... 190
operator new .............................................................................................................................................................. 191
set_new_handler ...................................................................................................................................................... 192
Utilities Reference ................................................................................................................................................................................. 193
Compiler driver ........................................................................................................................................................................ 194
File naming conventions ...................................................................................................................................... 195
Command-line options .......................................................................................................................................... 196
-allow-multiple-definition (Allow multiple symbol definition) .............................................. 197
-ansi (Warn about potential ANSI problems) ................................................................................. 198
-ar (Archive output) .................................................................................................................................. 199
-arch (ARM architecture) ......................................................................................................................... 200
-be (ARM Big Endian) ............................................................................................................................... 201
-builtins (Use Builtins) .............................................................................................................................. 202
-c (Compile to object code, do not link) .......................................................................................... 203
-clang (Use clang compiler/assembler) ............................................................................................ 204
-cmselib (ARM Create CMSE import library) .................................................................................. 205
-codec (Set file codec) .............................................................................................................................. 206
-common (Allocate globals in common) ......................................................................................... 207
-cpu (ARM cpu core) ................................................................................................................................. 208
-d (Define linker symbol) ........................................................................................................................ 209
-debugio (ARM Define debugio implementation) ....................................................................... 210
-depend (Generate dependency file) ................................................................................................ 211
-D (Define macro symbol) ...................................................................................................................... 212
-emit-relocs (Emit relocations) ............................................................................................................. 213
-e (Set entry point symbol) .................................................................................................................... 214
-exceptions (Enable C++ Exception Support) ................................................................................ 215
-E (Preprocess) ............................................................................................................................................. 216
-fill (Fill gaps) ............................................................................................................................................... 217
-fabi (ARM Floating Point Code Generation) ................................................................................. 218
-fpu (ARM FPU) ........................................................................................................................................... 219
-framepointer (Enable generation of framepointer) .................................................................. 220
-F (Set output format) .............................................................................................................................. 221
-g (Generate debugging information) .............................................................................................. 222
-hascmse (ARM Generate cmse instructions) ................................................................................ 223

6
Embedded Studio for ARM Reference Manual Contents

-hascrc (ARM Generate crc instructions) .......................................................................................... 224


-hascrypto (ARM Generate crypto instructions) ........................................................................... 225
-hasdsp (ARM Generate dsp instructions) ...................................................................................... 226
-hasidiv (ARM Generate integer divide instructions) ................................................................. 227
-hassmallmultiplier (ARM Do not generate multiply instructions) ....................................... 228
-help (Display help information) ......................................................................................................... 229
-instrument (Instrument functions) ................................................................................................... 230
-I (Define user include directories) ..................................................................................................... 231
-I- (Exclude standard include directories) ....................................................................................... 232
-J (Define system include directories) ............................................................................................... 233
-kasm (Keep assembly code) ................................................................................................................ 234
-kldscript (Keep linker script) ............................................................................................................... 235
-kpp (Keep preprocessor output) ....................................................................................................... 236
-K (Keep linker symbol) ........................................................................................................................... 237
-l- (Do not link standard libraries) ...................................................................................................... 238
-longcalls (ARM Generate long calling sequences) ..................................................................... 239
-lto (Enable link time optimization) ................................................................................................... 240
-L (Set library directory path) ............................................................................................................... 241
-memorymap (Memory map file) ........................................................................................................ 242
-memorymapmacros (Memory map macros) ................................................................................ 243
-M (Display linkage map) ....................................................................................................................... 244
-n (Dry run, no execution) ...................................................................................................................... 245
-nointerwork (ARM No interwork code for v4t) ............................................................................ 246
-nowarn-mismatch (ARM No warning on architecture mismatch) ....................................... 247
-nowarn-enumsize (ARM No warning on enum size mismatch) ............................................ 248
-nowarn-wcharsize (ARM No warning on wide character size mismatch) ......................... 249
-nostderr (No stderr output) ................................................................................................................. 250
-O (Optimize output) ................................................................................................................................ 251
-o (Set output file name) ........................................................................................................................ 252
-patch (Run patch command) ............................................................................................................... 253
-placement (Section placement file) ................................................................................................. 254
-placementmacros (Section placement macros) .......................................................................... 255
-placementsegments (Section placement segments) ................................................................ 256
-printf (Select printf capability) ........................................................................................................... 257
-rtti (Enable C++ RTTI Support) ........................................................................................................... 258
-R (Set section name) ............................................................................................................................... 259
-scanf (Select scanf capability) ............................................................................................................. 260
-segger (Use SEGGER assembler/compiler/linker) ....................................................................... 261
-shortenums (ARM Minimal sized enums) ...................................................................................... 262
-shortwchar (ARM 16-bit wide chars) ................................................................................................ 263
-simd (ARM Generate vector processing code) ............................................................................ 264

7
Embedded Studio for ARM Reference Manual Contents

-std (Select language standard) .......................................................................................................... 265


-strip (Strip symbols from executable) ............................................................................................. 266
-symbols (Link symbols) ......................................................................................................................... 267
-thumb (ARM Generate thumb code) ............................................................................................... 268
-T (Supply linker script) ........................................................................................................................... 269
-U (Undefine macro symbol) ................................................................................................................. 270
-unwindtables (Generate unwind tables) ....................................................................................... 271
-v (Verbose execution) ............................................................................................................................. 272
-vectorize (ARM Generate vector processing code) .................................................................... 273
-w (Suppress warnings) ........................................................................................................................... 274
-we (Treat warnings as errors) ............................................................................................................. 275
-W (Pass option to tool) .......................................................................................................................... 276
-x (Specify file types) ................................................................................................................................ 277
Command-Line Project Builder ........................................................................................................................................ 278
Building with a SEGGER Embedded Studio project file ........................................................................... 279
Building without a SEGGER Embedded Studio project file .................................................................... 281
Command-line options .......................................................................................................................................... 282
-batch (Batch build) .................................................................................................................................. 283
-config (Select build configuration) ................................................................................................... 284
-clean (Remove output files) ................................................................................................................. 285
-D (Define macro) ...................................................................................................................................... 286
-echo (Show command lines) ............................................................................................................... 287
-file (Build a named file) ......................................................................................................................... 288
-packagesdir (Specify packages directory) ..................................................................................... 289
-project (Specify project to build) ...................................................................................................... 290
-property (Set project property) ......................................................................................................... 291
-rebuild (Always rebuild) ........................................................................................................................ 292
-show (Dry run, don't execute) ............................................................................................................ 293
-solution (Specify solution to build) .................................................................................................. 294
-studiodir (Specify SEGGER Embedded Studio directory) ........................................................ 295
-template (Specify project template) ................................................................................................ 296
-time (Time the build) .............................................................................................................................. 297
-threadnum (Specify number of build threads) ............................................................................ 298
-type (Specify project type) ................................................................................................................... 299
-verbose (Show build information) .................................................................................................... 300
Command-Line Simulator ................................................................................................................................................... 301
Command-line options .......................................................................................................................................... 302
file (Elf executable file) ............................................................................................................................ 303
-segments (Specify memory segments) ........................................................................................... 304
args (User arguments) ............................................................................................................................. 305
Command-Line Scripting .................................................................................................................................................... 306

8
Embedded Studio for ARM Reference Manual Contents

Command-line options .......................................................................................................................................... 307


-define (Define global variable) ........................................................................................................... 308
-help (Show usage) ................................................................................................................................... 309
-load (Load script file) .............................................................................................................................. 310
-define (Verbose output) ........................................................................................................................ 311
emScript classes ........................................................................................................................................................ 312
Example uses .............................................................................................................................................................. 313
Embed .......................................................................................................................................................................................... 314
Command-Line License Manager .................................................................................................................................... 315
Linker script file generator ................................................................................................................................................. 316
Command-line options .......................................................................................................................................... 317
-check-section-overflow .......................................................................................................................... 318
-check-segment-overflow ....................................................................................................................... 319
-disable-missing-runin-error ................................................................................................................. 320
-memory-map-file ...................................................................................................................................... 321
-memory-map-macros ............................................................................................................................. 322
-no-check-unplaced-sections ................................................................................................................ 323
-section-placement-file ............................................................................................................................ 324
-section-placement-macros ................................................................................................................... 325
-symbols ......................................................................................................................................................... 326
Package generator ................................................................................................................................................................. 327
Package manager ................................................................................................................................................................... 329
Appendices ............................................................................................................................................................................................... 331
Technical ..................................................................................................................................................................................... 332
File formats ................................................................................................................................................................. 332
Memory Map file format ......................................................................................................................... 333
Section Placement file format .............................................................................................................. 335
Project file format ...................................................................................................................................... 337
Project Templates file format ............................................................................................................... 338
Property Groups file format .................................................................................................................. 340
Package Description file format .......................................................................................................... 342
External Tools file format ....................................................................................................................... 346
Debugger Type Interpretation file format ...................................................................................... 349
Environment Options ............................................................................................................................................. 351
Building Environment Options ............................................................................................................ 351
Debugging Environment Options ...................................................................................................... 353
IDE Environment Options ...................................................................................................................... 356
Programming Language Environment Options ........................................................................... 362
Source Control Environment Options ............................................................................................... 365
Text Editor Environment Options ....................................................................................................... 367
Windows Environment Options .......................................................................................................... 379

9
Embedded Studio for ARM Reference Manual Contents

Project Options ......................................................................................................................................................... 390


Code Options ............................................................................................................................................... 390
Debug Options ............................................................................................................................................ 418
Macros ........................................................................................................................................................................... 426
System Macros ............................................................................................................................................ 426
Build Macros ................................................................................................................................................. 429
Script classes .............................................................................................................................................................. 434
BinaryFile ....................................................................................................................................................... 434
CWSys .............................................................................................................................................................. 435
Debug .............................................................................................................................................................. 436
ElfFile ............................................................................................................................................................... 437
TargetInterface ............................................................................................................................................ 438
WScript ........................................................................................................................................................... 440

10
Embedded Studio for ARM Reference Manual Introduction

Introduction
This guide is divided into a number of sections:

Introduction
Covers installing SEGGER Embedded Studio for ARM on your machine and verifying that it operates
correctly, followed by a brief guide to the operation of the SEGGER Embedded Studio integrated
development environment, debugger, and other software supplied in the product.

SEGGER Embedded Studio User Guide


Contains information on how to use the SEGGER Embedded Studio development environment to manage
your projects, build, and debug your applications.

library_reference
Contains documentation for the functions in the standard C library supplied in SEGGER Embedded Studio
for ARM.

ARM target support


Contains a description of system files used for startup and debugging of ARM applications.

11
Embedded Studio for ARM Reference Manual Introduction

What is SEGGER Embedded Studio for ARM?


SEGGER Embedded Studio for ARM is a complete C/C++ development system for ARM and Cortex,
microcontrollers and microprocessors that runs on Windows, Mac OS and Linux.

C/C++ Compiler
SEGGER Embedded Studio for ARM comes with pre-built versions of both GCC and Clang/LLVM C and C++
compilers and assemblers. The GNU linker and librarian are also supplied to enable you to immediately begin
developing applications for ARM.

SEGGER Embedded Studio for ARM C Library


SEGGER Embedded Studio for ARM has its own royalty-free ANSI and ISO C compliant C library that has been
specifically designed for use within embedded systems.

SEGGER Embedded Studio for ARM C++ Library


SEGGER Embedded Studio for ARM supplies a C++ library that implements STL containers, exceptions and RTTI.

SEGGER Embedded Studio IDE


SEGGER Embedded Studio for ARM is a streamlined integrated development environment for building, testing,
and deploying your applications. SEGGER Embedded Studio provides:

Source Code Editor:A powerful source code editor with multi-level undo and redo, makes editing your
code a breeze.
Project System:A complete project system organizes your source code and build rules.
Build System:With a single key press you can build all your applications in a solution, ready for them to be
loaded onto a target microcontroller.
Debugger and Flash Programming:You can download your programs directly into Flash and debug them
seamlessly from within the IDE using a wide range of target interfaces.
Help system:The built-in help system provides context-sensitive help and a complete reference to the
SEGGER Embedded Studio IDE and tools.
Core Simulator:As well as providing cross-compilation technology, SEGGER Embedded Studio for ARM
provides a PC-based fully functional simulation of the target microcontroller core so you can debug parts
of your application without waiting for hardware.

12
Embedded Studio for ARM Reference Manual Introduction

SEGGER Embedded Studio for ARM Tools


SEGGER Embedded Studio for ARM supplies command line tools that enable you to build your application on
the command line using the same project file that the IDE uses.

13
Embedded Studio for ARM Reference Manual Introduction

What we don't tell you


This documentation does not attempt to teach the C or assembly language programming; rather, you should
seek out one of the many introductory texts available. And similarly the documentation doesn't cover the ARM
architecture or microcontroller application development in any great depth.

We also assume that you're fairly familiar with the operating system of the host computer being used.

C programming guides
These are must-have books for any C programmer:

Kernighan, B.W. and Ritchie, D.M., The C Programming Language (2nd edition, 1988). Prentice-Hall,
Englewood Cliffs, NJ, USA. ISBN 0-13-110362-8.
The original C bible, updated to cover the essentials of ANSI C (1990 version).
Harbison, S.P. and Steele, G.L., C: A Reference Manual (second edition, 1987). Prentice-Hall, Englewood
Cliffs, NJ, USA. ISBN 0-13-109802-0.
A nice reference guide to C, including a useful amount of information on ANSI C. Co-authored by Guy
Steele, a noted language expert.

ANSI C reference
If you're serious about C programming, you may want to have the ISO standard on hand:

ISO/IEC 9899:1990, C Standard and ISO/IEC 9899:1999, C Standard. The standard is available from your
national standards body or directly from ISO at http://www.iso.ch/.

ARM microcontrollers
For ARM technical reference manuals, specifications, user guides and white papers, go to:

http://www.arm.com/Documentation.

GNU compiler collection


For the latest GCC documentation go to:

http://gcc.gnu.org/.

LLVM/Clang
For the latest LLVM/Clang documentation to to:

http://www.llvm.org

14
Embedded Studio for ARM Reference Manual Introduction

Getting Started
You will need to install a CPU support package:

Choose Tools > Package Manager


Choose the CPU support packages you wish to install and complete the dialog.

You will need to create a project:

Choose File > New Project


Select the appropriate Executable project type
Specify a location for the project
Complete the dialog selecting the appropriate Target Processor value

You will need to build the project:

Choose Build | Build 'Project'

To debug on the simulator

Choose Project | Options... to show the project options dialog


In the Search Options type in Simulator
Choose Simulator for the Target Connection option

To debug on hardware

Choose Project | Options... to show the project options dialog


In the Search Options type in J-Link
Choose J-Link for the Target Connection option

To start debugging

Choose Debug | Go

The debugger will stop the program at the main, you can now debug the application.

15
Embedded Studio for ARM Reference Manual Introduction

Text conventions
Menus and user interface elements
When this document refers to any user interface element, it will do so in bold font. For instance, you will often
see reference to the Project Explorer, which is taken to mean the project explorer window. Similarly, you'll see
references to the Standard toolbar which is positioned at the top of the SEGGER Embedded Studio window, just
below the menu bar on Windows and Linux.

When you are directed to select an item from a menu in SEGGER Embedded Studio, we use the form menu-
name > item-name. For instance, File > Save means that you need to click the File menu in the menu bar and
then select the Save item. This form extends to items in sub-menus, so File > Open With Binary Editor has the
obvious meaning.

Keyboard accelerators
Frequently-used commands are assigned keyboard accelerators to speed up common tasks. SEGGER Embedded
Studio uses standard Windows and Mac OS keyboard accelerators wherever possible.

Windows and Linux have three key modifiers which are Ctrl, Alt, and Shift. For instance, Ctrl+Alt+P means that
you should hold down the Ctrl and Alt buttons whilst pressing the P key; and Shift+F5 means that you should
hold down the Shift key whilst pressing F5.

Mac OS has four key modifiers which are (command), (option), (control), and (shift). Generally there is a one-
to-one correspondence between the Windows modifiers and the Mac OS modifiers: Ctrl is , Alt is , and Shift
is . SEGGER Embedded Studio on Mac OS has its own set of unique key sequences using (control) that have no
direct Windows equivalent.

SEGGER Embedded Studio on Windows and Linux also uses key chords to expand the set of accelerators. Key
chords are key sequences composed of two or more key presses. For instance, the key chord Ctrl+T, D means
that you should type Ctrl+T followed by D; and Ctrl+K, Ctrl+Z means that you should type Ctrl+T followed by
Ctrl+Z. Mac OS does not support accelerator key chords.

Code examples and human interaction


Throughout the documentation, text printed in this typeface represents verbatim communication with the
computer: for example, pieces of C text, commands to the operating system, or responses from the computer.
In examples, text printed in this typeface is not to be used verbatim: it represents a class of items, one of which
should be used. For example, this is the format of one kind of compilation command:

hcl source-file

This means that the command consists of:

The word hcl, typed exactly like that.


A source-file: not the text source-file, but an item of the source-file class, for example myprog.c.

16
Embedded Studio for ARM Reference Manual Introduction

Whenever commands to and responses from the computer are mixed in the same example, the commands
(i.e. the items which you enter) will be presented in this typeface. For example, here is a dialog with the
computer using the format of the compilation command given above:

c:\code\examples>hcl -v myprog.c

The user types the text hcl -v myprog.c and then presses the enter key (which is assumed and is not shown); the
computer responds with the rest.

17
Embedded Studio for ARM Reference Manual Introduction

18
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

SEGGER Embedded Studio User Guide


This is the user guide for the SEGGER Embedded Studio integrated development environment (IDE). The SEGGER
Embedded Studio IDE consists of:

a project system to organize your source files


a build system to build your applications
programmer aids to navigate and work effectively
a target programmer to download applications into RAM or flash
a debugger to pinpoint bugs

19
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

SEGGER Embedded Studio standard layout


SEGGER Embedded Studio's main window is divided into the following areas:

Title bar:Displays the name of the current solution.


Menu bar:Menus for editing, building, and debugging your program.
Toolbars:Frequently used actions are quickly accessible on toolbars below the menu bar.
Editing area:A tabbed view of any open editor windows and the HTML viewer.
Docked windows:SEGGER Embedded Studio has many windows that dock to the left, right, or below the
editing area. You can configure which windows will be visible, and their placement, when editing and
debugging.
Status bar At the bottom of the main window, the status bar contains useful information about the
current editor, build status, and debugging environment.

20
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Menu bar
The menu bar contains menus for editing, building, and debugging your program. You can navigate menus
using the keyboard or the mouse.

Navigating menus using the mouse

To navigate menus using the mouse:

1. Click a menu title in the menu bar to show the related menu.
2. Click the desired command in the menu to execute that command.

or

1. Click and hold the mouse on a menu title in the menu bar to show the related menu.
2. Drag the mouse to the desired command in the menu.
3. Release the mouse while it is over the command to execute that command.

Navigating menus with the keyboard

To navigate menus using the keyboard:

1. Tap the Alt key activate the menu bar.


2. Tap Return to display the menu.
3. Use the Left and Right keys to select the required menu.
4. Use the Up or Down key to select the required command or submenu.
5. Press Enter to execute the selected command.
6. Press Alt or Esc at any time to cancel menu selection.

After you press the Alt key once, each menu on the menu bar has one letter underlinedits shortcut key. So, to
activate a menu using the keyboard:

While holding down the Alt key, type the desired menu's shortcut key.

After the menu appears, you can navigate it using the cursor keys:

Use Up and Down to move up and down the list of menu items.
Use Esc to cancel a menu.
Use Right or Enter to open a submenu.
Use Left or Esc to close a submenu and return to the parent menu.
Type the underlined letter in a command's name to execute that command.

21
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Title bar
The first item shown in the title bar is SEGGER Embedded Studio's name. Because SEGGER Embedded Studio
can be used to target different processors, the name of the target processor family is also shown, to help you
distinguish between instances of SEGGER Embedded Studio when debugging multi-processor or multi-core
systems.

The filename of the active editor follows SEGGER Embedded Studio's name; you can configure the presentation
of this filename as described below.

After the filename, the title bar displays status information on SEGGER Embedded Studio's state:

[building] SEGGER Embedded Studio is building a solution, building a project, or compiling a file.
[run] An application is running under control of SEGGER Embedded Studio's debugger.
[break] The debugger is stopped at a breakpoint.
[autostep] The debugger is single stepping the application without user interaction (autostepping).

22
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Status bar
At the bottom of the window, the status bar contains useful information about the current editor, build status,
and debugging environment. The status bar is divided into two regions: one contains a set of fixed panels and
the other is used for messages.

The message area

The leftmost part of the status bar is a message area used for things such as status tips, progress information,
warnings, errors, and other notifications.

Status bar panels

You can show or hide the following panels on the status bar:

Panel Description
Displays the connected target interface. When
connected, this panel contains the selected target
interface's name and, if applicable, the processor to
which the target interface is connected. The LED icon
Target device status flashes green when a program is running, is solid red
when stopped at a breakpoint, and is yellow when
connected to a target but not running a program.
Double-clicking this panel displays the Targets pane,
and right-clicking it invokes the Target shortcut menu.
Cycle count panel Displays the number of processor cycles used by the
executing program. This panel is only visible if the
connected target supports performance counters
that can report the total number of cycles executed.
Double-clicking this panel resets the cycle counter to
zero, and right-clicking it brings up the Cycle Count
shortcut menu.
Insert/overwrite status Indicates whether the current editor is in insert or
overwrite mode. In overwrite mode, the panel displays
"OVR"; in insert mode, the panel displays "INS".
Read-only status Indicates whether the editor is in read-only mode. If
the editor is editing a read-only file or is in read-only
mode, the panel display "R/O"; if the editor is in read-
write mode, the panel displays "R/W".
Build status Indicates the success or failure of the last build. If
the last build completed without errors or warnings,
the build status pane contains Built OK; otherwise, it
contains the number of errors and warnings reported.
If there were errors, double-clicking this panel displays
the Build Log in the Output pane.

23
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Caret position Indicates the insertion position position in the editor


window. For text files, the caret position pane displays
the line number and column number of the insertion
point in the active window; when editing binary files, it
displays the address being edited.
Time panel Displays the current time.

Configuring the status bar panels


To configure which panels are shown on the status bar:

Choose View > Status Bar.


From the status bar menu, select the panels to display and deselect the ones you want hidden.

or

Right-click the status bar.


From the status bar menu, select the panels to display and deselect the ones you want to hide.

To show or hide the status bar:

Choose View > Status Bar.


From the status bar menu, select or deselect the Status Bar item.

You can choose to hide or display the size grip when SEGGER Embedded Studio's main window is not maximized.
(The size grip is never shown in full-screen mode or when maximized.)

To show or hide the size grip

Choose View > Status Bar.


From the status bar menu, select or deselect the Size Grip item.

24
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Editing workspace
The main area of SEGGER Embedded Studio is the editing workspace. It contains any files being edited, the on-
line help system's HTML browser, and the Dashboard.

25
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Docking windows
SEGGER Embedded Studio has a flexible docking system you can use to position windows as you like them. You
can dock windows in the SEGGER Embedded Studio window or in the four head-up display windows. SEGGER
Embedded Studio will remember the position of the windows when you leave the IDE and will restore them
when you return.

Window groups
You can organize SEGGER Embedded Studio windows into window groups. A window group has multiple
windows docked in it, only one of which is active at a time. The window group displays the active window's title
for each of the windows docked in the group.

Clicking on the window icons in the window group's header changes the active window. Hovering over a
docked window's icon in the header will display that window's title in a tooltip.

To dock a window to a different window group:

Press and hold the left mouse button over the title of the window you wish to move.
As you start dragging, all window groups, including hidden window groups, become visible.
Drag the window over the window group to dock in.
Release the mouse button.

Holding Ctrl when moving the window will prevent the window from being docked. If you do not dock a
window on a window group, the window will float in a new window group.

Perspectives
SEGGER Embedded Studio remembers the dock position and visibility of each window in each perspective. The
most common use for this is to lay your windows out in the Standard perspective, which is the perspective
used when you are editing and not debugging. When SEGGER Embedded Studio starts to debug a program,
it switches to the Debug perspective. You can now lay out your windows in this perspective and SEGGER
Embedded Studio will remember how you laid them them out. When you stop debugging, SEGGER Embedded
Studio will revert to the Standard perspective and that window layout for editing; when you return to Debug
perspective on the next debug session, the windows will be restored to how you laid them out in that for
debugging.

SEGGER Embedded Studio remembers the layout of windows, in all perspectives, such that they can be restored
when you run SEGGER Embedded Studio again. However, you may wish to revert back to the standard docking
positions; to do this:

26
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Dashboard
When SEGGER Embedded Studio starts, it presents the Dashboard, a collection of panels that provide useful
information, one-click loading of recent projects, and at-a-glance summaries of activity relevant to you.

Tasks
The Tasks panel indicates tasks you need to carry out before SEGGER Embedded Studio for ARM is fully
functionalfor instance, whether you need to activate SEGGER Embedded Studio for ARM, install packages, and so
on.

Updates
The Updates panel indicates whether any packages you have installed are now out of date because a newer
version is available. You can install each new package individually by clicking the Install button under each
notification, or install all packages by clicking the Install all updates link at the bottom of the panel.

Projects
The Projects panel contains links to projects you have worked on recently. You can load a project by clicking the
appropriate link, or clear the project history by clicking the Clear List button. To manage the contents of the list,
click the Manage Projects link and edit the list of projects in the Recent Projects window.

News
The News panel summarizes the activity of any RSS and Atom feeds you have subscribed to. Clicking a link will
display the published article in an external web browser. You can manage your feed subscriptions to by clicking
the Manage Feeds link at the end of the News panel and pinning the feeds in the Favorites windowyou are only
subscribed to the pinned feeds.

Links
The Links panel is a handy set of links to your favorite websites. If you pin a link in the Favorites window, it
appears in the Links panel.

27
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

SEGGER Embedded Studio help and assistance


SEGGER Embedded Studio provides context-sensitive help in increasing detail:

Tooltips
When you position the pointer over a button and keep it still, a small window displays a brief description of
the button and its keyboard shortcut, if it has one.

Status tips
In addition to tooltips, SEGGER Embedded Studio provides a longer description in the status bar when you
hover over a button or menu item.

Online manual
SEGGER Embedded Studio has links from all windows to the online help system.

The browser
Documentation pages are shown in the Browser.

Help using SEGGER Embedded Studio


SEGGER Embedded Studio provides an extensive, HTML-based help system that is available at all times.

To view the help text for a particular window or other user-interface element:
Click to select the item with which you want assistance.
Choose Help > Help or press F1.

Help within the text editor


The text editor is linked to the help system in a special way. If you place the insertion point within a word and
press F1, the help-system page most likely to be useful is displayed in the HTML browser. This a great way to
quickly find the help text for functions provided in the library.

Browsing the documentation


The Contents window lists all the topics in the SEGGER Embedded Studio for ARM documentation and gives a
way to search through them.

The highlighted entry indicates the current help topic. When you click a topic, the corresponding page appears
in the Browser window.

28
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

The Next Topic and Previous Topic items in the Help menu, or the buttons on the Contents window toolbar,
help navigate through topics.

To search the online documentation, type a search phrase into the Search box on the Contents window toolbar.

To search the online documentation:

Choose Help > Contents or press Ctrl+Alt+F1.


Enter your search phrase in the Search box and press Enter (or Return on Macs).

The search commences and the table of contents is replaced by links to pages matching your query, listed in
order of relevance. To clear the search and return to the table of contents, click the clear icon in the Search box.

29
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Creating and managing projects


A SEGGER Embedded Studio project is a container for everything required to build your applications. It contains
all the assorted resources and maintains the relationships between them.

A project is a convenient place to find every file and piece of information associated with your work. You place
projects into a solution, which can contain one or more projects.

This chapter introduces the various parts of a project, shows how to create projects, and describes how to
organize the contents of a project. It describes how to use the Project Explorer and Project Manager for project-
management tasks.

30
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Solutions and projects


To develop a product using SEGGER Embedded Studio, you must understand the concepts of projects and
solutions.

A project contains and organizes everything you need to create a single application or a library.

A solution is a collection of projects and configurations.

Organizing your projects into a solution allows you to build all the projects in a solution with a single keystroke,
and to load them onto the target ready for debugging.

In your SEGGER Embedded Studio for ARM project, you

organize build-system inputs for building a product.


add information about items in the project, and their relationships, to assist you in the development
process.

Projects in a solution can reside in the same or different directories. Project directories are always relative to the
directory of the solution file, which enables you to more-easily move or share project-file hierarchies.

The Project Explorer organizes your projects and files, and provides quick access to the commands that operate
on them. A toolbar at the top of the window offers quick access to commonly used commands.

Solutions
When you have created a solution, it is stored in a project file. Project files are text files, with the file extension
emProject, that contain an XML description of your project. See Project file format for a description of the
project-file format.

Projects
The projects you create within a solution have a project type SEGGER Embedded Studio uses to determine how
to build the project. The project type is selected when you use the New Project dialog. The available project
types depend on the SEGGER Embedded Studio for ARM variant you are using, but the following are present in
most SEGGER Embedded Studio for ARM variants:

Executable: a program that can be loaded and executed.


Externally Built Executable: an executable that is not built by the SEGGER Embedded Studio for ARM
internal build process.
Library: a group of object files collected into a single file (sometimes called an archive).
Externally Built Library: a library that is not built by the SEGGER Embedded Studio for ARM internal build
process.

31
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Object File: the result of a single compilation.


Staging: a project that will apply a user-defined command to each file in a project.
Combining: a project that can be used to apply a user-defined command when any files in a project have
changed.

Project options and configurations


Project options are attached to project nodes. They are usually used in the build process, for example, to define
C preprocessor symbols. You can assign different values to the same project option, based on a configuration:
for example, you can assign one value to a C preprocessor symbol for release build and a different value for a
debug build.

Folders and Dynamic Folders


Projects can contain folders, which are used to group related files. Automated grouping uses the files' extensions
to, for example, put all .c files in one folder, etc. Grouping also can be done manually by explicitly creating a
file within a folder. Note that these project folders do not map onto directories in the file system, they are used
solely to structure the display of content shown in the Project Explorer.

Projects can also contain dynamic folders which will can show the directories and files contained in the file
system in the project explorer. You can specify if the dynamic folder is recursive and use wildcards to include and
exclude files.

Source files
Source files are all the files used to build a product. These include source code files and also section-placement
files, memory-map files, and script files. All the source files you use for a particular product, or for a suite of
related products, are managed in a SEGGER Embedded Studio project. A project can also contain files that
are not directly used by SEGGER Embedded Studio to build a product but contain information you use during
development, such as documentation. You edit source files during development using SEGGER Embedded
Studio's built-in text editor, and you organize files into a target (described next) to define the build-system
inputs for creating the product.

The source files of your project can be placed in folders or directly in the project. Ideally, the paths to files
placed in a project should be relative to the project directory, but at times you might want to refer to a file in an
absolute location and this is supported by the project system.

When you add a file to a project, the project system detects whether the file is in the project directory. If a
file is not in the project directory, the project system tries to make a relative path from the file to the project
directory. If the file isn't relative to the project directory, the project system detects whether the file is relative to

32
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

the $(StudioDir) directory; if so, the filename is defined using $(StudioDir). If a file is not relative to the project
directory or to $(StudioDir), the full, absolute pathname is used.

The project system will allow (with a warning) duplicate files to be put into a project.

The project system uses a file's extension to determine the appropriate build action to perform on the file:

A file with the extension .c will be compiled by a C compiler.


A file with the extension .cpp or .cxx will be compiled by a C++ compiler.
A file with the extension .s or .asm will be compiled by an assembler.
A file with the object-file extension .o will be linked.
A file with the library-file extension .a will be linked.
A file with the extension .xml will be opened and its file type determined by the XML document type.
Files with other file extensions will not be compiled or linked.

You can modify this behavior by setting a file's File Type project option with the Common configuration
selected, which enables files with non-standard extensions to be compiled by the project system.

Externally Built Executables


You can use an external build process for Externally Built Executable project types by setting the Build
Command project option, for example to make target. Alternatively you can set command lines for specific
build steps to compile/assemble and link. When you create an Externally Built Executable project type
configurations will be created that create command lines for a variety of external tool chains.

Solution links
You can create links to existing project files from a solution, which enables you to create hierarchical builds. For
example, you could have a solution that builds a library together with a stub test driver executable. You can
link to that solution from your current solution by right-clicking the solution node of the Project Explorer and
selecting Add Existing Project. Your current solution can then use the library built by the other project.

Session files
When you exit SEGGER Embedded Studio for ARM, details of your current session are stored in a session file.
Session files are text files, with the file extension emSession, that contain details such as which files you have
opened in the editor and what breakpoints you have set in the Breakpoint window.

33
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Creating a project
You can create a new solution for each project or place multiple projects in an existing solution.

To create a new project in an existing solution:

1. Choose Project > Add New Project.


2. In the New Project wizard, select the type of project you wish to create and specify where it will be
placed.
3. Ensure that Add the project to current solution is checked.
4. Click OK to go to next stage or Cancel to cancel the project's creation.

The project name must be unique to the solution and, ideally, the project directory should be relative to the
solution directory. The project system will use the project directory as the current directory when it builds your
project. Once complete, the Project Explorer displays the new solution, project, and files contained in the
project. To add another project to the solution, repeat the above steps.

To create a new project in a new solution:

1. Choose File > New Project or press Ctrl+Shift+N.


2. Select the type of project you wish to create and where it will be placed.
3. Click OK.

34
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Adding existing files to a project


You can add existing files to a project in a number of ways.

To add existing files to the active project:

Choose Project > Add Existing File or press Ctrl+P, A.

Using the Open File dialog, navigate to the directory containing the files and select the ones you wish to add to
the project.

Click OK.

The selected files are added to the folders whose filter matches the extension of each of the files. If no filter
matches a file's extension, the file is placed underneath the project node.

To add existing files to a specific project:

1. In the Project Explorer, right-click the project to which you wish to add a new file.
2. Choose Add Existing File.

To add existing files to a specific folder:

1. In the Project Explorer, right-click the folder to which you wish to add a new file.
2. Choose Add Existing File.

The files are added to the specified folder without using filter matching.

To create a dynamic folder:

1. In the Project Explore, right click on the project to which you wish to add a new folder.
2. Choose New Folder....
3. Using the New Folder dialog name the folder and then show the dynamic folder options.
4. Specify the required Source Folder and the Filter Specification.

The files that match the filter specification in the source folder will appear in the newly created folder.

35
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Adding new files to a project


You can add new files to a project in a number of ways.

To add new files to the active project:

Choose Project > Add New File or press Ctrl+N.

To add a new file to a project:

1. In the Project Explorer, right-click the project to which you wish to add a new file.
2. Choose Add New File.

When adding a new file, SEGGER Embedded Studio displays the New File dialog, from which you can choose
the type of file to add, its filename, and where it will be stored. Once created, the new file is added to the folder
whose filter matches the extension of the newly added file. If no filter matches the newly added file extension,
the new file is placed underneath the project node.

To add new files to a folder:

1. In the Project Explorer, right-click the folder to which you wish to add a new file.
2. Choose Add New File.

The new file is added to the folder without using filter matching.

36
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Removing a file, folder, project, or project link


You can remove whole projects, folders, or files from a project, or you can remove a project from a solution,
using the Remove button on the Project Explorer toolbar. Note that removing a source file from a project does
not remove it from disk.

To remove an item from the solution:

1. In the Project Explorer, select the item to remove.


2. Choose Edit > Delete or press Del.

or

1. In the Project Explorer, right-click the item to remove.


2. Choose Remove.

37
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Building your application


SEGGER Embedded Studio builds your application using the resources and build rules it finds in your solution.

When SEGGER Embedded Studio builds your application, it tries to avoid building files that have not changed
since they were last built. It does this by comparing the modification dates of the generated files with the
modification dates of the dependent files together with the modification dates of the project options that
pertain to the build. But if you are copying files, sometimes the modification dates may not be updated when
the file is copiedin this instance, it is wise to use the Rebuild command rather than the Build command.

You can see the build rationale SEGGER Embedded Studio currently is using by setting the Environment
Options > Building > Show Build Information environment option. To see the build commands themselves, set
the Environment Options > Building > Echo Build Command environment option.

You may have a solution that contains several interdependent projects. Typically, you might have several
executable projects and some library projects. The Project Dependencies dialog specifies the dependencies
between projects and to see the effect of those dependencies on the solution build order. Note that
dependencies can be set on a per-configuration basis, but the default is for dependencies to be defined in the
Common configuration.

You will also notice that a new folder titled Dependencies has appeared in the Project Explorer. This folder
contains the list of newly generated files and the files from which they were generated. To see if one of files
can be decoded and displayed in the editor, right-click the file to see if the View command is available on the
shortcut menu.

If you have the Symbols window open, it will be updated with the symbol and section information of all
executable files built in the solution.

To generalize your builds, you can define macro values that are substituted when the project options are used.
These macro values can be defined globally at the solution and project level, and can be defined on a per-
configuration basis.

The combination of configurations, project options with inheritance, dependencies, and macros provides a
very powerful build-management system. However, such systems can become complicated. To understand the
implications of changing build settings, right-click a node in the Project Explorer and select Options to view a
dialog that shows which macros and project options apply to that project node.

To build all projects in the solution:

1. Choose Build > Build Solution or press Shift+F7.

or

1. Right-click the solution in the Project Explorer window.


2. Choose Build from the shortcut menu.

38
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

To build a single project:

1. Select the required project in the Project Explorer.


2. Choose Build > Build or press F7.

or

1. Right-click the project in the Project Explorer.


2. Choose Build.

To compile a single file:

1. In the Project Explorer, click to select the source file to compile.


2. Choose Build > Compile or press Ctrl+F7.

or

1. In the Project Explorer, right-click the source file to compile.


2. Choose Compile from the shortcut menu.

Correcting errors after building


The results of a build are recorded in a Build Log that is displayed in the Output window. Errors are highlighted
in red, warnings are highlighted in yellow. Double-clicking an error, warning, or note will move the insertion
point to the line of source code that triggered that log entry.

You can move forward and backward through errors using Search > Next Location and Search > Next Location.

When you build a single project in a single configuration, the Transcript will display the memory used by the
application and a summary for each memory area.

39
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Creating variants using configurations


SEGGER Embedded Studio provides a facility to build projects in various configurations. Project configurations
are used to create different software builds for your projects.

A configuration defines a set of project options. For example, the output of a compilation can be put into
different directories, dependent upon the configuration. When you create a solution, some default project
configurations are created.

Build configurations and their uses


Configurations are typically used to differentiate debug builds from release builds. For example, the compiler
options for debug builds will differ from those of a release build: a debug build will set options so the project can
be debugged easily, whereas a release build will enable optimization to reduce program size or to increase its
speed. Configurations have other uses; for example, you can use configurations to produce variants of software,
such as custom libraries for several different hardware variants.

Configurations inherit project options from other configurations. This provides a single point of change for
definitions common to several configurations. A particular project option can be overridden in a particular
configuration to provide configuration-specific settings.

When a solution is created, two configurations are generated Debug and Release and you can create additional
configurations by choosing Build > Build Configurations. Before you build, ensure that the appropriate
configuration is set using Build > Set Active Build Configuration or, alternatively, the Active Configuration
combo box in the Project Explorer.

Selecting a configuration
To set the configuration that affects your building and debugging, use the combo box in the Project Explorer or
select Build > Set Active Build Configuration

Creating a configuration
To create your own configurations, select Build > Build Configurations to invoke the Configurations dialog. The
New button will produce a dialog allowing you to name your configuration. You can now specify the existing
configurations from which your new configuration will inherit values.

Deleting a configuration
You can delete a configuration by selecting it and clicking the Remove button. This deletion cannot be undone
or canceled, so beware.

40
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Private configurations
Some configurations are defined purely for inheriting and, as such, should not appear in the Build combo box.
When you select a configuration in the Configuration dialog, you can choose to hide that configuration.

41
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Project options
For solutions, projects, folders, and files, project options can be defined that are used by the project system in
the build process. These project options can be viewed and modified by using the Options dialog in conjunction
with the Project Explorer.

Some project options are only applicable to a given item type. For example, linker project options are only
applicable to a project that builds an executable file. However, other project options can be applied either at
the file, project, or solution project node. For example, a compiler project option can be applied to a solution,
project, or individual file. By setting a project option at the solution level, you enable all files of the solution to
use that project option's value.

Unique project options


A unique project option has one value. When a build is done, the value of a unique project option is the first one
defined in the project hierarchy. For example, the Treat Warnings As Errors project option could be set to Yes
at the solution level, which would then be applicable to every file in the solution that is compiled, assembled,
and linked. You can then selectively define project options for other project items. For example, a particular
source file may have warnings you decide are allowable, so you set the Treat Warnings As Errors to No for that
particular file.

solution Treat Warnings As Errors = Yes


project1 Treat Warnings As Errors = Yes
file1 Treat Warnings As Errors = Yes
file2 Treat Warnings As Errors = No
project2 Treat Warnings As Errors = No
file1 Treat Warnings As Errors = No
file2 Treat Warnings As Errors = Yes

In the above example, the files will be compiled with these values for Treat Warnings As Errors:

project1/file1 Yes
project1/file2 No
project2/file1 No
project2/file2 Yes

Aggregate project options


An aggregating project option collects all the values defined for it in the project hierarchy. For example, when a
C file is compiled, the Preprocessor Definitions project option will take all the values defined at the file, project,
and solution levels.

solution Preprocessor Definitions = SolutionDef

42
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

project1 Preprocessor Definitions =


file1 Preprocessor Definitions =
file2 Preprocessor Definitions = File1Def
project2 Preprocessor Definitions = ProjectDef
file1 Preprocessor Definitions =
file2 Preprocessor Definitions = File2Def

In the above example, the files will be compiled with these preprocessor definitions:

project1/file1 SolutionDef
project1/file2 SolutionDef, File1Def
project2/file1 SolutionDef, ProjectDef
project2/file2 SolutionDef, ProjectDef, File2Def

43
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Configurations and project options


Project options are defined for a configuration so you can have different values for a project option for
different builds. A given configuration can inherit the project options of other configurations. When the project
system requires a project option value, it checks for the existence of the project option value in the current
configuration and then in the set of inherited configurations. You can specify the set of inherited configurations
using the Configurations dialog.

A special configuration named Common is always inherited by a configuration. The Common configuration
allows you to set project options that will apply to all configurations you create. If you are modifying a project
option of your project, you almost certainly want each configuration to inherit it, so ensure that the Common
configuration is selected.

If the project option is unique, the build system will use the one defined for the particular configuration. If
the project option isn't defined for this configuration, the build system uses an arbitrary one from the set of
inherited configurations.

If the option is still undefined, the build system uses the value for the Common configuration. If it is still
undefined, the build system tries to find the value in the next higher level of the project hierarchy.

solution [Common] Preprocessor Definitions = CommonSolutionDef

solution [Debug] Preprocessor Definitions = DebugSolutionDef

solution [Release] Preprocessor Definitions = ReleaseSolutionDef

project1 - Preprocessor Definitions =

file1 - Preprocessor Definitions =

file2 [Common] Preprocessor Definitions = CommonFile1Def

file2 [Debug] Preprocessor Definitions = DebugFile1Def

project2 [Common] Preprocessor Definitions = ProjectDef

file1 Preprocessor Definitions =

file2 [Common] - Preprocessor Definitions = File2Def

In the above example, the files will be compiled with these preprocessor definitions when in Debug
configuration

File Setting
project1/file1 CommonSolutionDef, DebugSolutionDef
project1/file2 CommonSolutionDef,
DebugSolutionDef,CommonFile1Def, DebugFile1Def
project2/file1 CommonSolutionDef, DebugSolutionDef, ProjectDef

44
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

project2/file2 ComonSolutionDef, DebugSolutionDef, ProjectDef,


File2Def

and the files will be compiled with these Preprocessor Definitions when in Release configuration:

File Setting
project1/file1 CommonSolutionDef, ReleaseSolutionDef
project1/file2 CommonSolutionDef, ReleaseSolutionDef,
CommonFile1Def
project2/file1 CommonSolutionDef, ReleaseSolutionDef, ProjectDef
project2/file2 ComonSolutionDef, ReleaseSolutionDef, ProjectDef,
File2Def

45
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Project macros
You can use macros to modify the way the project system refers to files.

Macros are divided into four classes:

System macros defined by SEGGER Embedded Studio relay information about the environment, such as
paths to common directories.
Global macros are saved in the environment and are shared across all solutions and projects. Typically,
you would set up paths to libraries and any external items here.
Project macros are saved as project options in the project file and can define values specific to the solution
or project in which they are defined.
Build macros are generated by the project system when you build your project.

System macros
System macros are defined by SEGGER Embedded Studio itself and as such are read-only. System macros can be
used in project options, environment settings and to refer to files. See System macros list for the list of System
macros.

Global macros
Global macros are store in the environment option Build Macros.

To define a global macro:


1. Use Tools > Options to show the environment options dialog.
2. In the Environment Options dialog's Building group, select the Build Macros option.
3. Click the ellipsis button on the right.
4. Set the macro using the syntax name = replacement text.

Project macros
To define a project macro:
To set the project macros:

1. Select the appropriate solution/project in the Project Explorer.


2. Use Project > Options to show the project options dialog.
3. In the Project Options dialog's General Options group, select the Macros option.
4. Click the ellipsis button on the right.
5. Set the macro using the syntax name = replacement text.

46
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Build macros
Build macros are defined by the project system for a build of a given project node. See Build macros list for the
list of build macros.

Using macros
You can use a macro for a project option or environment setting by using the $(macro) syntax. For example, the
Object File Name option has a default value of $(IntDir)/$(InputName)$(OBJ).

You can also specify a default value for a macro if it is undefined using the $(macro:default) syntax. For example,
$(MyMacro:0) would expand to 0 if the macro MyMacro has not been defined.

47
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Dependencies and build order


You can set up dependency relationships between projects using the Project Dependencies dialog. Project
dependencies make it possible to build solutions in the correct order and, where the target permits, to load
and delete applications and libraries in the correct order. A typical usage of project dependencies is to make
an executable project dependent upon a library executable. When you elect to build the executable, the build
system will ensure that the library it depends upon is up to date. In the case of a dependent library, the output
file of the library build is supplied as an input to the executable build, so you don't have to worry about it.

Project dependencies are stored as project options and, as such, can be defined differently based upon the
selected configuration. You almost always want project dependencies to be independent of the configuration,
so the Project Dependencies dialog selects the Common configuration by default.

To make one project dependent upon another:

1. Choose Project > Project Dependencies.


2. From the Project dropdown, select the target project that depends upon other projects.
3. In the Depends Upon list box, select the projects the target project depends upon and deselect the
projects it does not depend upon.

Some items in the Depends Upon list box may be dimmed, indicating that a circular dependency would result
if any of those projects were selected. In this way, SEGGER Embedded Studio prevents you from constructing
circular dependencies using the Project Dependencies dialog.

If your target supports loading multiple projects, the Build Order also reflects the order in which projects are
loaded onto the target. Projects will load, in order, from top to bottom. Generally, libraries need to be loaded
before the applications that use them, and you can ensure this happens by making the application dependent
upon the library. With this dependency set, the library gets built and loaded before the application does.

Applications are deleted from a target in reverse of their build order; in this way, applications are removed
before the libraries on which they depend.

48
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Linking and section placement


Executable programs consist of a number of sections. Typically, there are program sections for code, initialized
data, and zeroed data. There is often more than one code section and they must be placed at specific addresses
in memory.

To describe how the program sections of your program are positioned in memory, the SEGGER Embedded
Studio for ARM project system uses memory-map files and section-placement files. These XML-formatted
files are described in Memory Map file format and Section Placement file format. They can be edited with
the SEGGER Embedded Studio for ARM text editor. The memory-map file specifies the start address and size
of target memory segments. The section-placement file specifies where to place program sections in the
target's memory segments. Separating the memory map from the section-placement scheme enables a single
hardware description to be shared across projects and also enables a project to be built for a variety of hardware
descriptions.

For example, a memory-map file representing a device with two memory segments called FLASH and SRAM
could look something like this in the memory-map editor.

<Root name="Device1">
<MemorySegment name="FLASH" start="0x10000000" size="0x10000" />
<MemorySegment name="SRAM" start="0x20000000" size="0x1000" />

A corresponding section-placement file will refer to the memory segments of the memory-map file and will
list the sections to be placed in those segments. This is done by using a memory-segment name in the section-
placement file that matches the corresponding memory-segment name in the memory-map file.

For example, a section-placement file that places a section called .stack in the SRAM segment and the .vectors
and .text sections in the FLASH segment would look like this:

<Root name="Flash Section Placement">


<MemorySegment name="FLASH" >
<ProgramSection name=".vectors" load="Yes" />
<ProgramSection name=".text" load="Yes" />
</MemorySegment>
<MemorySegment name="SRAM" >
<ProgramSection name=".stack" load="No" />
</MemorySegment>
</Root>

Note that the order of section placement within a segment is top down; in this example .vectors is placed at
lower addresses than .text. The order memory segments are processed is bottom up; so in this example the
sections in the SRAM segment will be placed prior to the sections in the FLASH segment.

Multiple memory segments can be specified by separating them with a semicolon. In the following example, the
.stack section will be placed in the SRAM2 memory segment if it exists in the memory map, otherwise it will be
placed in the SRAM memory segment. Sections can only be placed in one segment, they will not be placed in a
second segment when the first is full.

<Root name="Flash Section Placement">

49
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

<MemorySegment name="FLASH" >


<ProgramSection name=".vectors" load="Yes" />
<ProgramSection name=".text" load="Yes" />
</MemorySegment>
<MemorySegment name="SRAM2;SRAM" >
<ProgramSection name=".stack" load="No" />
</MemorySegment>
</Root>

The memory-map file and section-placement file to use for linkage can be included as a part of the project or,
alternatively, they can be specified in the project's linker options.

You can create a new program section using either the assembler or the compiler. For the C/C++ compiler, this
can be achieved using __attribute__ on declarations. For example:

void foobar(void) __attribute__ ((section(".foo")));

This will allocate foobar in the section called .foo. Alternatively, you can specify the names for the code,
constant, data, and zeroed-data sections of an entire compilation unit by using the Section Options options.

You can now place the section into the section placement file using the editor so that it will be located after the
vectors sections as follows:

<Root name="Flash Section Placement">


<MemorySegment name="FLASH">
<ProgramSection name=".vectors" load="Yes" />
<ProgramSection name=".foo" load="Yes" />
<ProgramSection name=".text" load="Yes" />
</MemorySegment>
<MemorySegment name="SRAM">
<ProgramSection name=".stack" load="No" />
</MemorySegment>
</Root>

If you are modifying a section-placement file that is supplied in the SEGGER Embedded Studio for ARM
distribution, you will need to import it into your project using the Project Explorer.

Sections containing code and constant data should have their load project option set to Yes. Some sections
don't require any loading, such as stack sections and zeroed-data sections; such sections should have their load
project option set to No.

Some sections that are loaded then need to be copied to sections that aren't yet loaded. This is required for
initialized data sections and to copy code from slow memory regions to faster ones. To do this, the runin
attribute should contain the name of a section in the section-placement file to which the section will be copied.

For example, initialized data is loaded into the .data section and then is copied into the .data_run section using:

<Root name="Flash Section Placement">


<MemorySegment name="FLASH">
<ProgramSection name=".vectors" load="Yes" />
<ProgramSection name=".text" load="Yes" />
<ProgramSection name=".data" load="Yes" runin=".data_run" />
</MemorySegment>

50
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

<MemorySegment name="SRAM">
<ProgramSection name=".data_run" load="No" />
<ProgramSection name=".stack" load="No" />
</MemorySegment>
</Root>

The startup code will copy the contents of the .data section to the .data_run section. To enable this, symbols
named __section-name_start__, __section-name_end__, __section-name_load_start__ and __section-
name_load_end__ are generated marking the section start, end, load start and load end addresses of each
section. The startup code uses these symbols to copy the sections from their load positions to their run
positions.

You can also create your own load and run section, for example the following placement file adds a .mydata
section:

<Root name="Flash Section Placement">


<MemorySegment name="FLASH">
<ProgramSection name=".vectors" load="Yes" />
<ProgramSection name=".text" load="Yes" />
<ProgramSection name=".data" load="Yes" runin=".data_run" />
<ProgramSection name=".mydata" load="Yes" runin=".mydata_run" />
</MemorySegment>
<MemorySegment name="SRAM">
<ProgramSection name=".data_run" load="No" />
<ProgramSection name=".mydata_run" load="No" />
<ProgramSection name=".stack" load="No" />
</MemorySegment>
</Root>

As the startup code doesn't know about this section, the following code will need to be added to the program to
initialise the section:

/* Section image located in flash */


extern const unsigned char __mydata_load_start__[];
extern const unsigned char __mydata_load_end__[];

/* Where to locate the section image in RAM. */


extern unsigned char __mydata_start__[];
extern unsigned char __mydata_end__[];

...

/* Copy image from flash to RAM. */


memcpy(__mydata_start__,
__mydata_load_start__,
__mydata_end__ - __mydata_start__);

51
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Using source control


Source control is an essential tool for individuals or development teams. SEGGER Embedded Studio integrates
with several popular source-control systems to provide this feature for files in your SEGGER Embedded Studio for
ARM projects.

Source-control capability is implemented by a number of third-party providers, but the set of functions provided
by SEGGER Embedded Studio for ARM aims to be provider independent.

52
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Source control capabilities


The source-control integration capability provides:

Connecting to the source-control repository and mapping files in the SEGGER Embedded Studio for ARM
project to those in source control.
Showing the source-control status of files in the project.
Adding files in the project to source control.
Fetching files in the project from source control.
Optionally locking and unlocking files in the project for editing.
Comparing a file in the project with the latest version in source control.
Updating a file in the project by merging changes from the latest version in source control.
Committing changes made to project files into source control.

53
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Configuring source-control providers


SEGGER Embedded Studio supports Subversion, Git, and Mercurial as source-control systems. To enable
SEGGER Embedded Studio to utilize source-control features, you need to install, on your operating system, the
appropriate command line client for the source-control systems that you will use.

Once you have installed the command line client, you must configure SEGGER Embedded Studio to use it.

To configure Subversion:

1. Choose Tools > Options or press Alt+,.


2. Select the Source Control category in the options dialog.
3. Set the Executable environment option of the Subversion Options group to point to Subversion svn
command. On Windows operating systems, the Subversion command is svn.exe.

To configure Git:

1. Choose Tools > Options or press Alt+,.


2. Select the Source Control category in the options dialog.
3. Set the Executable environment option of the Git Options group to point to Git git command. On
Windows operating systems, the Git command is git.exe.

To configure Mercurial:

1. Choose Tools > Options or press Alt+,.


2. Select the Source Control category in the options dialog.
3. Set the Executable environment option of the Mercurial Options group to point to Git hg command. On
Windows operating systems, the Git command is hg.exe.

54
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Connecting to the source-control system


When SEGGER Embedded Studio loads a project, it examines the file system folder that contains the project to
determine the source-control system the project uses. If SEGGER Embedded Studio cannot determine, from the
file system, the source-control system in use, it disables source-control integration.

That is, if you have not set up the paths to the source-control command line clients, even if a working copy exists
and the appropriate command line client is installed, SEGGER Embedded Studio cannot establish source-control
integration for the project.

User credentials

You can set the credentials that the source-control system uses, for commands that require credentials, using
VCS > Options > Configure. From here you can set the user name and password. These details are saved to the
session file (the password is encrypted) so you won't need to specify this information each time the project is
loaded.

Note

SEGGER Embedded Studio has no facility to create repositories from scratch, nor to clone, pull, or checkout
repositories to a working copy: it is your responsibility to create a working copy outside of SEGGER Embedded
Studio using your selected command-line client or Windows Explorer extension.

The "Tortoise" products are a popular set of tools to provide source-control facilities in the Windows shell. Use
Google to find TortoiseSVN, TortoiseGit, and TortoiseHG and see if you like them.

55
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

File source-control status


Determining the source-control status of a file can be expensive for large repositories, so SEGGER Embedded
Studio for ARM updates the source-control status in the background. Priority is given to items that are displayed.

A file will be in one of the following states:

Clean:The file is in source control and matches the tip revision.


Not Controlled:The file is not in source control.
Conflicted:The file is in conflict with changes made to the repository.
Locked:The file is locked.
Update Available:The file is older than the most-recent version in source control.
Added:The file is scheduled to be added to the repository.
Removed:The file is scheduled to be removed from the repository.

If the file has been modified, its status is displayed in red in the Project Explorer. Note that if a file is not under
the local root, it will not have a source-control status.

You can reset any stored source-control file status by choosing VCS > Refresh.

56
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Source-control operations
Source-control operations can be performed on single files or recursively on multiple files in the Project
Explorer hierarchy. Single-file operations are available on the Source Control toolbar and on the text editor's
shortcut menu. All operations are available using the VCS menu. The operations are described in terms of the
Project Explorer shortcut menu.

57
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Adding files to source control


To add files to the source-control system:

1. In the Project Explorer, select the file to add. If you select a folder, project, or solution, any eligible child
items will also be added to source control.
2. choose Source Control > Add or press Ctrl+R, A.
3. The dialog will list the files that can be added.
4. In that dialog, you can deselect any files you don't want to add to source control.
5. Click Add.

Note

Files are scheduled to be added to source control and will only be committed to source control (and seen by
others) when you commit the file.

Enabling the VCS > Options > Add Immediately option will bypass the dialog and immediately add (but not
commit) the files.

58
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Updating files
To update files from source control:

1. In the Project Explorer, select the file to update. If you select a folder, project, or solution, any eligible
child items will also be updated from source control.
2. choose Source Control > Update or press Ctrl+R, U.
3. The dialog will list the files that can be updated.
4. In that dialog, you can deselect any files you don't want to update from source control.
5. Click Update.

Note

Enabling the VCS > Options > Update Immediately option will bypass the dialog and immediately update the
files.

59
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Committing files
To commit files:

1. In the Project Explorer, select the file to commit. If you select a folder, project, or solution, any eligible
child items will also be committed.
2. Choose Source Control > Commit or press Ctrl+R, C.
3. The dialog will list the files that can be committed.
4. In that dialog, you can deselect any files you don't want to commit and enter an optional comment.
5. Click Commit.

Note

Enabling the VCS > Options > Commit Immediately option will bypass the dialog and immediately commit the
files without a comment.

60
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Reverting files
To revert files:

1. In the Project Explorer, select the file to revert. If you select a folder, project, or solution, any eligible child
items will also be reverted.
2. Choose Source Control > Revert or press Ctrl+R, V.
3. The dialog will list the files that can be reverted.
4. In that dialog, you can deselect any files you don't want to revert.
5. Click Revert.

Note

Enabling the VCS > Options > Revert Immediately option will bypass the dialog and immediately revert files.

61
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Locking files
To lock files:

1. In the Project Explorer, select the file to lock. If you select a folder, project, or solution, any eligible child
items will also be locked.
2. Choose Source Control > Lock or press Ctrl+R, L.
3. The dialog will list the files that can be locked.
4. In that dialog, you can deselect any files you don't want to lock and enter an optional comment.
5. Click Lock.

Note

Enabling the VCS > Options > Lock Immediately option will bypass the dialog and immediately lock files
without a comment.

62
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Unlocking files
To unlock files:

1. In the Project Explorer, select the file to lock. If you select a folder, project, or solution, any eligible child
items will also be unlocked.
2. Choose Source Control > Unlock or press Ctrl+R, N.
3. The dialog will list the files that can be unlocked.
4. In that dialog, you can deselect any files you don't want to unlock.
5. Click Unlock.

Note

Enabling the VCS > Options > Unlock Immediately option will bypass the dialog and immediately unlock files.

63
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Removing files from source control


To remove files from source control:

1. In the Project Explorer, select the file to remove. If you select a folder, project, or solution, any eligible
child items will also be removed.
2. choose Source Control > Remove or press Ctrl+R, R.
3. The dialog will list the files that can be removed.
4. In that dialog, you can deselect any files you don't want to remove.
5. Click Remove.

Note

Files are scheduled to be removed from source control and will still be and seen by others, giving you the
opportunity to revert the removal. When you commit the file, the file is removed from source control.

Enabling the VCS > Options > Remove Immediately option will bypass the dialog and immediately remove (but
not commit) files.

64
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Showing differences between files


To show the differences between the file in the project and the version checked into source control, do the
following:

1. In the Project Explorer, right-click the file.


2. From the shortcut menu, choose Source Control > Show Differences.

You can use an external diff tool in preference to the built-in SEGGER Embedded Studio for ARM diff tool. To
define the diff command line SEGGER Embedded Studio for ARM generates, choose Tools > Options > Source
Control > Diff Command Line. The command line is defined as a list of strings to avoid problems with spaces in
arguments. The diff command line can contain the following macros:

$(localfile):The filename of the file in the project.


$(remotefile):The filename of the latest version of the file in source control.
$(localname):A display name for $(localfile).
$(remotename):A display name for $(remotefile).

65
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Source-control properties
When a file in the project is in source control, the Properties window shows the following properties in the
Source Control Options group:

Property Description
The source-control status of working copy as viewed
SEGGER Embedded Studio Status
by SEGGER Embedded Studio.
last Author The author of the file's head revision.
Path: Relative The item's path relative to the repository root.
Path: Repository The pathname of the file in the source-control system,
typically a URL.
Path: Working Copy The pathname of the file in the working copy.
Provider The name of the source-control system managing this
file.
Provider Status The status of the file as reported by the source-control
provider.
Revision: Local The revision number/name of the local file.
Revision: Remote The revision number/name of the most-recent version
in source control.
Status: In Conflict? If Yes, updates merged into the file using Update
conflict with the changes you made locally; if No,
the file is not locked. When conflicted, must resolve
the conflicts and mark them Resolved before
committing the file.
Status: Locked? If Yes, the file is lock by you; if No, the file is not locked.
Status: Modified? If Yes, the checked-out file differs from the version in
the source control system; if No, they are identical.
Status: Update Available? If Yes, the file in the project location is an old version
compared to the latest version in the source-control
systemuse Update to merge in the latest changes.

66
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Subversion provider
The Subversion source-control provider has been tested with SVN 1.4.3.

Provider-specific options
The following environment options are supported:

Property Description
Executable The path to the svn executable.
Lock Supported If Yes, check out and undo check out operations
are supported. Check out will issue the svn lock
command; check in and undo check out will issue the
svn unlock command.
Authentication Selects whether authentication (user name and
password) is sent with every command.
Show Updates Selects whether the update (-u flag) is sent with
status requests in order to show that new versions are
available in the repository. Note that this requires a
live connection to the repository: if you are working
without a network connection to your repository, you
can disable this switch and continue to enjoy source
control status information in the Project Explorer and
Pending Changes windows.

Connecting to the source-control system


When connecting to source control, the provider checks if the local root is in SVN control. If this is the case, the
local and remote root will be set accordingly. If the local root is not in SVN control after you have set the remote
root, a svn checkout -N command will be issued to make the local root SVN controlled. This command will
also copy any files in the remote root to the local root.

The user name and password you enter will be supplied with each svn command the provider issues.

Source control operations


The SEGGER Embedded Studio for ARM source-control operations are implemented using Subversion
commands. Mapping SEGGER Embedded Studio for ARM source-control operations to Subversion source-
control operations is straightforward:

Operation Command
Commit svn commit for the file, with optional comment.
Update svn update for each file.

67
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Revert svn revert for each file.


Resolved svn resolved for each file.
Lock svn lock for each file, with optional comment.
Unlock svn unlock for each file.
Add svn add for each file.
Remove svn remove for each file.
Source Control Explorer svn list with a remote root. svn mkdir to create
directories in the repository.

68
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

CVS provider
The CVS source-control provider has been tested with CVSNT 2.5.03. The CVS source-control provider uses the
CVS rls command to browse the repositorythis command is implemented in CVS 1.12 but usage of . as the root
of the module name is not supported.

Provider-specific options
The following environment options are supported:

Property Description
CVSROOT The CVSROOT value to access the repository.
Edit/Unedit Supported If Yes, Check Out and Undo Check Out commands
are supported. Any check-out operation will issue the
cvs edit command; any check-in or undo-check-
out operation will issue the cvs unedit command;
the status operation will issue the cvs ss command.
Executable The path to the cvs executable.
Login/Logout Required If Yes, Connect will issue the cvs login command.

Connecting to the source-control system


When connecting to source control, the provider checks if the local root is in CVS control. If this is the case, the
local and remote root will be set accordingly. If the local root is not in CVS control after you have set the remote
root, a cvs checkout -l -d command will be issued to make the local root CVS controlled. This command
will also copy any files in the remote root to the local root.

Source-control operations
The SEGGER Embedded Studio for ARM source-control operations have been implemented using CVS
commands. There are no multiple-file operations, each operation is done on a single file and committed as part
of the operation.

Operation Command
cvs status and optional cvs editors for local
Get Status directories in CVS control. cvs rls -e for directories
in the repository.
Add To Source Control cvs add for each directory not in CVS control.
cvs add for the file. cvs commit for the file and
directories.

69
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Get Latest cvs update -l -d for each directory not in CVS


control. cvs update to merge the local file. cvs
update -C to overwrite the local file.
Check Out Optional cvs update -C to get the latest version.
cvs edit to lock the file.
Undo Check Out cvs unedit to unlock the file. Optional cvs
update to get the latest version.
Check In cvs commit for the file.
Source Control Explorer cvs rls -e with a remote root starting with .. cvs
import to create directories in the repository.

70
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Package management
Additional target-support functions can be added to, and removed from, SEGGER Embedded Studio for ARM
with packages.

A SEGGER Embedded Studio for ARM package is an archive file containing a collection of target-support files.
Installing a package involves copying the files it contains to an appropriate destination directory and registering
the package with SEGGER Embedded Studio for ARM's package system. Keeping target-support files separate
from the main SEGGER Embedded Studio for ARM installation allows us to support new hardware and issue bug
fixes for existing hardware-support files between SEGGER Embedded Studio for ARM releases, and it allows third
parties to develop their own support packages.

Installing packages
Use the Package Manager to automate the download, installation, upgrade and removal of packages.

To activate the Package Manager:

Choose Tools > Manage Packages.

In some situations, such as using SEGGER Embedded Studio for ARM on a computer without Internet access or
when you want to install packages that are not on the website, you cannot use the Package Manager to install
packages and it will be necessary to manually install them.

To manually install a package:

1. Choose Tools > Manually Install Packages.


2. Select one or more package files you want to install.
3. Click Open to install the packages.

Choose Tools > Show Installed Packages to see more information on the installed packages.

The Package Manager window will remove manually installed packages.

The package manager


The Package Manager manages the support packages installed on your system. It lists the available packages,
shows the installed packages, and allows you to install, update, reinstall, and remove them.

71
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

To activate the Package Manager:


Choose Tools > Manage Packages.

Filtering the package list


By default, the Package Manager lists all available and installed packages. You can filter the displayed packages
in a number of ways.

To filter by package status:


Click on the disclosure icon near the top-right corner of the dialog.
Use the pop-up menu to choose how to filter the list of packages.

The list-filter choices are:

Display All Show all packages irrespective of their status.


Display Not Installed Show packages that are available but are not currently installed.

72
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Display Installed Only show packages that are installed.


Display Updates Only show packages that are installed but are not up-to-date because a newer version is
available.

You can also filter the list of packages by the text in the package's title and documentation.

To filter packages by keyword:

Type the keyword into the Search Packages box at the top-left corner of the dialog.

Installing a package
The package-installation operation downloads a package to $(PackagesDir)/downloads, if it has not been
downloaded already, and unpacks the files contained within the package to their destination directory.

To install a package:

1. Choose Tools > Package Manager and set the status filter to Display Not Installed.
2. Select the package or packages you wish to install.
3. Right-click the selected packages and choose Install Selected Packages from the shortcut menu.
4. Click Next; you will be see the actions the Package Manager is about to carry out.
5. Click Next and the Package Manager will install the selected packages.
6. When installation is complete, click Finish to close the Package Manager.

Updating a package
The package-update operation first removes existing package files, then it downloads the updated package to
$(PackagesDir)/downloads and unpacks the files contained within the package to their destination directory.

To update a package:

1. Choose Tools > Package Manager and set the status filter to Display Updates.
2. Select the package or packages you wish to update.
3. Right-click the selected packages and choose Update Selected Packages from the shortcut menu.
4. Click Next; you will see the actions the Package Manager is about to carry out.
5. Click Next and the Package Manager will update the package(s).
6. When the update is complete, click Finish to close the Package Manager.

Removing a package
The package-remove operation removes all the files that were extracted when the package was installed.

73
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

To remove a package:

1. Choose Tools > Package Manager and set the status filter to Display Installed.
2. Select the package or packages you wish to remove.
3. Right-click the selected packages and choose Remove Selected Packages from the shortcut menu.
4. Click Next; you will see the actions the Package Manager is about to carry out.
5. Click Next and the Package Manager will remove the package(s).
6. When the operation is complete, click Finish to close the Package Manager.

Reinstalling a package
The package-reinstall operation carries out a package-remove operation followed by a package-install
operation.

To reinstall a package:

1. Choose Tools > Package Manager and set the status filter to Display Installed.
2. Select the package or packages you wish to reinstall.
3. Right-click the packages to reinstall and choose Reinstall Selected Packages from the shortcut menu.
4. Click Next; you will see the actions the Package Manager is about to carry out.
5. Click Next and the Package Manager will reinstall the packages.
6. When the operation is complete, click Finish to close the Package Manager.

74
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Exploring your application


In this section, we discuss the SEGGER Embedded Studio tools that help you examine how your application is
built.

75
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Project explorer
The Project Explorer is the user interface of the SEGGER Embedded Studio for ARM project system. It organizes
your projects and files and provides access to the commands that operate on them. A toolbar at the top of the
window offers quick access to commonly used commands for the selected project node or the active project.
Right-click to reveal a shortcut menu with a larger set of commands that will work on the selected project node,
ignoring the active project.

The selected project node determines what operations you can perform. For example, the Compile operation
will compile a single file if a file project node is selected; if a folder project node is selected, each of the files in
the folder are compiled.

You can select project nodes by clicking them in the Project Explorer. Additionally, as you switch between files
in the editor, the selection in the Project Explorer changes to highlight the file you're editing.

To activate the Project Explorer:

Choose View > Project Explorer or press Ctrl+Alt+P.

Left-click operations
The following operations are available in the Project Explorer with a left-click of the mouse:

Action Description
Select the node. If the node is already selected and
Single click is a solution, project, or folder node, a rename editor
appears.
Double click Double-clicking a solution node or folder node will
reveal or hide the node's children. Double-clicking a
project node selects it as the active project. Double-
clicking a file opens the file with the default editor for
that file's type.

Toolbar commands
The following buttons are on the toolbar:

Button Description
Add a new file to the active project using the New File
dialog.
Add existing files to the active project.

76
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Remove files, folders, projects, and links from the


project.
Create a new folder in the active project.

Menu of build operations.

Disassemble the active project.

Menu of Project Explorer options.

Display the properties dialog for the selected item.

Shortcut menu commands


The shortcut menu, displayed by right-clicking, contains the commands listed below.

For solutions:
Item Description
Build all projects under the solution in the current or
Build and Batch Build
batch build configuration.
Rebuild and Batch Rebuild Rebuild all projects under the solution in the current or
batch build configuration.
Clean and Batch Clean Remove all output and intermediate build files for the
projects under the solution in the current or batch
build configuration.
Export Build and Batch Export Build Create an editor with the build commands for the
projects under the solution in the current or batch
build configuration.
Add New Project Add a new project to the solution.
Add Existing Project Create a link from an existing solution to this solution.
Paste Paste a copied project into the solution.
Remove Remove the link to another solution from the solution.
Rename Rename the solution node.
Source Control Operations Source-control operations on the project file and
recursive operations on all files in the solution.
Edit Solution As Text Create an editor containing the project file.
Save Solution As Change the filename of the project filenote that the
saved project file is not reloaded.
Properties Show the Properties dialog with the solution node
selected.

77
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

For projects:
Item Description
Build the project in the current or batch build
Build and Batch Build
configuration.
Rebuild and Batch Rebuild Reuild the project in the current or batch build
configuration.
Clean and Batch Clean Remove all output and intermediate build files for the
project in the current or batch build configuration.
Export Build and Batch Export Build Create an editor with the build commands for the
project in the current or batch build configuration.
Link Perform the project node build operation: link for an
Executable project type, archive for a Library project
type, and the combine command for a Combining
project type.
Set As Active Project Set the project to be the active project.
Debugging Commands For Executable and Externally Built Executable project
types, the following debugging operations are
available on the project node: Start Debugging, Step
Into Debugging, Reset And Debug, Start Without
Debugging, Attach Debugger, and Verify.
Memory-Map Commands For Executable project types that don't have memory-
map files in the project and have the memory-map file
project option set, there are commands to view the
memory-map file and to import it into the project.
Section-Placement Commands For Executable project types that don't have section-
placement files in the project but have the section-
placement file project option set, there are commands
to view the section-placement file and to import it into
the project.
Target Processor For Executable and Externally Built Executable project
types that have a Target Processor option group, the
selected target can be changed.
Add New File Add a new file to the project.
Add Existing File Add an existing file to the project.
New Folder Create a new folder in the project.
Cut Cut the project from the solution.
Copy Copy the project from the solution.
Paste Paste a copied folder or file into the project.
Remove Remove the project from the solution.
Rename Rename the project.

78
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Source Control Operations Source-control, recursive operations on all files in the


project.
Find in Project Files Run Find in Files in the project directory.
Properties Show the Project Manager dialog and select the
project node.

For folders:
Item Description
Add New File Add a new file to the folder.
Add Existing File Add an existing file to the folder.
New Folder Create a new folder in the folder.
Cut Cut the folder from the project or folder.
Copy Copy the folder from the project or folder.
Paste Paste a copied folder or file into the folder.
Remove Remove the folder from the project or folder.
Rename Rename the folder.
Source Control Operations Source-control recursive operations on all files in the
folder.
Compile Compile each file in the folder.
Properties Show the properties dialog with the folder node
selected.

For files:
Item Description
Open Edit the file with the default editor for the file's type.
Open With Edit the file with a selected editor. You can choose
from the Binary Editor, Text Editor, and Web Browser.
Select in File Explorer Create a operating system file system window with the
file selected.
Compile Compile the file.
Export Build Create an editor window containing the commands to
compile the file in the active build configuration.
Exclude From Build Set the Exclude From Build option to Yes for this
project node in the active build configuration.
Disassemble Disassemble the output file of the compile into an
editor window.
Preprocess Run the C preprocessor on the file and show the
output in an editor window.
Cut Cut the file from the project or folder.

79
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Copy Copy the file from the project or folder.


Remove Remove the file from the project or folder.
Import Import the file into the project.
Source Control Operations Source-control operations on the file.
Properties Show the properties dialog with the file node selected.

80
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Source navigator window


One of the best ways to find your way around your source code is using the Source Navigator. It parses the
active project's source code and organizes classes, functions, and variables in various ways.

To activate the Source Navigator:

Choose View > Source Navigator or press Ctrl+Alt+N.

The main part of the Source Navigator window provides an overview of your application's functions, classes,
and variables.

SEGGER Embedded Studio displays these icons to the left of each object:

Icon Description
A C or C++ structure or a C++ namespace.

A C++ class.

A C++ member function declared private or a


function declared with static linkage.
A C++ member function declared protected.

A C++ member function declared public or a


function declared with extern linkage.
A C++ member variable declared private or a
variable declared with static linkage.
A C++ member variable declared protected.

A C++ member variable declared public or a variable


declared with extern linkage.

Re-parsing after editing


The Source Navigator does not update automatically, only when you ask it to. To parse source files manually,
click the Refresh button on the Source Navigator toolbar.

SEGGER Embedded Studio re-parses all files in the active project, and any dependent project, and updates the
Source Navigator with the changes. Parsing progress is shown as a progress bar in the in the Source Navigator
window. Errors and warnings detected during parsing are sent to the Source Navigator Log in the Output
windowyou can show the log quickly by clicking the Show Source Navigator Log tool button on the Source
Navigator toolbar.

81
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Setting indexing threads


You can configure how many threads SEGGER Embedded Studio launches to index your project.

To set the number of threads launched when indexing a project:

Choose View > Source Navigator or press Ctrl+Alt+N.


Click the Options dropdown button at the right of the toolbar.
Move the slider to select the number of threads to launch.

Increasing the number of threads will complete indexing faster, but may reduce the responsiveness of SEGGER
Embedded Studio when editing, for example. You should choose a setting that you are comfortable with
for your PC. By default, SEGGER Embedded Studio launches 16 threads to index the project and is a good
compromise for a desktop quad-core PC.

Sorting and grouping


You can group objects by their type; that is, whether they are classes, functions, namespaces, structures, or
variables. Each object is placed into a folder according to its type.

To group objects by type:

1. On the Source Navigator toolbar, click the arrow to the right of the Cycle Grouping button.
2. Choose Group By Type

82
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

References window
The References window shows the results of the last Find References operation. The Find References facility
is closely related to the Source Navigator in that it indexes your project and searches for references within the
active source code regions.

To activate the References window:

If you have hidden the References window and want to see it again:

Choose View > References or press Ctrl+Alt+R.

To find all references in a project:

1. Open a source file that is part of the active project, or one of its dependent projects.
2. In the editor, move the insertion point within the name of the function, variable, method, or macro to
find.
3. Choose Navigate > Find References or press Alt+R.
4. SEGGER Embedded Studio shows the References window, without moving focus, and searches your
project in the background.

You can also find references directly from the text editor's context menu: right-click the item to find and choose
Find References. As a convenience, SEGGER Embedded Studio is configured to also run Find References when
you Alt+Right-click in the text editorsee Mouse-click accelerators.

To search within the results:

Type the text to search for in the Reference window's search box. As you type, the search results are
narrowed.
Click the close button to clear the search text and show all references.

To replace within the results:

Type the replacement text in the Reference window's replace box.


Use the buttons to navigate and replace the text.
The documents that have had replaced text will appear unsaved in the text editor.

83
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Symbol browser window


The Symbol Browser shows useful information about your linked application and complements the information
displayed in the Project Explorer window. You can select different ways to filter and group the information in
the Symbol Browser to provide an at-a-glance overview of your application. You can use the Symbol Browser to
drill down to see the size and location of each part of your program. The way symbols are sorted and grouped is
saved between runs; so, when you rebuild an application, SEGGER Embedded Studio automatically updates the
Symbol Browser so you can see the effect of your changes on the memory layout of your program.

User interface
Button Description
Group symbols by source filename.

Group symbols by symbol type (equates, functions,


labels, sections, and variables).
Group symbols by the section where they are defined.

Move the insertion point to the statement that defined


the symbol.
Select columns to display.

The main part of the Symbol Browser displays each symbol (both external and static) that is linked into an
application. SEGGER Embedded Studio displays the following icons to the left of each symbol:

Icon Description
Private Equate A private symbol not defined relative to
a section.
Public Equate A public symbol that is not defined
relative to a section.
Private Function A private function symbol.

Public Function A public function symbol.

Private Label A private data symbol, defined relative to


a section.
Public Label A public data symbol, defined relative to a
section.
Section A program section.

84
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Choosing what to show


To activate the Symbol Browser window:
Choose View > Symbol Browser or press Ctrl+Alt+Y.

You can choose to display the following fields for each symbol:

Value:The value of the symbol. For labels, code, and data symbols, this will be the address of the symbol.
For absolute or symbolic equates, this will be the value of the symbol.
Range:The range of addresses the code or data item covers. For code symbols that correspond to high-
level functions, the range is the range of addresses used for that function's code. For data addresses that
correspond to high-level static or extern variables, the range is the range of addresses used to store that
data item. These ranges are only available if the corresponding source file was compiled with debugging
information turned on: if no debugging information is available, the range will simply be the first address
of the function or data item.
Size:The size, in bytes, of the code or data item. The Size column is derived from the Range of the symbol:
if the symbol corresponds to a high-level code or data item and has a range, Size is calculated as the
difference between the start and end addresses of the range. If a symbol has no range, the size column is
blank.
Section:The section in which the symbol is defined. If the symbol is not defined within a section, the
Section column is blank.
Type:The high-level type for the data or code item. If the source file that defines the symbol is compiled
with debugging information turned off, type information is not available and the Type column is blank.
Frame Size:The amount of stack space used by a call to the function symbol. If the source file that defines
the symbol is compiled with debugging information turned off, frame size information is not available
and the Type column is blank.

Initially the Range and Size columns are shown in the Symbol Browser. To select which columns to display, use
the Field Chooser button on the Symbol Browser toolbar.

To select the fields to display:


1. Click the Field Chooser button on the Symbol Browser toolbar.
2. Select the fields you wish to display and deselect the fields you wish to hide.

Organizing and sorting symbols


When you group symbols by section, each symbol is grouped underneath the section in which it is defined.
Symbols that are absolute or are not defined within a section are grouped beneath (No Section).

To group symbols by section:


1. On the Symbol Browser toolbar, click the arrow next to the Cycle Grouping button.

85
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

2. From the pop-up menu, choose Group By Section.

The Cycle Grouping icon will change to indicate that the Symbol Browser is grouping symbols by section.

When you group symbols by type, each symbol is classified as one of the following:

An Equate has an absolute value and is not defined as relative to, or inside, a section.
A Function is defined by a high-level code sequence.
A Variable is defined by a high-level data declaration.
A Label is defined by an assembly language module. Label is also used when high-level modules are
compiled with debugging information turned off.

When you group symbols by source file, each symbol is grouped underneath the source file in which it is
defined. Symbols that are absolute, are not defined within a source file, or are compiled without debugging
information, are grouped beneath (Unknown).

To group symbols by type:

1. On the Symbol Browser toolbar, click the arrow next to the Cycle Grouping button.
2. Choose Group By Type from the pop-up menu.

The Cycle Grouping icon will change to indicate that the Symbol Browser is grouping symbols by type.

To group symbols by source file:

1. On the Symbol Browser toolbar, click the arrow next to the Cycle Grouping button.
2. Choose Group By Source File.

The Cycle Grouping icon will change to indicate that the Symbol Browser is grouping symbols by source file.

When you sort symbols alphabetically, all symbols are displayed in a single list in alphabetical order.

To list symbols alphabetically:

1. On the Symbol Browser toolbar, click the arrow next to the Cycle Grouping button.
2. Choose Sort Alphabetically.

The Cycle Grouping icon will change to indicate that the Symbol Browser is grouping symbols alphabetically.

Filtering and finding symbols


When you're dealing with big projects with hundreds, or even thousands, of symbols, a way to filter those
symbols in order to isolate just the ones you need is very useful. The Symbol Browser's toolbar provides an
editable combobox} you can use to specify the symbols you'd like displayed. You can type * to match a sequence
of zero or more characters and ? to match exactly one character.

86
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

The symbols are filtered and redisplayed as you type into the combo box. Typing the first few characters of a
symbol name is usually enough to narrow the display to the symbol you need. Note: the C compiler prefixes all
high-level language symbols with an underscore character, so the variable extern int u or the function
void fn(void) have low-level symbol names _u and _fn. The Symbol Browser uses the low-level symbol
name when displaying and filtering, so you must type the leading underscore to match high-level symbols.

To display symbols that start with a common prefix:


Type the desired prefix text into the combo box, optionally followed by a "*".

For instance, to display all symbols that start with "i2c_", type "i2c_" and all matching symbols are displayedyou
don't need to add a trailing "*" in this case, because it is implied.

To display symbols that end with a common suffix:


Type * into the combo box, followed by the required suffix.

For instance, to display all symbols that end in _data, type *_data and all matching symbols are displayedin this
case, the leading * is required.

When you have found the symbol you're interested in and your source files have been compiled with debugging
information turned on, you can jump to a symbol's definition using the Go To Definition button.

To jump to the definition of a symbol:


1. Select the symbol from the list of symbols.
2. On the Symbol Browser toolbar, click Go To Definition.

or

1. Right-click the symbol in the list of symbols.


2. Choose Go To Definition from the shortcut menu.

Watching symbols
If a symbol's range and type is known, you can add it to the most recently opened Watch window or Memory
window.

To add a symbol to the Watch window:


1. In the Symbol Browser, right-click the symbol you wish to add to the Watch window.
2. On the shortcut menu, choose Add To Watch.

To add a symbol to the Memory window:


1. In the Symbol Browser, right-click the symbol you wish to add to the Memory window.

87
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

2. Choose Locate Memory from the shortcut menu.

Using size information


Here are a few common ways to use the Symbol Browser:

What function uses the most code space? What requires the most data space?

1. Choose View > Symbol Browser or press Ctrl+Alt+Y.


2. In the Grouping button menu on the Symbol Browser toolbar, select Group By Type.
3. Ensure the Size field is checked in the Field Chooser button's menu.
4. Ensure that the filter on the Symbol Browser toolbar is empty.
5. Click on the Size field in the header to sort by data size.
6. The sizes of variables and of functions are shown in separate lists.

What's the overall size of my application?

1. Choose View > Symbol Browser or press Ctrl+Alt+Y.


2. In the Grouping button menu on the Symbol Browser toolbar, select Group By Section.
3. Ensure the Range and Size fields are checked in the Field Chooser button's menu.
4. Read the section sizes and ranges of each section in the application.

88
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Stack usage window


The Stack Usage Window finds the call paths of your linked application and displays them as a call tree
together with their minimal stack requirements. A call path of your application is any function that has been
linked in but has no direct call made to it but will make calls to other functions. The main function is the most
obvious example of a call path, an interrupt handler or a function that is called only as a function pointer are
other examples. To use the stack usage window your linked application must be compiled with debugging
information enabled.

User interface
Button Description
Move the insertion point to the statement that defined
the symbol.
Collapse the selected open call tree.

Open the selected open call tree.

Show only the deepest call path through the selected


call tree.

89
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Memory usage window


The Memory Usage window displays a graphical summary of how memory has been used in each memory
segment of a linked application.

Each bar represents an entire memory segment. Green represents the area of the segment that contains code or
data.

To activate the Memory Usage window:

Choose View > Memory Usage or press Ctrl+Alt+Z.

The memory-usage graph will only be visible if your active project's target is an executable file and the file exists.
If the executable file has not been linked by SEGGER Embedded Studio, memory-usage information may not be
available.

Displaying section information


The Memory Usage window can also be used to visualize how program sections have been placed in memory.
To display the program sections, simply click the memory segment to expand it; or, alternatively, right-click and
choose Show Memory Sections from the shortcut menu.

90
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Each bar represents an entire memory segment. Green represents the area of the segment that contains the
program section.

Displaying segment overflow


The Memory Usage window also displays segment overflows when the total size of the program sections placed
in a segment is larger than the segment size. When this happens, the segment and section bars represents the
total memory used, green areas represent the code or data within the segment, and red areas represent code or
data placed outside the segment.

91
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Getting more-detailed information


If you require more-detailed information than that provided by the Memory Usage window, such as the location
of specific objects within memory, use the Symbol browser window.

92
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Bookmarks window
The Bookmarks window contains a list of bookmarks that are set in the project. The bookmarks are stored in the
session file associated with the project and persist across runs of SEGGER Embedded Studioif you remove the
session file, the bookmarks associated with the project are lost.

User interface
Button Description
Toggle a bookmark at the insertion point in the active
editor. Equivalent to choosing Edit > Bookmarks >
Toggle Bookmark or pressing Ctrl+F2.
Go to the previous bookmark in the bookmark list.
Equivalent to choosing Edit > Bookmarks > Previous
Bookmark or pressing Alt+Shift+F2.
Go to the next next bookmark in the bookmark list.
Equivalent to choosing Edit > Bookmarks > Next
Bookmark or pressing Alt+F2.
Clear all bookmarksyou confirm the action using a
dialog. Equivalent to choosing Edit > Bookmarks >
Clear All Bookmarks or pressing Ctrl+K, Alt+F2.
Selects the fill color for newly created bookmarks.

Double-clicking a bookmark in the bookmark list moves focus to the the bookmark.

You can set bookmarks with the mouse or using keystrokessee Using bookmarks.

93
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Code Outline Window


The Code Outline window shows the structure of the text of the focused code editor. For C and C++ documents
the top level symbols and types are displayed, for XML documents the nodes are displayed. For C and C+
+ documents the Preview tab can display documentation on the top level symbols and types. The defacto
standard doxygen commands are supported for example:

/**
* \brief Convert a given full parsed comment to an XML document.
*
* A Relax NG schema for the XML can be found in comment-xml-schema.rng file
* inside clang source tree.
*
* \param Comment a \c CXComment_FullComment AST node.
*
* \returns string containing an XML document.
*/
CINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXComment Comment);

94
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Analyzing Source Code


The Analyze action is available on the context menu of the project explorer at project, folder and file level. The
analyze action will run the https://clang.llvm.org/extra/clang-tidy linter tool on the C/C++ files selected by the
project explorer node and display warnings in the output window. The default checks will be the same as the
clang analyzer. You can enable additional checks by setting the Clang Tidy Checks project option. For example
you can enable the bugprone code constructs check and disable a specific clang analyzer diagnostic check as
follows

bugprone-*
-clang-diagnostic-parentheses-equality

You can also set the project option Analyze After Compile which will run the analyzer each time the compiler is
run.

95
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Editing your code


SEGGER Embedded Studio has a built-in editor that allows you to edit text, but some features make it particularly
well suited to editing code.

You can open multiple code editors to browse or edit project source code, and you can copy and paste among
them. The Windows menu contains a list of all open code editors.

The code editor supports the language of the source file it is editing, showing code with syntax highlighting and
offering smart indenting.

You can open a code editor in several ways, some of which are:

By double-clicking a file in the Project Explorer or by right-clicking a file and selecting Open from the
shortcut menu.
Using the File > New File or File > Open commands.

Elements of the code editor


The code editor is composed of several elements, which are described here.

Code pane:The area where you edit code. You can set options that affect the code pane's text indents,
tabs, drag-and-drop behavior, and so forth.
Margin gutter:A gray area on the left side of the code editor where margin indicators such as breakpoints,
bookmarks, and shortcuts are displayed. Clicking this area sets a breakpoint on the corresponding line of
code.
Horizontal and vertical scroll bars:You can scroll the code pane horizontally and vertically to view code that
extends beyond the edges of the pane.

96
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Basic editing
This section is a whirlwind tour of the basic editing features SEGGER Embedded Studio's code editor provides.

Whether you are editing code, HTML, or plain text, the code editor is just like many other text editors or word
processors. For code that is part of a project, the project's programming language support provides syntax
highlighting (colorization), indentation, and so on.

This section is not a reference for everything the code editor provides; for that, look in the following sections.

97
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Moving the insertion point


The most common way to navigate through text is to use use the mouse or the keyboard's cursor keys.

Using the mouse


You can move the insertion point within a document by clicking the mouse inside the editor window.

Using the keyboard


The keystrokes most commonly used to navigate through a document are:

Keystroke Description
Up Move the insertion point up one line
Down Move the insertion point down one line
Left Move the insertion point left one character
Right Move the insertion point right one character
Home Move the insertion point to the first non-whitespace
character on the line pressing Home a second time
moves the insertion point to the leftmost column
End Move the insertion point to the end of the line
PageUp Move the insertion point up one page
PageDown Move the insertion point down one page
Ctrl+Home Move the insertion point to the start of the document
Ctrl+End Move the insertion point to the end of the document
Ctrl+Left Move the insertion point left one word
Ctrl+Right Move the insertion point right one word

SEGGER Embedded Studio offers additional movement keystrokes, though most users are more comfortable
using repeated simple keystrokes to accomplish the same thing:

Keystroke Description
Alt+Up Move the insertion point up five lines
Alt+Down Move the insertion point down five lines
Alt+Home Move the insertion point to the top of the window
Alt+End Move the insertion point to the bottom of the window
Ctrl+Up Scroll the document up one line in the window
without moving the insertion point

98
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Ctrl+Down Scroll the document down one line in the window


without moving the insertion point

If you are editing source code, the are source-related keystrokes too:

Keystroke Description
Move the insertion point backwards to the previous
Ctrl+PgUp
function or method.
Ctrl+PgDn Move the insertion point forwards to the next function
or method.

99
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Adding text
The editor has two text-input modes:

Insertion mode:As you type on the keyboard, text is entered at the insertion point and any text to the right
of the insertion point is shifted along. A visual indication of insertion mode is that the cursor is a flashing
line.
Overstrike mode:As you type on the keyboard, text at the insertion point is replaced with your typing. A
visual indication of insertion mode is that the cursor is a flashing block.

Insert and overstrike modes are common to all editors: if one editor is in insert mode, all editors are in insert
mode. To configure the cursor appearance, choose Tools > Options.

To toggle between insertion and overstrike mode:

Click Insert.

When overstrike mode is enabled, the mode indicator changes from INS to OVR and the cursor will change to
the overstrike cursor.

To add or insert text:

1. Move the insertion point to the place text is to be inserted.


2. Enter the text using the keyboard.

To overwrite characters in an existing line, press the Insert key to place the editor into overstrike mode.

To add or insert text on multiple lines:

1. Hold down the Alt key and use block selection to mark the place text is to be inserted.
2. Enter the text using the keyboard.

100
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Deleting text
The text editor supports the following common editing keystrokes:

Keystroke Description
Backspace Delete the character before the insertion point
Delete Delete the character after the insertion point
Ctrl+Backspace Delete one word before the insertion point
Ctrl+Delete Delete one word after the insertion point

To delete characters or words:

1. Place the insertion point before the word or letter you want to delete.
2. Press Delete as many times as needed.

or

1. Place the insertion point after the letter or word you want to delete.
2. Press Backspace as many times as needed.

To delete text that spans more than a few characters:

1. Select the text you want to delete.


2. Press Delete or Backspace to delete it.

To delete a text block:

1. Hold down the Alt key and use block selection to mark the text you want to delete.
2. Press Delete or Backspace to delete it.

To delete characters on multiple lines:

1. Hold down the Alt key and use block selection to mark the lines.
2. Press Delete or Backspace as many times as needed to delete the characters.

101
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Using the clipboard


You can select text by using the keyboard or the mouse.

To select text with the keyboard:

Hold down the Shift key while using the cursor keys.

To select text with the mouse:

1. Click the start of the selection.


2. Drag the mouse to mark the selection.
3. Release the mouse to end selecting.

To select a block of text with the keyboard:

Hold down the Shift+Alt keys while using the cursor keys.

To select a block of text with the mouse:

1. Hold down the Alt key.


2. Click the start of the selection.
3. Drag the mouse to mark the selection.
4. Release the mouse to end selecting.

To copy selected text to the clipboard:

Choose Edit > Copy or press Ctrl+C.

The standard Windows key sequence Ctrl+Ins also copies text to the clipboard.

To cut selected text to the clipboard:

Choose Edit > Cut or press Ctrl+X.

The standard Windows key sequence Shift+Del also cuts text to the clipboard.

To insert the clipboard content at the insertion point:

Choose Edit > Paste or press Ctrl+V.

The standard Windows key sequence Shift+Ins also inserts the clipboard content at the insertion point.

102
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Undo and redo


The editor has an undo facility to undo previous editing actions. The redo feature can be used to re-apply
previously undone actions.

To undo one editing action:

Choose Edit > Undo or press Ctrl+Z.

The standard Windows key sequence Alt+Backspace also undoes an edit.

To undo multiple editing actions:

1. On the Standard toolbar, click the arrow next to the Undo button.
2. Select the editing operations to undo.

To undo all edits:

Choose Edit > Others > Undo All or press Ctrl+K, Ctrl+Z.

To redo one editing action:

Choose Edit > Redo or press Ctrl+Y.

The standard Windows key sequence Alt+Shift+Backspace also redoes an edit.

To redo multiple editing actions:

1. On the Standard toolbar, click the arrow next to the Redo tool button.
2. From the pop-up menu, select the editing operations to redo.

To redo all edits:

Choose Edit > Others > Redo All or press Ctrl+K, Ctrl+Y.

103
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Drag and drop


You can select text, then drag it to another location. You can drop the text at a different location in the same
window or in another one.

To drag and drop text:

1. Select the text you want to move.


2. Press and hold the mouse button to drag the selected text to where you want to place it.
3. Release the mouse button to drop the text.

Dragging text moves it to the new location. To copy it to a new location, hold down the Ctrl key while dragging
the text: the mouse pointer changes to indicate a copy operation. Press the Esc key while dragging text to cancel
the drag-and-drop edit.

By default, drag-and drop-editing is disabled and you must enable it if you want to use it.

To enable or disable drag-and-drop editing:

1. Choose Tools > Options or press Alt+,.


2. Click Text Editor.
3. Set Allow Drag and Drop Editing to Yes to enable or to No to disable drag-and-drop editing.

104
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Searching
To find text in the current file:

1. Press Ctrl+F.
2. Enter the string to search for.

As you type, the editor searches the file for a match. The pop-up shows how many matches are in the current file.
To move through the matches while the Find box is still active, press Tab or F3 to move to the next match and
Shift+Tab or Shift+F3 to move to the previous match.

If you press Ctrl+F a second time, SEGGER Embedded Studio pops up the standard Find dialog to search the file.
If you wish to bring up the Find dialog without pressing Ctrl+F twice, choose Search > Find.

105
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Advanced editing
You can do anything using its basic code-editing features, but the SEGGER Embedded Studio text editor has a
host of labor-saving features that make editing programs a snap.

This section describes the code-editor features intended to make editing source code easier.

106
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Indenting source code


The editor uses the Tab key to increase or decrease the indentation level of the selected text.

To increase indentation:
Select the text to indent.
Choose Selection > Increase Line Indent or press Tab.

To decrease indentation:
Select the text to indent.
Choose Selection > Decrease Line Indent or press Shift+Tab.

The indentation size can be changed in the Language Properties pane of the editor's Properties window, as can
all the indent-related features listed below.

To change indentation size:


Choose Tools > Options or press Alt+,.
Select the Languages page.
Set the Indent Size environment option for the required language.

You can choose to use spaces or tab tab characters to fill whitespace when indenting.

To set tab or space fill when indenting:


Choose Tools > Options or press Alt+,.
Select the Languages page.
Set the Use Tabs environment option for the required language. Note: changing this setting does not add
or remove existing tabs from files, the change will only affect new indents.

The editor can assist with source code indentation while inserting text. There are three levels of indentation
assistance:

None:The indentation of the source code is left to the user.


Indent:This is the default. The editor maintains the current indentation level. When you press Return or
Enter, the editor moves the insertion point down one line and indented to the same level as the now-
previous line.
Smart:The editor analyzes the source code to compute the appropriate indentation level for each line.
You can change how many lines before the insertion point will be analyzed for context. The smart-indent
mode can be configured to indent either open and closing braces or the lines following the braces.

Changing indentation options:


To change the indentation mode:

107
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Set the Indent Mode environment option for the required language.

To change whether opening braces are indented in smart-indent mode:

Set the Indent Opening Brace environment option for the required language.

To change whether closing braces are indented in smart-indent mode:

Set the Indent Closing Brace environment option for the required language.

To change the number of previous lines used for context in smart-indent mode:

Set the Indent Context Lines environment option for the required language.

108
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Commenting out sections of code


To comment selected text:

Choose Selection > Comment or press Ctrl+/.

To uncomment selected text:

Choose Selection > Uncomment or press Ctrl+Shift+/.

You can also toggle the commenting of a selection by typing /. This has no menu equivalent.

109
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Adjusting letter case


The editor can change the case of the current word or the selection. The editor will change the case of the
selection, if there is a selection, otherwise it will change the case of word at the insertion point.

To change text to uppercase:

Choose Selection > Make Uppercase or press Ctrl+K, U.

This changes, for instance, Hello to HELLO.

To change text to lowercase:

Choose Selection > Make Lowercase or press Ctrl+U.

This changes, for instance, Hello to hello.

To switch between uppercase and lowercase:

Choose Selection > Switch Case.

This changes, for instance, Hello to hELLO.

With large software teams or imported source code, sometimes identifiers don't conform to your local coding
style. To assist in conversion between two common coding styles for identifiers, SEGGER Embedded Studio's
editor offers the following two shortcuts:

To change from split case to camel case:

Choose Selection > Camel Case or press Ctrl+K, Ctrl+Shift+U.

This changes, for instance, this_is_wrong to thisIsWrong.

To change from camel case to split case:

Choose Selection > Split Case or press Ctrl+K, Ctrl+U.

This changes, for instance, thisIsWrong to this_is_wrong.

110
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Using bookmarks
To edit a document elsewhere and then return to your current location, add a bookmark. The Bookmarks
window maintains a list of the bookmarks set in source files see Bookmarks window.

To place a bookmark:
1. Move the insertion point to the line you wish to bookmark.
2. Choose Edit > Bookmarks > Toggle Bookmark or press Ctrl+F2.

A bookmark symbol appears next to the line in the indicator margin to show the bookmark is set.

To place a bookmark using the mouse:


1. Right-click the margin gutter where the bookmark should be set.
2. Choose Toggle Bookmark.

The default color to use for new bookmarks is configured in the Bookmarks window. You can choose a specific
color for the bookmark as follows:

1. Press and hold the Alt key.


2. Click the margin gutter where the bookmark should be set.
3. From the palette, click the bookmark color to use for the bookmark.

To navigate forward through bookmarks:


1. Choose Edit > Bookmarks > Next Bookmark In Document or press F2.
2. The editor moves the insertion point to the next bookmark in the document.

If there is no following bookmark, the insertion point moves to the first bookmark in the document.

To navigate backward through bookmarks:


1. Choose Edit > Bookmarks > Previous Bookmark In Document or press Shift+F2.
2. The editor moves the insertion point to the previous bookmark in the document.

If there is no previous bookmark, the insertion point moves to the last bookmark in the document.

To remove a bookmark:
1. Move the insertion point to the line containing the bookmark.
2. Choose Edit > Bookmarks > Toggle Bookmark or press Ctrl+F2.

The bookmark symbol disappears, indicating the bookmark is no longer set.

To remove all bookmarks in a document:


Choose Edit > Bookmarks > Clear Bookmarks In Document or press Ctrl+K, F2.

111
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Quick reference for bookmark operations


Keystroke Menu Description
Edit > Bookmarks > Toggle Toggle a bookmark at the insertion
Ctrl+F2
Bookmark point.
Ctrl+K, 0 Clear the bookmark at the insertion
point.
F2 Edit > Bookmarks > Next Move the insertion point to next
Bookmark In Document bookmark in the document.
Shift+F2 Edit > Bookmarks > Previous Move the insertion point to
Bookmark In Document previous bookmark in the
document.
Ctrl+Q, F2 Edit > Bookmarks > First Move the insertion point to the first
Bookmark In Document bookmark in the document.
Ctrl+Q, Shift+F2 Edit > Bookmarks > Last Bookmark Move the insertion point to the last
In Document bookmark in the document.
Ctrl+K, F2 Edit > Bookmarks > Clear Clear all bookmarks in the
Bookmarks In Document document.
Alt+F2 Edit > Bookmarks > Next Move the insertion point to the next
Bookmark bookmark in the Bookmarks list.
Alt+Shift+F2 Edit > Bookmarks > Previous Move the insertion point to
Bookmark the previous bookmark in the
Bookmarks list.
Ctrl+Q, Alt+F2 Edit > Bookmarks > First Move the insertion point to the first
Bookmark bookmark in the Bookmarks list.
Ctrl+Q, Alt+Shift+F2 Edit > Bookmarks > Last Bookmark Move the insertion point to the last
bookmark in the Bookmarks list.
Ctrl+K, Alt+F2 Edit > Bookmarks > Clear All Clear all bookmarks in all
Bookmarks documents.

112
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Find and Replace window


The Find and Replace window allows you to search for and replace text in the current document or in a range of
specified files.

To activate the Find and Replace window:


Choose Search > Replace in Files or press Ctrl+Alt+F.

To find text in a single file:


Select Current Document in the context combo box.
Enter the string to be found in the text edit input.
If the search will be case sensitive, set the Match case option.
If the search will be for a whole wordi.e., there will be whitespace, such as spaces or the beginning or end
of the line, on both sides of the string being searched forset the Whole word option.
If the search string is a regular expression, set the Use regexp option.
Click the Find button to find all occurrences of the string in the current document.

To find and replace text in a single file:


Click the Replace button on the toolbar.
Enter the string to search for into the Find what input.
Enter the replacement string into the Replace with input. If the search string is a regular expression, the n
back-reference can be used in the replacement string to reference captured text.
If the search will be case sensitive, set the Match case option.
If the search will be for a whole wordi.e., there will be whitespace, such as spaces or the beginning or end
of the line, on both sides of the string being searched forset the Match whole word option.
If the search string is a regular expression, set the Use regular expression option.
Click the Find Next button to find next occurrence of the string, then click the Replace button to replace
the found string with the replacement string; or click Replace All to replace all occurrences of the search
string without prompting.

To find text in multiple files:


Click the Find In Files button on the toolbar.
Enter the string to search for into the Find what input.
Select the appropriate option in the Look in input to select whether to carry out the search in all open
documents, all documents in the current project, all documents in the current solution, or all files in a
specified folder.
If you have specified that you want to search in a folder, select the folder you want to search by entering
its path in the Folder input and use the Look in files matching input to specify the type of files you want
to search.

113
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

If the search will be case sensitive, set the Match case option.
If the search will be for a whole wordi.e., there will be whitespace, such as spaces or the beginning or end
of the line, on both sides of the string being searched forset the Match whole word option.
If the search string is a regular expression, set the Use regular expression option.
Click the Find All button to find all occurrences of the string in the specified files, or click the Bookmark
All button to bookmark all the occurrences of the string in the specified files.

To replace text in multiple files:

Click the Replace In Files button on the toolbar.


Enter the string to search for into the Find what input.
Enter the replacement string into the Replace with input. If the search string is a regular expression, the n
back-reference can be used in the replacement string to reference captured text.
Select the appropriate option in the Look in input to select whether you want to carry out the search and
replace in the current or in all open documents.
If you have specified that you want to search in a folder, select the folder you want to search by entering
its path in the Folder input and use the Look in files matching input to specify the type of files you want
to search.
If the search will be case sensitive, set the Match case option.
If the search will be for a whole wordi.e., there will be whitespace, such as spaces or the beginning or end
of the line, on both sides of the string being searched forset the Match whole word option.
If the search string is a regular expression, set the Use regular expression option.
Click the Replace All button to replace all occurrences of the string in the specified files.

114
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Clipboard Ring window


The code editor captures all cut and copy operations, and stores the cut or copied item on the clipboard ring. The
clipboard ring stores the last 20 cut or copied text items, but you can configure the maximum number by using
the environment options dialog. The clipboard ring is an excellent place to store scraps of text when you're
working with many documents and need to cut and paste between them.

To activate the clipboard ring:

Choose Edit > Clipboard Ring > Clipboard Ring or press Ctrl+Alt+C.

To paste from the clipboard ring:

1. Cut or copy some text from your code. The last item you cut or copy into the clipboard ring is the current
item for pasting.
2. Press Ctrl+Shift+V to paste the clipboard ring's current item into the current document.
3. Repeatedly press Ctrl+Shift+V to cycle through the entries in the clipboard ring until you get to the one
you want to permanently paste into the document. Each time you press Ctrl+Shift+V, the editor replaces
the last entry you pasted from the clipboard ring, so you end up with just the last one you selected. The
item you stop on then becomes the current item.
4. Move to another location or cancel the selection. You can use Ctrl+Shift+V to paste the current item
again or to cycle the clipboard ring to a new item.

Clicking an item in the clipboard ring makes it the current item.

To paste a specific item from the clipboard ring:

1. Move the insertion point to the position to paste the item in the document.
2. Click the arrow at the right of the item to paste.
3. Choose Paste from the pop-up menu.

or

1. Click the item to paste to make it the current item.


2. Move the insertion point to the position to paste the item in the document.
3. Press Ctrl+Shift+V.

To paste all items into a document:

To paste all items on the clipboard ring into the current document, move the insertion point to where you want
to paste the items and do one of the following:

Choose Edit > Clipboard Ring > Paste All.

or

115
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

On the Clipboard Ring toolbar, click the Paste All button.

To remove an item from the clipboard ring:

1. Click the arrow at the right of the item to remove.


2. Choose Delete from the pop-up menu.

To remove all items from the clipboard ring:

Choose Edit > Clipboard Ring > Clear Clipboard Ring.

or

On the Clipboard Ring toolbar, click the Clear Clipboard Ring button.

To configure the clipboard ring:

1. Choose Tools > Options or press Alt+,.


2. Click the Windows category to show the Clipboard Ring Options group.
3. Select Preserve Contents Between Runs to save the content of the clipboard ring between runs, or
deselect it to start with an empty clipboard ring.
4. Change Maximum Items Held In Ring to configure the maximum number of items stored on the
clipboard ring.

116
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Mouse-click accelerators
SEGGER Embedded Studio provides a number of mouse-click accelerators in the editor that speed access to
commonly used functions. The mouse-click accelerators are user configurable using Tools > Options.

Default mouse-click assignments


Click Default
Left Not configurable start selection.
Shift+Left Not configurable extend selection.
Ctrl+Left Select word.
Alt+Left Execute Go To Definition.
Middle No action.
Shift+Middle Display Go To Include menu.
Ctrl+Middle No action.
Alt+Middle Display Go To Method menu.
Right Not configurable show context menu.
Shift+Right No action.
Ctrl+Right No action.
Alt+Right Execute Find References.

Each accelerator can be assigned one of the following actions:

Default:The system default for that click.


Go To Definition:Go to the definition of the item clicked, equivalent to choosing Navigate > Go To
Definition or pressing Alt+G.
Find References:Find references to the item clicked, equivalent to choosing Navigate > Find References or
pressing Alt+R.
Find in Solution:Textually find the item clicked in all the files in the solution, equivalent to choosing Search
> Find Extras > Find in Solution or pressing Alt+U.
Find Help:Use F1-help on the item clicked, equivalent to choosing Help > Help or pressing F1.
Go To Method:Display the Go To Method menu, equivalent to choosing Navigate > Find Method or
pressing Ctrl+M.
Go To Include:Display the Go To Include menu, equivalent to choosing Navigate > Find Include or
pressing Ctrl+Shift+M.
Paste:Paste the clipboard at the position clicked, equivalent to choosing Edit > Paste or pressing Ctrl+V.

Configuring Mac OS X
On Mac OS X you must configure the mouse to pass middle clicks and right clicks to the application if you wish
to use mouse-click accelerators in SEGGER Embedded Studio. Configure the mouse preferences in the Mouse
control panel in Mac OS X System Preferences to the following:

117
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Right mouse button set to Secondary Button.


Middle mouse button set to Button 3.

118
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Regular expressions
The editor can search and replace text using regular expressions. A regular expression is a string that uses
special characters to describe and reference patterns of text. The regular expression system used by the editor
is modeled on Perl's regexp language. For more information on regular expressions, see Mastering Regular
Expressions, Jeffrey E F Freidl, ISBN 0596002890.

Summary of special characters


The following table summarizes the special characters the SEGGER Embedded Studio editor supports

Pattern Description
\d Match a numeric character.
\D Match a non-numeric character.
\s Match a whitespace character.
\S Match a non-whitespace character.
\w Match a word character.
\W Match a non-word character.
[c] Match set of characters; e.g., [ch] matches characters
c or h. A range can be specified using the - character;
e.g., [0-27-9] matches if the character is 0, 1, 2, 7 8, or
9. A range can be negated using the ^ character; e.g.,
[^a-z] matches if the character is anything other than a
lowercase alphabetic character.
\c Match the literal character c. For example, you would
use \\* to match the character *.
\a Match ASCII bell character (ASCII code 7).
\f Match ASCII form feed character (ASCII code 12).
\t Match ASCII horizontal tab character (ASCII code 9).
\v Match ASCII vertical tab character.
\xhhhh Match Unicode character specified by hexadecimal
number hhhh.
. Match any character.
* Match zero or more occurrences of the preceding
expression.
+ Match one or more occurrences of the preceding
expression.
? Match zero or one occurrences of the preceding
expression.

119
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

{n} Match n occurrences of the preceding expression.


{n,} Match at least n occurrences of the preceding
expression.
{,m} Match at most m occurrences of the preceding
expression.
{n,m} Match at least n and at most m occurrences of the
preceding expression.
^ Beginning of line.
$ End of line.
\b Word boundary.
\B Non-word boundary.
(e) Capture expression e.
\n Back-reference to nth captured text.

Examples

The following regular expressions can be used with the editor's search-and-replace operations. To use the
regular expression mode, the Use regular expression checkbox must be set in the search-and-replace dialog.
Once enabled, regular expressions can be used in the Find what search string. The Replace With strings can use
the "n" back-reference string to reference any captured strings.

"Find what" "Replace With" Description


Search for any-length string
containing one or more word
u\w.d characters beginning with the
character u and ending in the
character d.
^.*;$ Search for any lines ending in a
semicolon.
(typedef.+\s+)(\S+); \1TEST_\2; Find C type definition and insert the
string TEST onto the beginning of
the type name.

120
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Locals window
The Locals window displays a list of all variables that are in scope of the selected stack frame in the Call Stack.

The Locals window has a toolbar and a main data display.

Button Description
Display the selected item in binary.

Display the selected item in octal.

Display the selected item in decimal.

Display the selected item in hexadecimal.

Display the selected item as a signed decimal.

Display the selected item as a character or Unicode


character.
Set the range displayed in the active Memory window
to span the memory allocated to the selected item.
Sort variables alphabetically by name.

Sort variables numerically by address or register


number (default).

Using the Locals window


The Locals window shows the local variables of the active function when the debugger is stopped. The contents
of the Locals window changes when you use the Debug Location toolbar items or select a new frame in the Call
Stack window. When the program stops at a breakpoint, or is stepped, the Locals window updates to show the
active stack frame. Items that have changed since they were previously displayed are highlighted in red.

To activate the Locals window:

Choose View > Locals or press Ctrl+Alt+L.

When you select a variable in the main part of the display, the display-format button highlighted on the Locals
window toolbar changes to show the selected item's display format.

To change the display format of a local variable:

Right-click the item to change.


From the shortcut menu, choose the desired display format.

121
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

or

Click the item to change.


On the Locals window toolbar, select the desired display format.

To modify the value of a local variable:

Click the value of the local variable to modify.


Enter the new value for the local variable. Prefix hexadecimal numbers with 0x, binary numbers with 0b,
and octal numbers with 0.

or

Right-click the value of the local variable to modify.


From the shortcut menu, select one of the commands to modify the local variable's value.

122
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Globals window
The Globals window displays a list of all variables that are global to the program. The operations available on the
entries in this window are the same as the Watch window, except you cannot add or delete variables from the
Globals window.

Globals window user interface


The Globals window consists of a toolbar and main data display.

Globals toolbar

Button Description
Display the selected item in binary.

Display the selected item in octal.

Display the selected item in decimal.

Display the selected item in hexadecimal.

Display the selected item as a signed decimal.

Display the selected item as a character or Unicode


character.
Set the range displayed in the active Memory window
to span the memory allocated to the selected item.
Sort variables alphabetically by name.

Sort variables numerically by address or register


number (default).

Using the Globals window


The Globals window shows the global variables of the application when the debugger is stopped. When the
program stops at a breakpoint, or is stepped, the Globals window updates to show the active stack frame and
new variable values. Items that have changed since they were previously displayed are highlighted in red.

To activate the Globals window:

Choose View > Globals or press Ctrl+Alt+G.

123
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Changing the display format


When you select a variable in the main part of the display, the display-format button highlighted on the Globals
window toolbar changes to show the item's display format.

To change the display format of a global variable:

Right-click the item to change.


From the shortcut menu, choose the desired display format.

or

Click the item to change.


On the Globals window toolbar, select the desired display format.

To modify the value of a global variable:

Click the value of the global variable to modify.


Enter the new value for the global variable. Prefix hexadecimal numbers with 0x, binary numbers with 0b,
and octal numbers with 0.

124
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Watch window
The Watch window provides a means to evaluate expressions and to display the results of those expressions.
Typically, expressions are just the name of a variable to be displayed, but they can be considerably more
complex; see Debug expressions. Note: expressions are always evaluated when your program stops, so the
expression you are watching is the one that is in scope of the stopped program position.

The Watch window is divided into a toolbar and the main data display.

Button Description
Display the selected item in binary.

Display the selected item in octal.

Display the selected item in decimal.

Display the selected item in hexadecimal.

Display the selected item as a signed decimal.

Display the selected item as a character or Unicode


character.
Set the range displayed in the active Memory window
to span the memory allocated to the selected item.
Remove the selected watch item.

Remove all the watches.

Right-clicking a watch item shows a shortcut menu with commands that are not available from the toolbar.

Button Description
View pointer or array as a null-terminated string.

View pointer or array as an array.

View pointer value.

Set watch value to zero.

Set watch value to one.

Increment watched variable by one.

Decrement watched variable by one.

125
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Negated watched variable.

Invert watched variable.

View the properties of the watch value.

You can view details of the watched item using the Properties dialog.

Filename
The filename context of the watch item.

Line number
The line number context of the watch item.

(Name)
The name of the watch item.

Address
The address or register of the watch item.

Expression
The debug expression of the watch item.

Previous Value
The previous watch value.

Size In Bytes
The size of the watch item in bytes.

Type
The type of the watch item.

Value
The value of the watch item.

Using the Watch window


Each expression appears as a row in the display. Each row contains the expression and its value. If the value of an
expression is structured (for example, an array), you can open the structure to see its contents.

The display updates each time the debugger locates to source code. So it will update each time your program
stops on a breakpoint, or single steps, and whenever you traverse the call stack. Items that have changed since
they were previously displayed are highlighted in red.

To activate the Watch window:


Choose View > Watch > Watch 1 or press Ctrl+T, W, 1.

126
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

You can show other Watch windows similarly.

You can add a new expression to be watched by clicking and typing into the last entry in the Watch window.
You can change an expression by clicking its entry and editing its contents.

When you select a variable in the main part of the display, the display format button highlighted on the Watch
window toolbar changes to show the item's display format.

To change the display format of an expression:

Right-click the item to change.


From the shortcut menu, choose the desired display format.

or

Click the item to change.


On the Watch window toolbar, select the desired display format.

The selected display format will then be used for all subsequent displays and will be preserved after the debug
session stops.

For C programs, the interpretation of pointer types can be changed by right-clicking and selecting from the
shortcut menu. A pointer can be interpreted as:

a null-terminated ASCII string


an array
an integer
dereferenced

To modify the value of an expression:

Click the value of the local variable to modify.


Enter the new value of the local variable. Prefix hexadecimal numbers with 0x, binary numbers with 0b,
and octal numbers with 0.

or

Right-click the value of the local variable to modify.


From the shortcut menu, choose one of the commands to modify the variable's value.

127
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Register window
The Register windows show the values of both CPU registers and the processor's special function or peripheral
registers. Because microcontrollers are becoming very highly integrated, it's not unusual for them to have
hundreds of special function registers or peripheral registers, so SEGGER Embedded Studio provides four
register windows. You can configure each register window to display one or more register groups for the
processor being debugged.

A Register window has a toolbar and a main data display.

Button Description
Display the CPU, special function register, and
peripheral register groups.
Display the CPU registers.

Hide the CPU registers.

Force-read a register, ignoring the access attribute of


the register.
Update the selected register group.

Set the active memory window to the address and size


of the selected register group.

Using the registers window


Both CPU registers and special function registers are shown in the main part of the Registers window. When the
program stops at a breakpoint, or is stepped, the Registers windows update to show the current values of the
registers. Items that have changed since they were previously displayed are highlighted in red.

To activate the first register window:

Choose View > Registers > Registers 1 or press Ctrl+T, R, 1.

Other register windows can be similarly activated.

Displaying CPU registers


The values of the CPU registers displayed in the Registers window depend up upon the selected context. The
selected context can be:

The register state the CPU stopped in.


The register state when a function call occurred using the Call Stack window.

128
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

The register state of the currently selected thread using the the Threads window.
The register state you supplied with the Debug > Locate operation.

To display a group of CPU registers:

On the Registers window toolbar, click the Groups button.


From the pop-up menu, select the register groups to display and deselect the ones to hide.

You can deselect all CPU register groups to allow more space in the display for special function registers or
peripheral registers. So, for instance, you can have one register window showing the CPU registers and other
register windows showing different peripheral registers.

Displaying special function or peripheral registers


The Registers window shows the set of register groups defined in the memory-map file the application was built
with. If there is no memory-map file associated with a project, the Registers window will show only the CPU
registers.

To display a special function or peripheral register:

On the Registers toolbar, click the Groups button.


From the pop-up menu, select the register groups to display and deselect the ones to hide.

Changing display format


When you select a register in the main part of the display, the display-format button highlighted on the
Registers window toolbar changes to show the item's display format.

To change the display format of a register:

Right-click the item to change.


From the shortcut menu, choose the desired display format.

or

Click the item to change.


On the Registers window toolbar, select the desired display format.

Modifying register values

To modify the value of a register:

Click the value of the register to modify.

129
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Enter the new value for the register. Prefix hexadecimal numbers with 0x, binary numbers with 0b, and
octal numbers with 0.

or

Right-click the value of the register to modify.


From the shortcut menu, choose one of the commands to modify the register value.

Modifying the saved register value of a function or thread may not be supported.

130
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Memory window
The Memory window shows the contents of the connected target's memory areas and allows the memory to be
edited. SEGGER Embedded Studio provides four memory windows, you can configure each memory window to
display different memory ranges.

The Memory window has a toolbar and a data display/edit area

Field/Button Description
Address to display. This can be a numeric value or a
Address
debug expression.
Size Number of bytes to display. This can be a number or
a debug expression. If unspecified, the number of
bytes required to fill the window will be automatically
calculated.
Columns Number of columns to display. If unspecified, the
number of columns required to fill the window will be
automatically calculated.
Select binary display.

Select octal display.

Select unsigned decimal display.

Select signed decimal display.

Select hexadecimal display (default).

Select byte display (default).

Select 2-byte display.

Select 4-byte display.

Display both data and text (default).

Display data only.

Display text only.

Display an incrementing address range that starts from


the selected address (default).
Display a decrementing address range that starts from
the selected address.

131
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Display an incrementing address range that ends at


the selected address.
Display a decrementing address range that ends at the
selected address.
Evaluate the address and size expressions, and update
the Memory window.

Using the memory window


The memory window does not show the complete address space of the target, instead you must enter both the
address and the number of bytes to display. You can specify the address and size using numeric values or debug
expressions which enable you to position the memory display at the address of a variable or at the value of a
register. You can also specify whether you want the expressions to be evaluated each time the memory window
is updated, or you can re-evaluate them yourself with the press of a button. Memory windows update each time
your program stops on a breakpoint, after a single step and whenever you traverse the call stack. If any values
that were previously displayed have changed, they are highlighted in red.

To activate the first Memory window:


Choose View > Memory > Memory 1 or press Ctrl+T, M, 1.

Other register windows can be similarly activated.

Using the mouse


You can move the memory window's edit cursor by clicking on a data or text entry.

The vertical scroll bar can be used to modify the address being viewed by clicking the up and down buttons, the
page up and down areas or using the vertical scroll wheel when the scroll bar is at it's furthest extent. Holding
down the Shift key while scrolling will prevent the address being modified.

Using the keyboard


Keystroke Description
Move the cursor up one line, or if the cursor is on the
Up
first line, move the address up one line.
Down Move the cursor down one line, or if the cursor is on
the last line, move the address down line line.
Left Move the cursor left one character.
Right Move the cursor right one character.
Home Move the cursor to the first entry.
End Move the cursor to the last entry.

132
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

PageUp Move the cursor up one page, or if the cursor is on first


page, move the address up one page.
PageDown Move the cursor down one page, or if the cursor is on
the last page, move the address down one page.
Ctrl+E Toggle the cursor between data and text editing.

Editing memory
To edit memory, simply move the cursor to the data or text entry you want to modify and start typing. The
memory entry will be written and read back as you type.

Shortcut menu commands


The shortcut menu contains the following commands:

Action Description
Access Memory By Display Width Access memory in terms of the display width.
Address Order Specify whether the address range shown uses
Address as the start or end address and whether
addresses should increment or decrement.
Auto Evaluate Re-evaluate Address and Size each time the Memory
window is updated.
Auto Refresh Specify how frequently the memory window should
automatically refresh.
Export To Binary Editor Create a binary editor with the current Memory
window contents.
Save As Save the current Memory window contents to a file.
Supported file formats are Binary File, Motorola S-
Record File, Intel Hex File, TI Hex File, and Hex File.
Load From Load the current Memory window from a file.
Supported file formats are Binary File, Motorola S-
Record File, Intel Hex File, TI Hex File, and Hex File.

Display formats
You can set the Memory window to display 8-bit, 16-bit, and 32-bit values that are formatted as hexadecimal,
decimal, unsigned decimal, octal, or binary. You can also specify how many columns to display.

Saving memory contents


You can save the displayed contents of the memory window to a file in various formats. Alternatively, you can
export the contents to a binary editor to work on them.

133
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

You can save the displayed memory values as a binary file, Motorola S-record file, Intel hex file, or a Texas
Instruments TXT file.

To save the current state of memory to a file:

Select the start address and number of bytes to save by editing the Start Address and Size fields in the
Memory window toolbar.
Right-click the main memory display.
From the shortcut menu, select Save As, then choose the format from the submenu.

To export the current state of memory to a binary editor:

Select the start address and number of bytes to save by editing the Start Address and Size fields in the
Memory window toolbar.
Right-click the main memory display.
Choose Export to Binary Editor from the shortcut menu.

Note that subsequent modifications in the binary editor will not modify memory in the target.

Copying to clipboard
You can copy the contents of the memory window to the clipboard as text. If an address range is selected, the
data or text of the selected range will be copied to the clipboard depending on whether the selection has been
made in the data or text view. If no address range is selected, the current memory window view will be copied to
the clipboard.

134
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Breakpoints window
The Breakpoints window manages the list of currently set breakpoints on the solution. Using the Breakpoints
window, you can:

Enable, disable, and delete existing breakpoints.


Add new breakpoints.
Show the status of existing breakpoints.

Breakpoints are stored in the session file, so they will be remembered each time you work on a particular
project. When running in the debugger, you can set breakpoints on assembly code addresses. These low-level
breakpoints appear in the Breakpoints window for the duration of the debug run but are not saved when you
stop debugging.

When a breakpoint is reached, the matching breakpoint is highlighted in the Breakpoints window.

Breakpoints window layout


The Breakpoints window has a toolbar and a main breakpoint display.

Button Description
Create a new breakpoint using the New Breakpoint
dialog.
Toggle the selected breakpoint between enabled and
disabled states.
Remove the selected breakpoint.

Move the insertion point to the statement where the


selected breakpoint is set.
Delete all breakpoints.

Disable all breakpoints.

Enable all breakpoints.

Create a new breakpoint group and makes it active.

The main part of the Breakpoints window shows what breakpoints are set and the state they are in. You can
organize breakpoints into folders, called breakpoint groups.

SEGGER Embedded Studio displays these icons to the left of each breakpoint:

Icon Description

135
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Enabled breakpoint An enabled breakpoint will stop


your program running when the breakpoint condition
is met.
Disabled breakpoint A disabled breakpoint will not
stop the program when execution passes through it.
Invalid breakpoint An invalid breakpoint is one
where the breakpoint cannot be set; for example, no
executable code is associated with the source code
line where the breakpoint is set or the processor does
not have enough hardware breakpoints.

Showing the Breakpoints window

To activate the Breakpoints window:

Choose Breakpoints > Breakpoints or press Ctrl+Alt+B.

Managing single breakpoints


You can manage breakpoints in the Breakpoint window.

To delete a breakpoint:

In the Breakpoints window, click the breakpoint to delete.


From the Breakpoints window toolbar, click the Delete Breakpoint} button.

To edit a breakpoint:

In the Breakpoints window, right-click the breakpoint to edit.


Choose Edit Breakpoint from the shortcut menu.
Edit the breakpoint in the New Breakpoint dialog.

To toggle the enabled state of a breakpoint:

In the Breakpoints window, right-click the breakpoint to enable or disable.


Choose Enable/Disable Breakpoint from the shortcut menu.

or

In the Breakpoints window, click the breakpoint to enable or disable.


Press Ctrl+F9.

136
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Breakpoint groups
Breakpoints are divided into breakpoint groups. You can use breakpoint groups to specify sets of breakpoints
that are applicable to a particular project in the solution or for a particular debug scenario. Initially, there is a
single breakpoint group, named Default, to which all new breakpoints are added.

To create a new breakpoint group:


From the Breakpoints window toolbar, click the New Breakpoint Group button.

or

From the Debug menu, choose Breakpoints then New Breakpoint Group.

or

Right-click anywhere in the Breakpoints window.


Choose New Breakpoint Group from the shortcut menu.

In the New Breakpoint Group dialog, enter the name of the breakpoint group.

When you create a breakpoint, it is added to the active breakpoint group.

To make a group the active group:


In the Breakpoints window, right-click the breakpoint group to make active.
Choose Set as Active Group from the shortcut menu.

To delete a breakpoint group:


In the Breakpoints window, right-click the breakpoint group to delete.
Choose Delete Breakpoint Group from the shortcut menu.

You can enable all breakpoints within a group at once.

To enable all breakpoints in a group:


In the Breakpoints window, right-click the breakpoint group to enable.
Choose Enable Breakpoint Group from the shortcut menu.

You can disable all breakpoints within a group at once.

To disable all breakpoints in a group:


In the Breakpoints window, right-click the breakpoint group to disable.
Choose Disable Breakpoint Group from the shortcut menu.

Managing all breakpoints


You can delete, enable, or disable all breakpoints at once.

137
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

To delete all breakpoints:

Choose Breakpoints > Clear All Breakpoints or press Ctrl+Shift+F9.

or

On the Breakpoints window toolbar, click the Delete All Breakpoints button.

To enable all breakpoints:

Choose Breakpoints > Enable All Breakpoints or press Ctrl+B, N.

or

On the Breakpoints window toolbar, click the Enable All Breakpoints button.

To disable all breakpoints:

Choose Breakpoints > Disable All Breakpoints or press Ctrl+B, X.

or

On the Breakpoints window toolbar, click the Disable All Breakpoints button.

138
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Call Stack window


The Call Stack window displays the list of function calls (stack frames) that were active when program execution
halted. When execution halts, SEGGER Embedded Studio populates the call-stack window from the active
(currently executing) task. For simple, single-threaded applications not using the SEGGER Embedded Studio for
ARM tasking library, there is only a single task; but for multi-tasking programs that use the SEGGER Embedded
Studio for ARM Tasking Library, there may be any number of tasks. SEGGER Embedded Studio updates the Call
Stack window when you change the active task in the Threads window.

The Call Stack window has a toolbar and a main call-stack display.

Button Description
Move the insertion point to where the call was made
to the selected frame.
Set the debugger context to the selected stack frame.

Move the debugger context down one stack to the


called function.
Move the debugger context up one stack to the calling
function.
Select the fields to display for each entry in the call
stack.
Set the debugger context to the most recent stack
frame and move the insertion point to the currently
executing statement.

The main part of the Call Stack window displays each unfinished function call (active stack frame) at the point
when program execution halted. The most recent stack frame is displayed at the bottom of the list and the
oldest is displayed at the top of the list.

SEGGER Embedded Studio displays these icons to the left of each function name:

Icon Description
Indicates the stack frame of the current task.

Indicates the stack frame selected for the debugger


context.
Indicates that a breakpoint is active and when the
function returns to its caller.

These icons can be overlaid to show, for instance, the debugger context and a breakpoint on the same stack
frame.

139
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Showing the call-stack window

To activate the Call Stack window:

Choose View > Call Stack or press Ctrl+Alt+S.

Configuring the call-stack window


Each entry in the Call Stack window displays the function name and, additionally, parameter names, types, and
values. You can configure the Call Stack window to show varying amounts of information for each stack frame.
By default, SEGGER Embedded Studio displays all information.

To show or hide a field:

1. On the Call Stack toolbar, click the Options button on the far right.
2. Select the fields to show, and deselect the ones that should be hidden.

Changing the debugger context


You can select the stack frame for the debugger context from the Call Stack window.

To move the debugger context to a specific stack frame:

In the Call Stack window, double-click the stack frame to move to.

or

In the Call Stack window, select the stack frame to move to.
On the Call Stack window's toolbar, click the Switch To Frame button.

or

In the Call Stack window, right-click the stack frame to move to.
Choose Switch To Frame from the shortcut menu.

The debugger moves the insertion point to the statement where the call was made. If there is no debug
information for the statement at the call location, SEGGER Embedded Studio opens a disassembly window at the
instruction.

To move the debugger context up one stack frame:

On the Call Stack window's toolbar, click the Up One Stack Frame button.

or

140
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

On the Debug Location toolbar, click the Up One Stack Frame button.

or

Press Alt+-.

The debugger moves the insertion point to the statement where the call was made. If there is no debug
information for the statement at the call location, SEGGER Embedded Studio opens a disassembly window at the
instruction.

To move the debugger context down one stack frame:

On the Call Stack window's toolbar, click the Down One Stack Frame button.

or

On the Debug Location toolbar, click the Down One Stack Frame button.

or

Press Alt++.

The debugger moves the insertion point to the statement where the call was made. If there is no debug
information for the statement at the call location, SEGGER Embedded Studio opens a disassembly window at the
instruction.

Setting a breakpoint on a return to a function

To set a breakpoint on return to a function:

In the Call Stack window, click the stack frame on the function to stop at on return.
On the Build toolbar, click the Toggle Breakpoint button.

or

In the Call Stack window, click the stack frame on the function to stop at on return.
Press F9.

or

In the Call Stack window, right-click the function to stop at on return.


Choose Toggle Breakpoint from the shortcut menu.

141
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Threads window
The Threads window displays the set of executing contexts on the target processor structured as a set of
queues.

To activate the Threads window:


Choose View > More Debug Windows > Threads or press Ctrl+Alt+H.

The window is populated using the threads script, which is a JavaScript program store in a file whose file-type
project option is "Threads Script" (or is called threads.js) and is in the project that is being debugged.

When debugging starts, the threads script is loaded and the function init() is called to determine which columns
are displayed in the Threads window.

When the application stops on a breakpoint, the function update() is called to create entries in the Threads
window corresponding to the columns that have been created together with the saved execution context
(register state) of the thread. By double-clicking one of the entries, the debugger displays its saved execution
contextto put the debugger back into the default execution context, use Show Next Statement.

Writing the threads script


The threads script controls the Threads window with the Threads object.

The methods Threads.setColumns, Threads.setSortByNumber and Threads.setColor can be called from the
function init().

function init()
{
Threads.setColumns("Name", "Priority", "State", "Time");
Threads.setSortByNumber("Time");
Threads.setColor("State", "Ready", "Executing", "Waiting");
}

The above example creates the named columns Name, Priority, State, and Time in the Threads window, with
the Time column sorted numerically rather than alphabetically. The states Ready, Executing and Waiting will
have yellow, green and red colored pixmaps respectively.

If you don't supply the function init() in the threads script, the Threads window will create the default columns
Name, Priority, and State.

The methods Threads.clear(), Threads.newqueue(), and Threads.add() can be called from the function
update().

The Threads.clear() method clears the Threads window.

The Threads.newqueue() function takes a string argument and creates a new, top-level entry in the Threads
window. Subsequent entries added to this window will go under this entry. If you don't call this, new entries will
all be at the top level of the Threads window.

142
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

The Threads.add() function takes a variable number of string arguments, which should correspond to the
number of columns displayed by the Threads window. The last argument to the Threads.add() function
should be an array (possibly empty) containing the registers of the thread or, alternatively, a handle that can
be supplied a call to the threads script function getregs(handle), which will return an array when the thread is
selected in the Threads window. The array containing the registers should have elements in the same order in
which they are displayed in the CPU Registers displaytypically this will be in register-number order, e.g., r0, r1,
and so on.

function update()
{
Threads.clear();
Threads.newqueue("My Tasks");
Threads.add("Task1", "0", "Executing", "1000", [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]);
Threads.add("Task2", "1", "Waiting", "2000", [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]);
}

The above example will create a fixed output on the Threads window and is here to demonstrate how to call the
methods.

To get real thread state, you need to access the debugger from the threads script. To do this, you can use
the JavaScript method Debug.evaluate("expression"), which will evaluate the string argument as a debug
expression and return the result. The returned result will be an object if you evaluate an expression that denotes
a structure or an array. If the expression denotes a structure, each field can be accessed by using its field name.

So, if you have structs in the application as follows

struct task {
char *name;
unsigned char priority;
char *state;
unsigned time;
struct task *next;
unsigned registers[17];
unsigned thread_local_storage[4];
};

struct task task2 =


{
"Task2",
1,
"Waiting",
2000,
0,
{ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 },
{ 0,1,2,3 }
};

struct task task1 =


{
"Task1",
0,
"Executing",
1000,
&task2,
{ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 },

143
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

{ 0,1,2,3 }
};

you can update() the Threads window using the following:

task1 = Debug.evaluate("task1");
Threads.add(task1.name, task1.priority, task1.state, task1.time, task1.registers);

You can use pointers and C-style cast to enable linked-list traversal.

var next = Debug.evaluate("&task1");


while (next)
{
var xt = Debug.evaluate("*(struct task*)"+next);
Threads.add(xt.name, xt.priority, xt.state, xt.time, xt.registers);
next = xt.next;
}

Note that, if the threads script goes into an endless loop, the debuggerand consequently SEGGER Embedded
Studiowill become unresponsive and you will need to kill SEGGER Embedded Studio using a task manager.
Therefore, the above loop is better coded as follows:

var next = Debug.evaluate("&task1");


var count = 0;
while (next && count < 10)
{
var xt = Debug.evaluate("*(struct task*)"+next);
Threads.add(xt.name, xt.priority, xt.state, xt.time, xt.registers);
next = xt.next;
count++;
}

You can speed up the Threads window update by not supplying the registers of the thread to the Threads.add()
function. To do this, you should supply a handle/pointer to the thread as the last argument to the Threads.add()
function. For example:

var next = Debug.evaluate("&task1");


var count = 0;
while (next && count < 10)
{
var xt = Debug.evaluate("*(struct task*)"+next);
Threads.add(xt.name, xt.priority, xt.state, xt.time, next);
next=xt.next;
count++;
}

When the thread is selected, the Threads window will call getregs(x) in the threads script. That function should
return the array of registers, for example:

function getregs(x)
{
return Debug.evaluate("((struct task*)"+x+")->registers");
}

144
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

If you use thread local storage, implementing the gettls(x) function enables you to return the base address of
the thread local storage, for example:

function gettls(x)
{
return Debug.evaluate("((struct task*)"+x+")->thread_local_storage");
}

The gettls(x) function can also be called with null as a parameter. In this case you will have to evaluate an
expression that returns the current thread local storage, for example:

function gettls(x)
{
if (x==null)
x = Debug.evaluate("&currentTask");
return Debug.evaluate("((struct task*)"+x+")->thread_local_storage");
}

The debugger may require the name of a thread which you can provide by implementing the getname(x)
function, for example:

function getname(x)
{
return Debug.evaluate("((struct task*)"+x+")->name");
}

Adding extra queues to the threads window

You can add extra information to the threads window to display other RTOS queues. In the function init() you
can use Threads.setColumns2 to create an additional display in the threads window, for example:

function init()
{
...
Threads.setColumns2("Timers", "Id(Timers)", "Name", "Hook", "Timeout", "Period", "Active");

The first argument is identifier of the queue which is also supplied to Threads.add2 in the function update() as
follows

function update()
{
...
Threads.add2("Timers", "0x1FF0A30", "MyTimer", "0x46C8 (Timer50)", "50(550)", "50", "1");

145
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Execution Profile window


The Execution Profile window shows a list of source locations and the number of times those source locations
have been executed. This window is only available for targets that support the collection of jump trace
information.

To activate the Execution Profile window:

Choose View > More Debug Windows > Execution Profile or press Ctrl+T, P.

The count value displayed is the number of times the first instruction of the source code location has been
executed. The source locations displayed are target dependent: they could represent each statement of the
program or each jump target of the program. If however the debugger is in intermixed or disassembly mode
then the count values will be displayed on a per instruction basis.

The execution counts window is updated each time your program stops and the window is visible so if you have
this window displayed then single stepping may be slower than usual.

146
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Execution Trace window


The trace window displays historical information on the instructions executed by the target.

To activate the Trace window:

Choose View > More Debug Windows > Execution Trace or press Ctrl+T, T.

The type and number of the trace entries depends upon the target that is connected when gathering trace
information. Some targets may trace all instructions, others may trace jump instructions, and some may trace
modifications to variables. You'll find the trace capabilities of your target on the shortcut menu.

Each entry in the trace window has a unique number, and the lower the number the earlier the trace. You can
click on the header to show earliest to latest or the latest to earliest trace entries. If a trace entry can have source
code located to it then double-clicking the trace entry will show the appropriate source display.

Some targets may provide timing information which will be displayed in the ticks column.

The trace window is updated each time the debugger stops when it is visible so single stepping is likely to be
slower if you have this window displayed.

147
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Debug file search editor


When a program is built with debugging enabled, the debugging information contains the paths and filenames
of all the source files for the program in order to allow the debugger to find them. If a program or library linked
into the program is on a different machine than the one on which it was compiled, or if the source files were
moved after the program was compiled, the debugger will not be able to find the source files.

In this situation, the simplest way to help SEGGER Embedded Studio find the source files is to add the directory
containing the source files to one of its source-file search paths. Alternatively, if SEGGER Embedded Studio
cannot find a source file, it will prompt you for its location and will record its new location in the source-file map.

Debug source-file search paths


Debug's source-file search paths can be used to help the debugger locate source files that are no longer located
where they were at compile time. When a source file cannot be found, the search-path directories will be
checked, in turn, to see if they contain the source file. SEGGER Embedded Studio maintains two debug source-
file search paths:

Project-session search path:This path is for the current project session and does not apply to all projects.
The global search path:This system-wide path applies to all projects.

The project-session search path is checked before the global search path.

To edit the debug search paths:


Choose Debug > Options > Search Paths.

Debug source file map


If a source file cannot be found while debugging and the debugger has to prompt the user for its location,
the results are stored in the debug source file map. The debug source file map simply correlates, or maps, the
original pathnames to the new locations. When a file cannot be found at its original location or in the debug
search paths, the debug source file map is checked to see if a new location has been recorded for the file or if the
user has specified that the file does not exist. Each project session maintains its own source file map, the map is
not shared by all projects.

To view the debug source file map:


Choose Debug > Options > Search Paths.

To remove individual entries from the debug source file map:


Choose Debug > Options > Search Paths.

148
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Right-click the mapping to delete.


Choose Delete Mapping from the shortcut menu.

To remove all entries from the debug source file map:

Choose Debug > Options > Search Paths.


Right-click any mapping.
Choose Delete All Mappings from the shortcut menu.

149
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Debug Terminal window


The Debug Terminal window displays debug output from the target application and can also be used to be
provide debug input to the target application.

To activate the Debug Terminal window:

Choose View > Debug Terminal or press Ctrl+Alt+D.

150
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Breakpoint expressions
The debugger can set breakpoints by evaluating simple C-like expressions. Note that the exact capabilities
offered by the hardware to assist in data breakpointing will vary from target to target; please refer to the
particular target interface you are using and the capabilities of your target silicon for exact details. The simplest
expression supported is a symbol name. If the symbol name is a function, a breakpoint occurs when the first
instruction of the symbol is about to be executed. If the symbol name is a variable, a breakpoint occurs when the
symbol has been accessed; this is termed a data breakpoint. For example, the expression x will breakpoint when
x is accessed. You can use a debug expression (see Debug expressions) as a breakpoint expression. For example,
x[4] will breakpoint when element 4 of array x is accessed, and @sp will breakpoint when the sp register is
accessed.

Data breakpoints can be specified, using the == operator, to occur when a symbol is accessed with a specific
value. The expression x == 4 will breakpoint when x is accessed and its value is 4. The operators <, >=, >;, >=,
==, and != can be used similarly. For example, @sp <= 0x1000 will breakpoint when register sp is accessed
and its value is less than or equal to 0x1000.

You can use the operator & to mask the value you wish to break on. For example, (x & 1) == 1 will
breakpoint when x is accessed and has an odd value.

You can use the operator && to combine comparisons. For example

(x >= 2) && (x <= 14)

will breakpoint when x is accessed and its value is between 2 and 14.

You can specify an arbitrary memory range using an array cast expression. For example, (char[256])
(0x1000) will breakpoint when the memory region 0x10000x10FF is accessed.

You can specify an inverse memory range using the ! operator. For example !(char[256])(0x1000) will
breakpoint when memory outside the range 0x10000x10FF is accessed.

151
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Debug expressions
The debugger can evaluate simple expressions that can be displayed in the Watch window or as a tool-tip in the
code editor.

The simplest expression is an identifier the debugger tries to interpret in the following order:

an identifier that exists in the scope of the current context.


the name of a global identifier in the program of the current context.

Numbers can be used in expressions. Hexadecimal numbers must be prefixed with 0x.

Registers can be referenced by prefixing the register name with @.

The standard C and C++ operators !, ~, *, /, %, +, -, >>, <<, <, <=, >, >=, ==, |, &, ^, &&, and || are supported
on numeric types.

The standard assignment operators =, +=, -=, *=, /=, %=, >>, >>=, <<=, &=, |=, ^= are supported on numeric
types.

The array subscript operator [] is supported on array and pointer types.

The structure access operator . is supported on structured types (this also works on pointers to structures), and -
> works similarly.

The dereference operator (prefix *) is supported on pointers, the address-of (prefix &) and sizeof operators are
supported.

The addressof(filename, linenumber) operator will return the address of the specified source code line
number.

Function calling with parameters and return results.

Casting to basic pointer types is supported. For example, (unsigned char *)0x300 can be used to display the
memory at a given location.

Casting to basic array types is supported. For example, (unsigned char[256])0x100 can be used to reference a
memory region.

Arrays can be sliced using [a:b] where a is the first element and b is the last element to display.

Operators have the precedence and associativity one expects of a C-like programming language.

152
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

Terminal emulator window


The Terminal Emulator window contains a basic serial-terminal emulator that allows you to receive and transmit
data over a serial interface.

To activate the Terminal Emulator window:

Choose Tools > Terminal Emulator > Terminal Emulator or press Ctrl+Alt+M.

To use the terminal emulator:

1. Set the required terminal emulator properties.


2. Connect the terminal emulator to the communications port by clicking the button on the toolbar or by
selecting Connect from the shortcut menu.

Once connected, any input in the Terminal Emulator window is sent to the communications port and any data
received from the communications port is displayed on the terminal.

Connection may be refused if the communication port is in use by another application or if the port doesn't
exist.

To disconnect the terminal emulator:

1. Disconnect the communications port by clicking the Disconnect icon on the toolbar or by right-clicking
to select Disconnect from the shortcut menu.

This will release the communications port for use in other applications.

Supported control codes


The terminal supports a limited set of control codes:

Control code Description


<BS> Backspace
<CR> Carriage return
<LF> Linefeed
<ESC>[{attr1};...;{attrn}m Set display attributes. The attributes 2-Dim, 5-Blink, 7-
Reverse, and 8-Hidden are not supported.

153
Embedded Studio for ARM Reference Manual SEGGER Embedded Studio User Guide

154
Embedded Studio for ARM Reference Manual Command-line options

Command-line options
This section describes the command-line options accepted by SEGGER Embedded Studio.

Usage

emStudio [options] [files]

155
Embedded Studio for ARM Reference Manual Command-line options

-D (Define macro)
Syntax

-D macro=value

Description

Define a SEGGER Embedded Studio for ARM macro value.

156
Embedded Studio for ARM Reference Manual Command-line options

-noclang (Disable Clang support)


Syntax

-noclang

Description

Disable Clang support.

157
Embedded Studio for ARM Reference Manual Command-line options

-noload (Disable loading of last project)


Syntax

-noload

Description

Disable loading of last project on startup.

158
Embedded Studio for ARM Reference Manual Command-line options

-packagesdir (Specify packages directory)


Syntax

-packagesdir dir

Description

Override the default value of the $(PackagesDir) macro.

159
Embedded Studio for ARM Reference Manual Command-line options

-permit-multiple-studio-instances (Permit multiple


studio instances)
Syntax

-permit-multiple-studio-instances

Description

Allow multiple instances of SEGGER Embedded Studio to run at the same time. This behaviour can also be
enabled using the Environment > Startup Options > Allow Multiple SEGGER Embedded Studios environment
option.

160
Embedded Studio for ARM Reference Manual Command-line options

-rootuserdir (Set the root user data directory)


Syntax

-rootuserdir dir

Description

Set the SEGGER Embedded Studio for ARM root user data directory.

161
Embedded Studio for ARM Reference Manual Command-line options

-save-settings-off (Disable saving of environment


settings)
Syntax

-save-settings-off

Description

Disable the saving of modified environment settings.

162
Embedded Studio for ARM Reference Manual Command-line options

-set-setting (Set environment setting)


Syntax

-set-setting environment_setting=value

Description

Sets an environment setting to a specified value. For example:

-set-setting "Environment/Build/Show Command Lines=Yes"

163
Embedded Studio for ARM Reference Manual Command-line options

-templatesfile (Set project templates path)


Syntax

-templatesfile path

Description

Sets the search path for finding project template files.

164
Embedded Studio for ARM Reference Manual Uninstalling SEGGER Embedded Studio for ARM

Uninstalling SEGGER Embedded Studio for


ARM
This section describes how to completely uninstall SEGGER Embedded Studio for ARM for each supported
operating system:

Uninstalling SEGGER Embedded Studio for ARM from Windows


Uninstalling SEGGER Embedded Studio for ARM from Mac OS X
Uninstalling SEGGER Embedded Studio for ARM from Linux

Uninstalling SEGGER Embedded Studio for ARM from


Windows

Removing user data and settings


The uninstaller does not remove any user data such as settings or installed packages. To completely remove the
user data you will need to carry out the following operations for each user that has used SEGGER Embedded
Studio for ARM on your system.

To remove user data using SEGGER Embedded Studio:

1. Start SEGGER Embedded Studio.

165
Embedded Studio for ARM Reference Manual Uninstalling SEGGER Embedded Studio for ARM

2. Click Tools > Admin > Remove All User Data...

Alternatively, if SEGGER Embedded Studio for ARM has already been uninstalled you can manually remove the
user data as follows:

1. Click the Windows Start button.


2. Type %LOCALAPPDATA% in the search field and press enter to open the local application data folder.
3. Open the SEGGER folder.
4. Open the SEGGER Embedded Studio for ARM folder.
5. Delete the v6 folder.
6. If you want to delete user data for all versions of the software, delete the SEGGER Embedded Studio for ARM
folder as well.

Uninstalling SEGGER Embedded Studio for ARM


To uninstall SEGGER Embedded Studio for ARM:

1. If SEGGER Embedded Studio is running, click File > Exit to shut it down.
2. Click the Start Menu and select Control Panel. The Control Panel window will open.
3. In the Control Panel window, click the Uninstall a program link under the Programs section.
4. From the list of currently installed programs, select SEGGER Embedded Studio for ARM 6.32b.
5. To begin the uninstall, click the Uninstall button at the top of the list.

Uninstalling SEGGER Embedded Studio for ARM from Mac OS


X

Removing user data and settings


Uninstalling does not remove any user data such as settings or installed packages. To completely remove the
user data you will need to carry out the following operations for each user that has used SEGGER Embedded
Studio for ARM on your system.

To remove user data using SEGGER Embedded Studio:

1. Start SEGGER Embedded Studio.


2. Click Tools > Admin > Remove All User Data...

Alternatively, if SEGGER Embedded Studio for ARM has already been uninstalled you can manually remove the
user data as follows:

1. Open Finder.
2. Go to the $HOME/Library/SEGGER/SEGGER Embedded Studio for ARM directory.

166
Embedded Studio for ARM Reference Manual Uninstalling SEGGER Embedded Studio for ARM

3. Drag the v6 folder to the Trash.


4. If you want to delete user data for all versions of the software, drag the SEGGER Embedded Studio for ARM
folder to the Trash as well.

Uninstalling SEGGER Embedded Studio for ARM


To uninstall SEGGER Embedded Studio for ARM:

1. If SEGGER Embedded Studio is running, shut it down.


2. Open the Applications folder in Finder.
3. Drag the SEGGER Embedded Studio for ARM 6.32b folder to the Trash.

Uninstalling SEGGER Embedded Studio for ARM from Linux

Removing user data and settings


The uninstaller does not remove any user data such as settings or installed packages. To completely remove the
user data you will need to carry out the following operations for each user that has used SEGGER Embedded
Studio for ARM on your system.

To remove user data using SEGGER Embedded Studio:

1. Start SEGGER Embedded Studio.


2. Click Tools > Admin > Remove All User Data...

Alternatively, if SEGGER Embedded Studio for ARM has already been uninstalled you can manually remove the
user data as follows:

1. Open a terminal window or file browser.


2. Go to the $HOME/.segger/SEGGER Embedded Studio for ARM directory.
3. Delete the v6 directory.
4. If you want to delete user data for all versions of the software, delete the SEGGER Embedded Studio for ARM
directory as well.

Uninstalling SEGGER Embedded Studio for ARM


To uninstall SEGGER Embedded Studio for ARM:

1. If SEGGER Embedded Studio is running, click File > Exit to shut it down.
2. Open a terminal window.
3. Go to the SEGGER Embedded Studio for ARM bin directory (this is /usr/share/
segger_embedded_studio_for_arm_6.32b/bin by default).
4. Run sudo ./uninstall to start the uninstaller.

167
Embedded Studio for ARM Reference Manual Uninstalling SEGGER Embedded Studio for ARM

168
Embedded Studio for ARM Reference Manual ARM target support

ARM target support


When a target-specific executable project is created using the New Project Wizard, the following default files are
added to the project:

Target_Startup.s The target-specific startup code. See Target startup code.


crt0.s/thumb_crt0.s The SEGGER Embedded Studio for ARM standard C runtime. See Startup
code.
Target_MemoryMap.xml The target-specific memory map file for the board. See Section Placement. Note
that, for some targets, a general linker placement file may not be suitable. In these cases, there will be two
memory-map files: one for a flash build and one for a RAM build.
flash_placement.xml The linker placement file for a flash build.
sram_placement.xml The linker placement file for a RAM build.

Initially, shared versions of these files are added to the project. If you want to modify any these shared files,
select the file in the Project Explorer and then click the Import option from the shortcut menu. This will copy a
writable version of the file into your project directory and change the path in the Project Explorer to that of the
local version. You can then make changes to the local file without affecting the shared copy of it.

The following list describes the typical flow of a C program created with SEGGER Embedded Studio's project
templates:

The processor jumps to the reset_handler label in the target-specific startup code, which configures the
target (see Target startup code).
When the target is configured, the target-specific startup code jumps to the _start entry point in the C
runtime code, which sets up the C runtime environment (see Startup code).

169
Embedded Studio for ARM Reference Manual ARM target support

When the C runtime environment has been set up, the C runtime code jumps to the C entry-point
function, main.
When the program returns from main, it re-enters the C runtime code, executes the destructors and
enters an endless loop.

170
Embedded Studio for ARM Reference Manual ARM target support

Target startup code


The following section describes the role of the target-specific startup code.

When you create a new project to produce an executable file using a target-specific project template, a file
containing the default startup code for the target will be added to the project. Initially, a shared version of this
file will be added to the project; if you want to modify this file, select the file in the Project Explorer and select
Import to copy the file to your project directory.

ARM and Cortex-A/Cortex-R startup code


The target startup file typically consists of the exception vector table and the default set of exception handlers.

_vectors This is the exception vector table. It is put into its own .vectors section in order to ensure that it
is can be placed at a specific address which is usually 0x00000000 or the start of Flash memory. The vector
table contains jump instructions to the particular exception handlers. It is recommended that absolute
jump instructions are used ldr pc, =handler_address rather than relative branch instructions b
handler_address since many devices shadow the memory at address zero to start execution but the
program will be linked to run at a different address.
reset_handler The reset handler will usually carry out any target-specific initialization and then will jump
to the _start entry point. In a C system, the _start entry point is in the crt0.s file. During development it
is usual to replace the reset handler with an endless loop which will stop the device running potentially
dangerous in-development code directly out of reset. In development the debugger will start the device
from the specified debug entry point.
undef_handler This is the default, undefined-instruction exception handler.*
swi_handler This is the default, software-interrupt exception handler.*
pabort_handler This is the default, prefetch-abort exception handler.*
dabort_handler This is the default, data-abort exception handler.*
irq_handler This is the default, IRQ-exception handler.*
fiq_handler This is the default, FIQ-exception handler.*

*
Declared as a weak symbol to allow the user to override the implementation.

Note that ARM and Cortex-A/Cortex-R exception handlers must be written in ARM assembly code. The CPU
or board support package of the project you have created will typically supply an ARM assembly-coded
irq_handler implementation that will enable you to write interrupt service routines as C functions.

Cortex-M startup code


The target startup file typically consists of the exception vector table and the default set of exception handlers.

171
Embedded Studio for ARM Reference Manual ARM target support

_vectors This is the exception vector table. It is put into its own .vectors section in order to ensure that it
can be placed at a specific address which is usually 0x00000000 or the start of Flash memory.

The vector table is structured as follows:

The first entry is the initial value of the stack pointer.


The second entry is the address of the reset handler function. The reset handler will usually carry out any
target-specific initialization and then jump to the _start entry point. In a C system, the _start entry point
is in the thumb_crt0.s file. During development it is usual to replace this jump with an endless loop
which will stop the device running potentially dangerous in-development code directly out of reset. In
development the debugger will start the device from the specified debug entry point.
The following 15 entries are the addresses of the standard Cortex-M exception handlers ending with the
SysTick_ISR entry.
Subsequent entries are addresses of device-specific interrupt sources and their associated handlers.

For each exception handler, a weak symbol is declared that will implement an endless loop. You can
implement your own exception handler as a regular C function. Note that the name of the C function
must match the name in the startup code e.g. void SysTick_ISR(void). You can use the C preprocessor to
rename the symbol in the startup code if you have existing code with different exception handler names e.g.
SysTick_ISR=SysTick_Handler.

172
Embedded Studio for ARM Reference Manual ARM target support

Startup code
The following section describes the role of the C runtime-startup code, crt0.s (and the Cortex-M/Thumb
equivalent thumb_crt0.s).

When you create a new project to produce an executable file using a target-specific project template, the crt0.s/
thumb_crt0.s file is added to the project. Initially, a shared version of this file is added to the project. If you want
to modify this file, right-click it in the Project Explorer and then select Import from the shortcut menu to copy
the file to your project directory.

The entry point of the C runtime-startup code is _start. In a typical system, this will be called by the target-
specific startup code after it has initialized the target.

The C runtime carries out the following actions:

Initialize the stacks.


If required, copy the contents of the .data (initialized data) section from non-volatile memory.
If required, copy the contents of the .fast section from non-volatile memory to SRAM.
Initialize the .bss section to zero.
Initialize the heap.
Call constructors.
If compiled with FULL_LIBRARY, get the command line from the host using debug_getargs and set
registers to supply argc and argv to main.
Call the main entry point.

On return from main or when exit is called

If compiled with FULL_LIBRARY, call destructors.


If compiled with FULL_LIBRARY, call atexit functions.
If compiled with FULL_LIBRARY, call debug_exit while supplying the return result from main.
Wait in exit loop.

Program sections
The following program sections are used for the C runtime in section-placement files:

Section name Description


.vectors The exception vector table.
.init Startup code that runs before the call to the
application's main function.
.ctors Static constructor function table.
.dtors Static destructor function table.
.text The program code.

173
Embedded Studio for ARM Reference Manual ARM target support

.fast Code to copy from flash to RAM for fast execution.


.data The initialized static data.
.bss The zeroed static data.
.rodata The read-only constants and literals of the program.
.ARM.exidx The C++ exception table.
.tbss Thread local storage zero'd data followed by
.tdata Thread local storage initialised data.

Stacks
ARM and Cortex-A/Cortex-R devices have six separate stacks. The position and size of these stacks are specified
in the project's section-placement or memory-map file by the following program sections:

Section name Linker size symbol Description


.stack __STACKSIZE__ System and User mode stack.
.stack_svc __STACKSIZE_SVC__ Supervisor mode stack
.stack_irq __STACKSIZE_IRQ__ IRQ mode stack
.stack_fiq __STACKSIZE_FIQ__ FIQ mode stack
.stack_abt __STACKSIZE_ABT__ Abort mode stack
.stack_und __STACKSIZE_UND__ Undefined mode stack

Cortex-M devices have the following stacks and linker symbol stack sizes are defined:

Section name Linker size symbol Description


.stack __STACKSIZE__ Main stack.
.stack_process __STACKSIZE_PROCESS__ Process stack.

The crt0.s/thumb_crt0.s startup code references these sections and initializes each of the stack-pointer registers
to point to the appropriate location. To change the location in memory of a particular stack, the section should
be moved to the required position in the section-placement or memory-map file.

Should your application not require one or more of these stacks, you can remove those sections from the
memory-map file or set the size to 0 and remove the initialization code from the crt0.s/thumb_crt0.s file.

The .data section


The .data section contains the initialized data. If the run address is different from the load address, as it would
be in a flash-based application in order to allow the program to run from reset, the crt0.s/thumb_crt0.s
startup code will copy the .data section from the load address to the run address before calling the main entry
point.

174
Embedded Studio for ARM Reference Manual ARM target support

The .fast section


For performance reasons, it is a common requirement for embedded systems to run critical code from fast
memory; the .fast section can be used to simplify this. If the .fast section's run address is different from the load
address, the crt0.s/thumb_crt0.s startup code will copy the .fast section from the load address to the run
address before calling the main entry point.

The .bss Section


The .bss section contains the zero-initialized data. The startup code in crt0.s/thumb_crt0.s references the
.bss section and sets its contents to zero.

The heap
The position and size of the heap is specified in the project's section-placement or memory-map file by the
.heap program section.

The startup code in crt0.s/thumb_crt0.s references this section and initializes the heap. To change the
position of the heap, the section should be moved to the required position in the section-placement or memory-
map file.

There is a Heap Size linker project option you can modify in order to alter the heap size. For compatibility with
earlier versions of SEGGER Embedded Studio, you can also specify the heap size using the heap section's Size
attribute in the section-placement or memory-map file.

Should your application not require the heap functions, you can remove the heap section from the memory-
map file or set the size to zero and remove the heap-initialization code from the crt0.s/thumb_crt0.s file.

175
Embedded Studio for ARM Reference Manual ARM target support

Section Placement
Section placement files map program sections used in your program into the memory spaces defined in the
memory map or in the Memory Segments project option. For instance, it's common for code and read-only data
to be programmed into non-volatile flash memory, whereas read-write data needs to be mapped onto either
internal or external RAM.

Memory map files are provided in the CPU support package you are using and are referenced in executable
projects by the Memory Map File project option. Section-placement files are provided in the base SEGGER
Embedded Studio for ARM distribution.

The memory segments defined in the section placement files have macro-expandable names which can be
defined using the Section Placement Macros project option.

Some of the section placement files have a macro-expandable start attribute in the first program section. You
can use this to reserve space at the beginning of the memory segment.

ARM section placement


The following placement files are supplied for ARM targets:

File Description
Single FLASH segment with internal RAM segment and
flash_placement.xml
optional external RAM segment.
flash_run_text_from_ram_placement.xml Single FLASH segment with internal RAM segment
and optional external RAM segments. Text section is
copied from FLASH to RAM.
internal_sram_placement.xml Single internal RAM segment.
multi_flash_placement.xml Two FLASH segments with internal RAM segment and
optional external RAM segment.
sram_placement.xml Internal RAM segment and optional external RAM
segment.
tcm_placement.xml Data and Instruction tightly coupled memory
segments.

Cortex-M section placement


The following placement files are supplied for Cortex-M targets:

File Description
flash_placement.xml Two FLASH segments and two RAM segments.
flash_placement_tcm.xml One FLASH segments, two RAM segments, Data and
Instruction tightly coupled memory segments.

176
Embedded Studio for ARM Reference Manual ARM target support

flash_placement2.xml One FLASH segment and two RAM segments.


flash_to_ram_placement.xml One FLASH segment and one RAM segment. Text
section is copied from FLASH to RAM.
flash_to_ram_placement_tcm.xml One FLASH segment, two RAM segments, Data and
Instruction tightly coupled memory segments. Text
section is copied from FLASH to RAM.
flash_to_ram_placement2.xml One FLASH segment and two RAM segments. Text
section is copied from FLASH to RAM.
flash_to_tcm_placement.xml Two FLASH segments, two RAM segments, Data and
Instruction tightly coupled memory segments.
ram_placement.xml Two RAM segments.
tcm_placement.xml Data and Instruction tightly coupled memory
segments.

177
Embedded Studio for ARM Reference Manual ARM target support

178
Embedded Studio for ARM Reference Manual Using the SEGGER Assembler

Using the SEGGER Assembler


You can use the SEGGER assembler by setting the project option Assembler to SEGGER.

179
Embedded Studio for ARM Reference Manual Using the SEGGER Assembler

180
Embedded Studio for ARM Reference Manual Using the SEGGER Linker

Using the SEGGER Linker


You can create a new project that builds using the SEGGER linker by choosing the project template

A C executable for a Cortex-M processor

from the New Project wizard. Alternatively you can modify an existing project as follows:

Set the project option Linker to SEGGER.


Set the project option Linker Script File to $(StudioDir)/samples/SEGGER_Flash.icf.
Set the project option Supply Memory Segments To Linker to Yes.
Set the project option Exclude From Build on the thumb_crt0.s file in your project.
Add the startup file $(StudioDir)/samples/SEGGER_THUMB_Startup.s to your project.

181
Embedded Studio for ARM Reference Manual Using the SEGGER Linker

182
Embedded Studio for ARM Reference Manual Using the SEGGER Runtime Library

Using the SEGGER Runtime Library


You can create a new project that builds using the SEGGER Runtime Library by choosing the project template

A C executable for a Cortex-M processor

from the New Project wizard. Alternatively you can modify an existing project as follows:

Set the project option Run Time Library to SEGGER.


Set the project option Compiler to SEGGER.

183
Embedded Studio for ARM Reference Manual Using the SEGGER Runtime Library

184
Embedded Studio for ARM Reference Manual C++ Library User Guide

C++ Library User Guide


SEGGER Embedded Studio for ARM provides a limited C++ library suitable for use in an embedded application.

Standard library
The following C++ standard header files are provided in $(StudioDir)/include:

File Description
<cassert> C++ wrapper on assert.h.
<cctype> C++ wrapper on ctype.h.
<cerrno> C++ wrapper on errno.h.
<cfloat> C++ wrapper on float.h.
<ciso646> C++ wrapper on iso646.h.
<climits> C++ wrapper on limits.h.
<clocale> C++ wrapper on locale.h.
<cmath> C++ wrapper on math.h.
<csetjmp> C++ wrapper on setjmp.h.
<cstdarg> C++ wrapper on stdarg.h.
<cstddef> C++ wrapper on stddef.h.
<cstdint> C++ wrapper on stdint.h.
<cstdio> C++ wrapper on stdio.h.
<cstdlib> C++ wrapper on stdlib.h.

185
Embedded Studio for ARM Reference Manual C++ Library User Guide

<cstring> C++ wrapper on string.h.


<ctime> C++ wrapper on time.h.
<cwchar> C++ wrapper on wchar.h.
<cwctype> C++ wrapper on wctype.h.
<exception> Definitions for exceptions.
<new> Types and definitions for placement new and delete.
<typeinfo> Definitions for RTTI.

186
Embedded Studio for ARM Reference Manual C++ Library User Guide

Standard template library


The C++ STL functionality of STLPort is provided as a separate library package use Tools > Package Manager to
install this package.

187
Embedded Studio for ARM Reference Manual C++ Library User Guide

Subset API reference


This section contains a subset reference to the SEGGER Embedded Studio for ARM C++ library.

188
Embedded Studio for ARM Reference Manual C++ Library User Guide

<new> - memory allocation


The header file <new> defines functions for memory allocation.

Functions
set_new_handler Establish a function which is called when memory
allocation fails.
Operators
operator delete Heap storage deallocators operator.
operator new Heap storage allocators operator.

189
Embedded Studio for ARM Reference Manual C++ Library User Guide

operator delete
Synopsis

void operator delete(void *ptr) throw();

void operator delete[](void *ptr) throw();

Description

operator delete deallocates space of an object.

operator delete will do nothing if ptr is null. If ptr is not null then it should have been returned from a call to
operator new.

operator delete[] has the same behaviour as operator delete but is used for array deallocation.

Portability

Standard C++.

190
Embedded Studio for ARM Reference Manual C++ Library User Guide

operator new
Synopsis

void *operator new(size_t size) throw();

void *operator new[](size_t size) throw();

Description

operator new allocates space for an object whose size is specified by size and whose value is indeterminate.

operator new returns a null pointer if the space for the object cannot be allocated from free memory; if space for
the object can be allocated, operator new returns a pointer to the start of the allocated space.

operator new[] has the same behaviour as operator new but is used for array allocation.

Portability

The implementation is not standard. The standard C++ implementation should throw an exception if memory
allocation fails.

191
Embedded Studio for ARM Reference Manual C++ Library User Guide

set_new_handler
Synopsis

typedef void (*new_handler)();

new_handler set_new_handler(new_handler) throw();

Description

set_new_handler establishes a new_handler function.

set_new_handler establishes a new_handler function that is called when operator new fails to allocate the
requested memory. If the new_handler function returns then operator new will attempt to allocate the memory
again. The new_handler function can throw an exception to implement standard C++ behaviour for memory
allocation failure.

Portability

Standard C++.

192
Embedded Studio for ARM Reference Manual Utilities Reference

Utilities Reference

193
Embedded Studio for ARM Reference Manual Utilities Reference

Compiler driver
This section describes the switches accepted by the compiler driver, cc. The compiler driver is capable of
controlling compilation by all supported language compilers and the final link by the linker. It can also construct
libraries automatically.

In contrast to many compilation and assembly language development systems, with SEGGER Embedded Studio
for ARM you don't invoke the assembler or compiler directly. Instead you'll normally use the compiler driver cc as
it provides an easy way to get files compiled, assembled, and linked. This section will introduce you to using the
compiler driver to convert your source files to object files, executables, or other formats.

We recommend that you use the compiler driver rather than use the assembler or compiler directly because
there the driver can assemble multiple files using one command line and can invoke the linker for you too. There
is no reason why you should not invoke the assembler or compiler directly yourself, but you'll find that typing in
all the required options is quite tedious-and why do that when cc will provide them for you automatically?

194
Embedded Studio for ARM Reference Manual Utilities Reference

File naming conventions


The compiler driver uses file extensions to distinguish the language the source file is written in. The compiler
driver recognizes the extension .c as C source files, .cpp, .cc or .cxx as C++ source files, .s and .asm as assembly
code files.

The compiler driver recognizes the extension .o as object files, .a as library files, .ld as linker script files and .xml
as special-purpose XML files.

We strongly recommend that you adopt these extensions for your source files and object files because you'll find
that using the tools is much easier if you do.

C language files

When the compiler driver finds a file with a .c extension, it runs the C compiler to convert it to object code.

C++ language files

When the compiler driver finds a file with a .cpp extension, it runs the C++ compiler to convert it to object code.

Assembly language files

When the compiler driver finds a file with a .s or .asm extension, it runs the C preprocessor and then the
assembler to convert it to object code.

Object code files

When the compiler driver finds a file with a .o or .a extension, it passes it to the linker to include it in the final
application.

195
Embedded Studio for ARM Reference Manual Utilities Reference

Command-line options
This section describes the command-line options accepted by the SEGGER Embedded Studio for ARM compiler
driver.

196
Embedded Studio for ARM Reference Manual Utilities Reference

-allow-multiple-definition (Allow multiple symbol


definition)
Syntax

-allow-multiple-definition

Description

Do not generate an error when linking multiple symbols of the same name.

197
Embedded Studio for ARM Reference Manual Utilities Reference

-ansi (Warn about potential ANSI problems)


Syntax

-ansi

Description

Warn about potential problems that conflict with the relevant ANSI or ISO standard for the files that are
compiled.

198
Embedded Studio for ARM Reference Manual Utilities Reference

-ar (Archive output)


Syntax

-ar

Description

This switch instructs the compiler driver to archive all output files into a library. Using -ar implies -c.

Example

The following command compiles file1.c, file2.asm, and file3.c to object code and archives them into the library
file libfunc.a together with the object file file4.o.

cc -ar file1.c file2.asm file3.c file4.o -o libfunc.a

199
Embedded Studio for ARM Reference Manual Utilities Reference

-arch (ARM architecture)


Syntax

-arch=a

-arch=list

Description

Specifies the ARM architecture to generate code for and the library variants to link with.

Example

To force compilation for V7A architecture you would use:

cc -arch=v7A

To list supported architectures:

cc -arch=list

200
Embedded Studio for ARM Reference Manual Utilities Reference

-be (ARM Big Endian)


Syntax

-be

-be8

Description

Generate code for a big endian (word or byte) target. Default generates little endian code.

201
Embedded Studio for ARM Reference Manual Utilities Reference

-builtins (Use Builtins)


Syntax

-builtins

Description

Use builtin compiler functions, for example memcpy. Default does not use builtin compiler functions.

202
Embedded Studio for ARM Reference Manual Utilities Reference

-c (Compile to object code, do not link)


Syntax

-c

Description

All named files are compiled to object code modules, but are not linked. You can use the -o option to name the
output if you just supply one input filename.

Example

The following command compiles file1.c and file4.c to produce the object files file1.o and file4.o.

cc -c file1.c file4.c

The following command compiles file1.c and produces the object file obj/file1.o.

cc -c file.c -o obj/file1.o

203
Embedded Studio for ARM Reference Manual Utilities Reference

-clang (Use clang compiler/assembler)


Syntax

-clang

Description

Use the clang compiler and assembler. Default is to use the GNU compiler and assembler.

204
Embedded Studio for ARM Reference Manual Utilities Reference

-cmselib (ARM Create CMSE import library)


Syntax

-cmselib=l

Description

Create an import library (an object file) containing the symbols that represent the addresses of secure gateways
to the entry functions of the linked executable.

205
Embedded Studio for ARM Reference Manual Utilities Reference

-codec (Set file codec)


Syntax

-codec=c

-codec=list

Description

Set the file codec to use for the source file.

Example

To set the codec for a utf-8 encoded file:

cc -codec=utf-8

To list supported codecs:

cc -codec=list

206
Embedded Studio for ARM Reference Manual Utilities Reference

-common (Allocate globals in common)


Syntax

-common

Description

Allocate declarations of zero initialized variables. This enables variables that have been declared (perhaps
multiple times) but not defined to be allocated. The default requires a single definition of each zero initialized
variable.

207
Embedded Studio for ARM Reference Manual Utilities Reference

-cpu (ARM cpu core)


Syntax

-cpu=c

-cpu=list

Description

Specifies the cpu core to generate code for and the libraries to link against.

Example

To force compilation for Cortex-M3 core you would use:

cc -cpu=Cortex-M3

To list supported cores:

cc -cpu=list

208
Embedded Studio for ARM Reference Manual Utilities Reference

-d (Define linker symbol)


Syntax

-dname=value

Description

You can define linker symbols using the -d option. The symbol definitions are passed to linker.

Example

The following defines the symbol, STACK_SIZE with a value of 512.

-dSTACK_SIZE=512

209
Embedded Studio for ARM Reference Manual Utilities Reference

-debugio (ARM Define debugio implementation)


Syntax

-debugio=bkpt

-debugio=dcc

-debugio=mempoll

Description

Specifies the debugio implementation to link with. The default for architectures that have the ARM instruction
set will use dcc and architectures that have only the Thumb-2 instruction set will use mempoll.

Example

The following selects the breakpoint debugio implementation for a cortex-m3 cpu

cc -cpu=Cortex-M3 -debugio=bkpt

210
Embedded Studio for ARM Reference Manual Utilities Reference

-depend (Generate dependency file)


Syntax

-depend file

Description

Create a dependency file in file (suitable for inclusion into a makefile) when compiling a source file.

cc -c main.c -depend main.d

211
Embedded Studio for ARM Reference Manual Utilities Reference

-D (Define macro symbol)


Syntax

-Dname
-Dname=value

Description

You can define preprocessor macros using the -D option. The macro definitions are passed on to the respective
language compiler which is responsible for interpreting the definitions and providing them to the programmer
within the language.

The first form above defines the macro name but without an associated replacement value, and the second
defines the same macro with the replacement value value.

Example

The following defines two macros, SUPPORT_FLOAT with a value of 1 and LITTLE_ENDIAN with no replacement
value.

-DSUPPORT_FLOAT=1 -DLITTLE_ENDIAN

212
Embedded Studio for ARM Reference Manual Utilities Reference

-emit-relocs (Emit relocations)


Syntax

-emit-relocs

Description

Keep relocations in the executable file

213
Embedded Studio for ARM Reference Manual Utilities Reference

-e (Set entry point symbol)


Syntax

-ename

Description

Linker option to set the entry point symbol to be name. The debugger will start execution from this symbol.

214
Embedded Studio for ARM Reference Manual Utilities Reference

-exceptions (Enable C++ Exception Support)


Syntax

-exceptions

Description

Enables C++ exceptions to be compiled.

215
Embedded Studio for ARM Reference Manual Utilities Reference

-E (Preprocess)
Syntax

-E

Description

This option preprocesses the supplied file and outputs the result to the standard output.

Example

The following preprocesses the file file.c supplying the macros, SUPPORT_FLOAT with a value of 1 and
LITTLE_ENDIAN.

-E -DSUPPORT_FLOAT=1 -DLITTLE_ENDIAN file.c

216
Embedded Studio for ARM Reference Manual Utilities Reference

-fill (Fill gaps)


Syntax

-fill=b

Description

Specify the byte value b to fill gaps in the output file produced by the linker.

217
Embedded Studio for ARM Reference Manual Utilities Reference

-fabi (ARM Floating Point Code Generation)


Syntax

-fabi=softfp

-fabi=hard

Description

Specifies the type of floating point code generation. The default is to use the software floating point
implementation. If you use softfp then FPU instructions are generated, floating point arguments to functions
are supplied in CPU registers. If you use hard then FPU instructions are generated, floating point arguments to
functions are supplied in FPU registers.

218
Embedded Studio for ARM Reference Manual Utilities Reference

-fpu (ARM FPU)


Syntax

-fpu=a

-fpu=list

Description

Specifies the floating point unit to generate code for when the fpabi option has been supplied.

Example

The following selects the fpu for a Cortex-M4

cc -cpu=Cortex-M4 -fpu=FPv4-SP-D16

To list supported cores:

cc -fpu=list

219
Embedded Studio for ARM Reference Manual Utilities Reference

-framepointer (Enable generation of framepointer)


Syntax

-framepointer

Description

The -framepointer option instructs the compiler to store the stack frame pointer in a register.

220
Embedded Studio for ARM Reference Manual Utilities Reference

-F (Set output format)


Syntax

-Ffmt

Description

The -F option instructs the compiler driver to generate an additional output file in the format fmt. The compiler
driver supports the following formats:

-Fbin Create a .bin file


-Fhex Create a .hex file
-Fsrec Create a .srec file

The compiler driver will always output a .elf file as specified with the -o option. The name of the additional
output file is the same as the .elf file with the file extension changed.

For example

cc file.c -o file.elf -Fbin

will generate the files file.elf and file.bin.

221
Embedded Studio for ARM Reference Manual Utilities Reference

-g (Generate debugging information)


Syntax

-g

-g1

-g2

-g3

Description

The -g option instructs the compiler and assembler to generate source level debugging information.

The -g1 option instructs the compiler to generate backtrace and line number debugging information.

The -g2 option instructs the compiler to generate backtrace, line number and variable display debugging
information.

The -g3 option instructs the compiler to generate backtrace, line number, variable display and macro display
debugging information.

The default is to not generate any debugging information.

222
Embedded Studio for ARM Reference Manual Utilities Reference

-hascmse (ARM Generate cmse instructions)


Syntax

-hascmse

Description

The -hascmse option allows the compiler to generate code for the secure state of the v8m architecture.

223
Embedded Studio for ARM Reference Manual Utilities Reference

-hascrc (ARM Generate crc instructions)


Syntax

-hascrc

Description

The -hascrc option allows the compiler to generate crc instructions for v8a architecture.

224
Embedded Studio for ARM Reference Manual Utilities Reference

-hascrypto (ARM Generate crypto instructions)


Syntax

-hascrypto

Description

The -hascrypto option allows the compiler to generate crypto instructions for v8a architecture.

225
Embedded Studio for ARM Reference Manual Utilities Reference

-hasdsp (ARM Generate dsp instructions)


Syntax

-hasdsp

Description

The -hasdsp option allows the compiler to generate dsp instructions for v8m architecture.

226
Embedded Studio for ARM Reference Manual Utilities Reference

-hasidiv (ARM Generate integer divide instructions)


Syntax

-hasidiv

Description

The -hasidiv option instructs the compiler to generate integer divide instructions for v7a and v7r architectures.

227
Embedded Studio for ARM Reference Manual Utilities Reference

-hassmallmultiplier (ARM Do not generate multiply


instructions)
Syntax

-hassmallmultiplier

Description

The -hassmallmultiplier option instructs the compiler to avoid generating multiply instructions for v6m
architectures depending on code to be generated and optimization level requested.

228
Embedded Studio for ARM Reference Manual Utilities Reference

-help (Display help information)


Syntax

-help

Description

Displays a short summary of the options accepted by the compiler driver.

229
Embedded Studio for ARM Reference Manual Utilities Reference

-instrument (Instrument functions)


Syntax

-instrument

Description

This option causes the compiler to insert instrumentation calls on function entry and exit

230
Embedded Studio for ARM Reference Manual Utilities Reference

-I (Define user include directories)


Syntax

-Idirectory

Description

In order to find include files the compiler driver arranges for the compilers to search a number of standard
directories. You can add directories to the search path using the -I switch which is passed on to each of the
language processors.

You can specify more than one include directory by separating each directory component with either a comma
or semicolon.

231
Embedded Studio for ARM Reference Manual Utilities Reference

-I- (Exclude standard include directories)


Syntax

-I-

Description

Usually the compiler and assembler search for include files in the standard include directory created when the
product is installed. If for some reason you wish to exclude these system locations from being searched when
compiling a file, the -I- option will do this for you.

232
Embedded Studio for ARM Reference Manual Utilities Reference

-J (Define system include directories)


Syntax

-Jdirectory

Description

The -J option adds directory to the end of the list of directories to search for source files included (using
triangular brackets) by the #include preprocessor command.

You can specify more than one include directory by separating each directory component with either a comma
or semicolon in the property

233
Embedded Studio for ARM Reference Manual Utilities Reference

-kasm (Keep assembly code)


Syntax

-kasm

Description

The -kasm option instructs the compiler driver to keep intermediate assembly code files.

234
Embedded Studio for ARM Reference Manual Utilities Reference

-kldscript (Keep linker script)


Syntax

-kldscript

Description

The -kldscript option instructs the compiler driver to keep generated linker script files.

235
Embedded Studio for ARM Reference Manual Utilities Reference

-kpp (Keep preprocessor output)


Syntax

-kpp

Description

The -kpp option instructs the compiler driver to generate and keep intermediate preprocessor files.

236
Embedded Studio for ARM Reference Manual Utilities Reference

-K (Keep linker symbol)


Syntax

-Kname

Description

The linker removes unused code and data from the output file. This process is called deadstripping. To prevent
the linker from deadstripping unreferenced code and data you wish to keep, you must use the -K command line
option to force inclusion of symbols.

Example

If you have a C function, contextSwitch that must be kept in the output file (and which the linker will normally
remove), you can force its inclusion using:

-KcontextSwitch

237
Embedded Studio for ARM Reference Manual Utilities Reference

-l- (Do not link standard libraries)


Syntax

-l-

Description

The -l option instructs the compiler driver not to link standard libraries. If you use this option you must supply
your own library functions or libraries.

238
Embedded Studio for ARM Reference Manual Utilities Reference

-longcalls (ARM Generate long calling sequences)


Syntax

-longcalls

Description

The -longcalls option causes the compiler to generate long call code sequences.

239
Embedded Studio for ARM Reference Manual Utilities Reference

-lto (Enable link time optimization)


Syntax

-lto

Description

The -lto option causes the compiler to generate intermediate code which is optimized before the link.

240
Embedded Studio for ARM Reference Manual Utilities Reference

-L (Set library directory path)


Syntax

-Ldir

Description

Sets the library directory to dir. If -L is not specified on the command line, the default location to search for
libraries is set to $(InstallDir)/lib.

241
Embedded Studio for ARM Reference Manual Utilities Reference

-memorymap (Memory map file)


Syntax

-memorymap file

Description

The -memorymap option supplies the memory map file which is used to define the memory segments
referenced in the section placement file. See Memory Map file format for a description of the memory map file
format.

Example

-memorymap MemoryMap.xml

242
Embedded Studio for ARM Reference Manual Utilities Reference

-memorymapmacros (Memory map macros)


Syntax

-memorymapmacros macros

Description

The -memorymapmacros option supplies macro definitions that are applied to the memory map file.

Example

The macros FLASH_START and FLASH_SIZE are defined for the memory map using:

-memorymapmacros "FLASH_START=0x08000000;FLASH_SIZE=0x10000"

243
Embedded Studio for ARM Reference Manual Utilities Reference

-M (Display linkage map)


Syntax

-M

Description

The -M option prints a linkage map named the same as the linker output file with the .map file extension.

244
Embedded Studio for ARM Reference Manual Utilities Reference

-n (Dry run, no execution)


Syntax

-n

Description

When -n is specified, the compiler driver processes options as usual, but does not execute any subprocesses to
compile, assemble, archive or link applications.

245
Embedded Studio for ARM Reference Manual Utilities Reference

-nointerwork (ARM No interwork code for v4t)


Syntax

-nointerwork

Description

The -nointerwork option disables generation of bx lr instructions for v4t architectures.

246
Embedded Studio for ARM Reference Manual Utilities Reference

-nowarn-mismatch (ARM No warning on architecture


mismatch)
Syntax

-nowarn-mismatch

Description

When -nowarn-mismatch is specified, the linker will ignore architecture mismatches on object file and libraries.

247
Embedded Studio for ARM Reference Manual Utilities Reference

-nowarn-enumsize (ARM No warning on enum size


mismatch)
Syntax

-nowarn-enumsize

Description

When -nowarn-enumsize is specified, the linker will ignore enum size mismatches on object files and libraries.

248
Embedded Studio for ARM Reference Manual Utilities Reference

-nowarn-wcharsize (ARM No warning on wide


character size mismatch)
Syntax

-nowarn-wcharsize

Description

When -nowarn-wcharsize is specified, the linker will ignore wide character size mismatches on object files and
libraries.

249
Embedded Studio for ARM Reference Manual Utilities Reference

-nostderr (No stderr output)


Syntax

-nostderr

Description

When -nostderr is specified, any stderr output of subprocesses is redirected to stdout.

250
Embedded Studio for ARM Reference Manual Utilities Reference

-O (Optimize output)
Syntax

-Ox

Description

Pass the optimization option -Ox to the compiler and select library variant. The following options are supported:

-O0 No optimization, use libraries built with -O1.


-O1 Level 1 optimization, use libraries built with -O1.
-O2 Level 2 optimization, use libraries built with -O1.
-O3 Level 3 optimization, use libraries built with -O1.
-Oz Optimize for more size, use libraries built with -Os.
-Os Optimize for size, use libraries built with -Os.

251
Embedded Studio for ARM Reference Manual Utilities Reference

-o (Set output file name)


Syntax

-o filename

Description

The -o option instructs the compiler driver to write linker or archiver output to filename.

252
Embedded Studio for ARM Reference Manual Utilities Reference

-patch (Run patch command)


Syntax

-patch cmd

Description

The -patch option instructs the compiler driver to run the cmd after the link but before the creation of the
additional output file. The macro $(TargetPath) is expanded to the full path of the linked executable.

Example

This example will run the command mypatch replacing $(TargetPath) with myoutput.elf

-patch "mypatch $(TargetPath)" -o myoutput.elf -Fbin

The mypatch command can modify myoutput.elf before the creation of the myouput.bin.

253
Embedded Studio for ARM Reference Manual Utilities Reference

-placement (Section placement file)


Syntax

-placement file

Description

The -placement option supplies the section placement file which is used to control the placement of program
sections in the memory map segments. See Section Placement file format for a description of the section
placement file format.

Example

-memorymap MemoryMap.xml -placement flash.xml

254
Embedded Studio for ARM Reference Manual Utilities Reference

-placementmacros (Section placement macros)


Syntax

-placementmacros macros

Description

The -placementmacros option supplies macro definitions that are applied to the section placement file.

Example

The macros FLASH_START and FLASH_SIZE are defined for the section placement using:

-placementmacros "FLASH_START=0x08000000;FLASH_SIZE=0x10000"

255
Embedded Studio for ARM Reference Manual Utilities Reference

-placementsegments (Section placement segments)


Syntax

-placementsegments segments

Description

The -placementsegments option supplies segments descriptions to the section placement file. You can use this
rather than supplying a memory map file.

Example

A simple memory map with FLASH and SRAM can be supplied as follows:

-placementsegments "FLASH RX 0x0 0x10000;SRAM RWX 0x20000000 0x10000" -placement flash.xml

256
Embedded Studio for ARM Reference Manual Utilities Reference

-printf (Select printf capability)


Syntax

-printf=c

Description

The -printf option selects the printf capability for the linked executable. The options are:

-printf=i[p][w] integer is supported, optional width and precision and optional wchar
-printf=l[p][w] long integer is supported, optional width and precision and optional wchar
-printf=ll[p][w] long long integer is supported, optional width and precision and optional wchar
-printf=f[ll][w] float, width and precision supported, optional long long and optional wchar
-printf=d[ll][w] double, width and precision supported, optional long long and optional wchar

Example

The minimal sized printf

-printf=i

The maximal functionality printf

-printf=dllw

257
Embedded Studio for ARM Reference Manual Utilities Reference

-rtti (Enable C++ RTTI Support)


Syntax

-rtti

Description

Enables C++ run-time type information to be compiled.

258
Embedded Studio for ARM Reference Manual Utilities Reference

-R (Set section name)


Syntax

-Rx name

Description

These options name the default name of the sections generated by the compiler/assembler to be name. The
options are:

-Rc name change the default name of the code section


-Rd name change the default name of the data section
-Rk name change the default name of the const section
-Rz name change the default name of the bss section

259
Embedded Studio for ARM Reference Manual Utilities Reference

-scanf (Select scanf capability)


Syntax

-scanf= c

Description

The -scanf option selects the scanf capability for the linked executable. The options are:

-scanf=i[c] integer is supported, optional %[...] and %[^...] character class


-scanf=l[c] long integer is supported, optional %[...] and %[^...] character class
-scanf=ll[c] long long integer is supported, optional %[...] and %[^...] character class
-scanf=d[ll][c] floating point is supported, optional long long and %[...] and %[^...] character class

Example

The minimal sized scanf

-scanf=i

The maximal functionality scanf

-scanf=dllc

260
Embedded Studio for ARM Reference Manual Utilities Reference

-segger (Use SEGGER assembler/compiler/linker)


Syntax

-clang

Description

Use the SEGGER assembler, compiler and linker. Default is to use the GNU assembler, compiler and linker.

261
Embedded Studio for ARM Reference Manual Utilities Reference

-shortenums (ARM Minimal sized enums)


Syntax

-shortenums

Description

The -shortenums option instructs the compiler to set the size of an enumeration type to the smallest
appropriate data type.

262
Embedded Studio for ARM Reference Manual Utilities Reference

-shortwchar (ARM 16-bit wide chars)


Syntax

-shortwchar

Description

The -shortwchar option instructs the compiler to set the size of a wide character to 16-bit.

263
Embedded Studio for ARM Reference Manual Utilities Reference

-simd (ARM Generate vector processing code)


Syntax

-simd=neon

Description

The -simd option instructs the compiler to generate vector processing code.

264
Embedded Studio for ARM Reference Manual Utilities Reference

-std (Select language standard)


Syntax

-std=s

-std=list

Description

The -std option sets the language standard to use.

Example

To set the language to c99 core you would use:

cc -std=c99

To list supported language standards:

cc -std=list

265
Embedded Studio for ARM Reference Manual Utilities Reference

-strip (Strip symbols from executable)


Syntax

-stripsymbols

-stripdebug

Description

The -stripsymbols removes symbols from the linked executable.

The -stripdebug removes debugging information from the linked executable.

266
Embedded Studio for ARM Reference Manual Utilities Reference

-symbols (Link symbols)


Syntax

-symbols=s

Description

The -symbols option supplies the symbols file s to the linker.

267
Embedded Studio for ARM Reference Manual Utilities Reference

-thumb (ARM Generate thumb code)


Syntax

-thumb

Description

The -thumb option instructs the compiler to generate thumb code rather than ARM code and link in thumb
libraries. This option is NOT needed for Cortex-M architectures.

268
Embedded Studio for ARM Reference Manual Utilities Reference

-T (Supply linker script)


Syntax

-Tfile

Description

The -T option supplies the file to the linker as a linker script.

269
Embedded Studio for ARM Reference Manual Utilities Reference

-U (Undefine macro symbol)


Syntax

-Uname

Description

The -U option undefines the preprocessor macro name.

270
Embedded Studio for ARM Reference Manual Utilities Reference

-unwindtables (Generate unwind tables)


Syntax

-unwindtables

Description

The -unwind option instructs the compiler to generate unwind tables.

271
Embedded Studio for ARM Reference Manual Utilities Reference

-v (Verbose execution)
Syntax

-v

Description

The -v switch displays command lines executed by the compiler driver.

272
Embedded Studio for ARM Reference Manual Utilities Reference

-vectorize (ARM Generate vector processing code)


Syntax

-vectorize

Description

The -vectorize option instructs the compiler to generate vector processing code.

273
Embedded Studio for ARM Reference Manual Utilities Reference

-w (Suppress warnings)
Syntax

-w

Description

This option instructs the compiler, assembler, and linker not to issue any warnings.

274
Embedded Studio for ARM Reference Manual Utilities Reference

-we (Treat warnings as errors)


Syntax

-we

Description

This option directs the compiler, assembler, and linker to treat all warnings as errors.

275
Embedded Studio for ARM Reference Manual Utilities Reference

-W (Pass option to tool)


Syntax

-Wtool option

Description

The -W command-line option passes option directly to the specified tool. Supported tools are

-Wa pass option to assembler


-Wc pass option to compiler
-Wl pass option to linker

Example

The following example passes the (compiler specific) -version option to the compiler

cc -Wc-version

276
Embedded Studio for ARM Reference Manual Utilities Reference

-x (Specify file types)


Syntax

-x type

Description

The -x option causes the compiler driver to treat subsequent files to be of the following file type

-xa archives/libraries
-xasm assembly code files
-xc C code files
-xc++ C++ code files
-xo object code files

Example

The following command line enables an assembly code file with the extension .arm to be assembled.

cc -xasm a.arm

277
Embedded Studio for ARM Reference Manual Utilities Reference

Command-Line Project Builder


emBuild is a program used to build your software from the command line without using SEGGER Embedded
Studio. You can, for example, use emBuild for nightly (automated) builds, production builds, and batch builds.

278
Embedded Studio for ARM Reference Manual Utilities Reference

Building with a SEGGER Embedded Studio project file


You can specify a SEGGER Embedded Studio project file:

Syntax

emBuild [options] project-file

You must specify a configuration to build using -config. For instance:

emBuild -config "V5T Thumb LE Release" arm.emProject

The above example uses the configuration V5T Thumb LE Release to build all projects in the solution contained
in arm.emProject.

To build a specific project that is in a solution, you can specify it using the -project option. For example:

emBuild -config "V5T Thumb LE Release" -project "libm" libc.emProject

This example will use the configuration V5T Thumb LE Release to build the project libm that is contained in
libc.emProject.

If your project file imports other project files (using the <import> mechanism), when denoting projects you must
specify the solution names as a comma-separated list in parentheses after the project name:

emBuild -config "V5T Thumb LE Release" -project "libc(C Library)" arm.emProject

libc(C Library) specifies the libc project in the C Library solution that has been imported by the project file
arm.emProject.

To build a specific solution that has been imported from other project files, you can use the -solution option.
This option takes the solution names as a comma-separated list. For example:

emBuild -config "ARM Debug" -solution "ARM Targets,EB55" arm.emProject

In this example, ARM Targets,EB55 specifies the EB55 solution imported by the ARM Targets solution, which
was itself imported by the project file arm.emProject.

You can do a batch build using the -batch option:

emBuild -config "ARM Debug" -batch libc.emProject

This will build the projects in libc.emProject that are marked for batch build in the configuration ARM Debug.

By default, a make-style build will be donei.e., the dates of input files are checked against the dates of output
files, and the build is avoided if the output is up to date. You can force a complete build by using the -rebuild
option. Alternatively, to remove all output files, use the -clean option.

279
Embedded Studio for ARM Reference Manual Utilities Reference

To see the commands being used in the build, use the -echo option. To also see why commands are being
executed, use the -verbose option. You can see what commands will be executed, without executing them, by
using the -show option.

280
Embedded Studio for ARM Reference Manual Utilities Reference

Building without a SEGGER Embedded Studio project


file
To use emBuild without a SEGGER Embedded Studio project, specify the name of an installed project template,
the name of the project, and the files to build. For example:

emBuild -config -template LM3S_EXE -project myproject -file main.c

Or, instead of a template, you can specify a project type:

emBuild -config -type "Library" -project myproject -file main.c

You can specify project properties with the -property option:

emBuild -property Target=LM3S811

281
Embedded Studio for ARM Reference Manual Utilities Reference

Command-line options
This section describes the command-line options accepted by emBuild.

282
Embedded Studio for ARM Reference Manual Utilities Reference

-batch (Batch build)


Syntax

-batch

Description

Perform a batch build.

283
Embedded Studio for ARM Reference Manual Utilities Reference

-config (Select build configuration)


Syntax

-config name

Description

Specify the configuration for a build. If the configuration name can't be found, emBuild will list the available
configurations.

284
Embedded Studio for ARM Reference Manual Utilities Reference

-clean (Remove output files)


Syntax

-clean

Description

Remove all output files resulting from the build process.

285
Embedded Studio for ARM Reference Manual Utilities Reference

-D (Define macro)
Syntax

-D macro=value

Description

Define a SEGGER Embedded Studio for ARM macro value for the build process.

286
Embedded Studio for ARM Reference Manual Utilities Reference

-echo (Show command lines)


Syntax

-echo

Description

Show the command lines as they are executed.

287
Embedded Studio for ARM Reference Manual Utilities Reference

-file (Build a named file)


Syntax

-file name

Description

Build the file name. Use with -template or -type.

288
Embedded Studio for ARM Reference Manual Utilities Reference

-packagesdir (Specify packages directory)


Syntax

-packagesdir dir

Description

Override the default value of the $(PackagesDir) macro.

289
Embedded Studio for ARM Reference Manual Utilities Reference

-project (Specify project to build)


Syntax

-project name

Description

Specify the name of the project to build. When used with a project file, if emBuild can't find the specified project,
the names of available projects are listed.

290
Embedded Studio for ARM Reference Manual Utilities Reference

-property (Set project property)


Syntax

-property name=value

Description

Specify the value of a project property use with -template or -type. If emBuild cannot find the specified
property, a list of the properties is shown.

291
Embedded Studio for ARM Reference Manual Utilities Reference

-rebuild (Always rebuild)


Syntax

-rebuild

Description

Always execute the build commands.

292
Embedded Studio for ARM Reference Manual Utilities Reference

-show (Dry run, don't execute)


Syntax

-show

Description

Show the command lines that would be executed, but do not execute them.

293
Embedded Studio for ARM Reference Manual Utilities Reference

-solution (Specify solution to build)


Syntax

-solution name

Description

Specify the name of the solution to build. If emBuild cannot find the given solution, the valid solution names are
listed.

294
Embedded Studio for ARM Reference Manual Utilities Reference

-studiodir (Specify SEGGER Embedded Studio


directory)
Syntax

-studiodir name

Description

Override the default value of the $(StudioDir) macro.

295
Embedded Studio for ARM Reference Manual Utilities Reference

-template (Specify project template)


Syntax

-template name

Description

Specify the project template to use. If emBuild cannot find the specified template then a list of template names
is shown.

296
Embedded Studio for ARM Reference Manual Utilities Reference

-time (Time the build)


Syntax

-time

Description

Show the time taken for the build.

297
Embedded Studio for ARM Reference Manual Utilities Reference

-threadnum (Specify number of build threads)


Syntax

-threadnum n

Description

Specify the number of build threads to use for the build. The default is zero which will use the number of
processor cores on your machine.

298
Embedded Studio for ARM Reference Manual Utilities Reference

-type (Specify project type)


Syntax

-type name

Description

Specify the project type to use. If emBuild cannot find the specified project type then a list of project type names
is shown.

299
Embedded Studio for ARM Reference Manual Utilities Reference

-verbose (Show build information)


Syntax

-verbose

Description

Show extra information relating to the build process.

300
Embedded Studio for ARM Reference Manual Utilities Reference

Command-Line Simulator
emSim is a program that allows you to run SEGGER Embedded Studio's instruction set simulator from the
command line.

The primary purpose of emSim is to enable command line tests to be run.

Syntax

emSim file [options] args

301
Embedded Studio for ARM Reference Manual Utilities Reference

Command-line options
This section describes the command-line options accepted by emSim.

302
Embedded Studio for ARM Reference Manual Utilities Reference

file (Elf executable file)


Description

This is the name of the elf file to run on the simulator. The file will be run until it makes a debug request to exit.
The simulator will allocate memory regions based on the elf program sections.

Example

emSim app.elf

303
Embedded Studio for ARM Reference Manual Utilities Reference

-segments (Specify memory segments)


Syntax

-segments start;size;

Description

Specify the memory segments to simulate.

Example

emSim app.elf -segments 0x08000000;0x10000;0x20000000;0x10000

304
Embedded Studio for ARM Reference Manual Utilities Reference

args (User arguments)


Description

The arguments supplied to the elf file in the argc/argv parameters to the main function.

emSim app.elf hello world

305
Embedded Studio for ARM Reference Manual Utilities Reference

Command-Line Scripting
emScript is a program that allows you to run SEGGER Embedded Studio's JavaScript (ECMAScript) interpreter
from the command line.

The primary purpose of emScript is to facilitate the creation of platform-independent build scripts.

Syntax

emScript [options] file

306
Embedded Studio for ARM Reference Manual Utilities Reference

Command-line options
This section describes the command-line options accepted by emScript.

307
Embedded Studio for ARM Reference Manual Utilities Reference

-define (Define global variable)


Syntax

-define variable=value

Description

308
Embedded Studio for ARM Reference Manual Utilities Reference

-help (Show usage)


Syntax

-help

Description

Display usage information and command line options.

309
Embedded Studio for ARM Reference Manual Utilities Reference

-load (Load script file)


Syntax

-load path

Description

Loads the script file path.

310
Embedded Studio for ARM Reference Manual Utilities Reference

-define (Verbose output)


Syntax

-verbose

Description

Produces verbose output.

311
Embedded Studio for ARM Reference Manual Utilities Reference

emScript classes
emScript provides the following predefined classes:

BinaryFile
CWSys
ElfFile
WScript

312
Embedded Studio for ARM Reference Manual Utilities Reference

Example uses
The following example demonstrates using emScript to increment a build number:

First, add a JavaScript file to your project called incbuild.js containing the following code:

function incbuild()
{
var file = "buildnum.h"
var text = "#define BUILDNUMBER "
var s = CWSys.readStringFromFile(file);
var n;
if (s == undefined)
n = 1;
else
n = eval(s.substring(text.length)) + 1;
CWSys.writeStringToFile(file, text + n);
}

// Executed when script loaded.


incbuild();

Add a file called getbuildnum.h to your project containing the following code:

#ifndef GETBUILDNUM_H
#define GETBUILDNUM_H

unsigned getBuildNumber();

#endif

Add a file called getbuildnum.c to your project containing the following code:

#include "getbuildnum.h"
#include "buildnum.h"

unsigned getBuildNumber()
{
return BUILDNUMBER;
}

Now, to combine these:

Set the Build Options > Always Rebuild project property of getbuildnum.c to Yes.
Set the User Build Step Options > Pre-Compile Command project property of getbuildnum.c to
"$(StudioDir)/bin/emScript" -load "$(ProjectDir)/incbuild.js".

313
Embedded Studio for ARM Reference Manual Utilities Reference

Embed
Embed is a program that converts a binary file into a C/C++ array definition.

The primary purpose of the Embed tool is to provide a simple method of embedding files into an application.
This may be useful if you want to include firmware images, bitmaps, etc. in your application without having to
read them first from an external source.

Syntax

embed variable_name input_file output_file

variable_name is the name of the C/C++ array to be initialised with the binary data.

input_file is the path to the binary input file.

output_file is the path to the C/C++ source file to generate.

Example

To convert a binary file image.bin to a C/C++ file called image.h:

embed img image.bin image.h

This will generate the following output in image.h:

static const unsigned char img[] = {


0x5B, 0x95, 0xA4, 0x56, 0x16, 0x5F, 0x2D, 0x47,
0xC5, 0x04, 0xD4, 0x8D, 0x73, 0x40, 0x31, 0x66,
0x3E, 0x81, 0x90, 0x39, 0xA3, 0x8E, 0x22, 0x37,
0x3C, 0x63, 0xC8, 0x30, 0x90, 0x0C, 0x54, 0xA4,
0xA2, 0x74, 0xC2, 0x8C, 0x1D, 0x56, 0x57, 0x05,
0x45, 0xCE, 0x3B, 0x92, 0xAD, 0x0B, 0x2C, 0x39,
0x92, 0x59, 0xB9, 0x9D, 0x01, 0x30, 0x59, 0x9F,
0xC5, 0xEA, 0xCE, 0x35, 0xF6, 0x4B, 0x05, 0xBF
};

314
Embedded Studio for ARM Reference Manual Utilities Reference

Command-Line License Manager


The emLicense program can be used to install, remove and list licenses from the command line.

Usage Description
emLicense install license-strings... Install licenses
emLicense list List all installed licenses
emLicense remove license-ids... Remove licenses
Option Description
-erase-all-existing Erase all existing licenses when installing
-verbose Produce verbose output

The install command can be used to install licenses:

$ emLicense install license-strings...

The list command can be used to list installed licenses:

$ emLicense list
Product: SEGGER Embedded Studio for ARM
Ethernet MAC Address Lock: 01-02-03-04-05-06 (OK)
Licensed to: Joe Bloggs
License ID: 00010203-04050607-08090A0B-0C0D0E0F

The remove command can be used to uninstall licenses:

$ emLicense remove 00010203-04050607-08090A0B-0C0D0E0F

315
Embedded Studio for ARM Reference Manual Utilities Reference

Linker script file generator


The command line program mkld generates a GNU ld linker script from a SEGGER Embedded Studio for ARM
memory map or section placement file.

Syntax

mkld -memory-map-file inputfile outputfile [options]

inputfile is the name of the SEGGER Embedded Studio for ARM memory map file to generate the ld script from.
outputfile is the the name of the ld script file to write.

316
Embedded Studio for ARM Reference Manual Utilities Reference

Command-line options
This section describes the command-line options accepted by mkld.

317
Embedded Studio for ARM Reference Manual Utilities Reference

-check-section-overflow
Syntax

-check-section-overflow

Description

Add checks for memory section overflow to the linker script.

318
Embedded Studio for ARM Reference Manual Utilities Reference

-check-segment-overflow
Syntax

-check-segment-overflow

Description

Add checks for memory segment overflow to the linker script.

319
Embedded Studio for ARM Reference Manual Utilities Reference

-disable-missing-runin-error
Syntax

-disable-missing-runin-error

Description

Discard any sections with a missing run in section.

320
Embedded Studio for ARM Reference Manual Utilities Reference

-memory-map-file
Syntax

-memory-map-file filename

Description

Generate a GNU ld linker script from the SEGGER Embedded Studio for ARM memory map file filename.

321
Embedded Studio for ARM Reference Manual Utilities Reference

-memory-map-macros
Syntax

-memory-map-macros macro=value[;macro=value]

Description

Define SEGGER Embedded Studio for ARM macros to use when reading a memory map file.

322
Embedded Studio for ARM Reference Manual Utilities Reference

-no-check-unplaced-sections
Syntax

-no-check-unplaced-sections

Description

Removes checks for unplaced memory sections from the linker script.

323
Embedded Studio for ARM Reference Manual Utilities Reference

-section-placement-file
Syntax

-section-placement-file filename

Description

Generate a GNU ld linker script from the SEGGER Embedded Studio for ARM section placement file filename. If
this option is used, a memory map file should also be specified with the -memory-map-file option.

324
Embedded Studio for ARM Reference Manual Utilities Reference

-section-placement-macros
Syntax

-section-placement-macros macro=value[;macro=value]

Description

Define SEGGER Embedded Studio for ARM macros to use when reading a section placement file.

325
Embedded Studio for ARM Reference Manual Utilities Reference

-symbols
Syntax

-symbols symbol=value[;symbol=value]

Description

Add extra symbol definitions to the ld linker script.

326
Embedded Studio for ARM Reference Manual Utilities Reference

Package generator
To create a package the program mkpkg can be used. The set of files to put into the package should be
in the desired location in the $(PackagesDir) directory. The mkpkg command should be run with
$(PackagesDir) as the working directory and all files to go into the package must be referred to using
relative paths. A package must have a package description file that is placed in the $(PackagesDir)/
packages directory. The package description file name must end with _package.xml. If a package is to
create entries in the new project wizard then it must have a file name project_templates.xml.

For example, a package for the mythical FX150 processor would supply the following files:

A project template file called targets/FX150/project_templates.xml. The format of the


project templates file is described in Project Templates file format.
The $(PackagesDir)-relative files that define the functionality of the package.
A package description file called packages/FX150_package.xml. The format of the package
description file is described in Package Description file format.

The package file FX150.emPackage would be created using the following command line:

mkpkg -c packages/FX150.emPackage targets/FX150/project_templates.xml packages/


FX150_package.xml

You can exclude specific files or directories from being added to a package using the -exclude option:

mkpkg -c packages/FX150.emPackage targets/FX150 -exclude targets/FX150/excluded_file.txt -


exclude targets/FX150/excluded_directory packages/FX150_package.xml

You can list the contents of the package using the -t option:

mkpkg -t packages/FX150.emPackage

You can remove an entry from a package using the -d option:

mkpkg -d packages/FX150.emPackage -d fileName

You can add or replace a file into an existing package using the -r option:

mkpkg -r packages/FX150.emPackage -r fileName

You can extract files from an existing package using the -x option:

mkpkg -x packages/FX150.emPackage outputDirectory

You can automate the package creation process using a Combining project type.

Using the new project wizard create a combining project in the directory $(PackagesDir).
Set the Output File Path property to be $(PackagesDir)/packages/mypackage.emPackage.
Set the Combine command property to $(StudioDir)/bin/mkpkg -c $(CombiningOutputFilePath)
$(CombiningRelInputPaths).

327
Embedded Studio for ARM Reference Manual Utilities Reference

Add the files you want to go into the package into the project using the Project Explorer.
Right-click the project node in the Project Explorer and choose Build.

When a package is installed, the files in the package are copied into the desired $(PackagesDir)-relative
locations. When a file is copied into the $(PackagesDir)/packages directory and its filename ends with
_package.xml the file $(PackagesDir)/packages/installed_packages.xml is updated with an
entry:

<include filename="FX150_package.xml" />

During development of a package you can manually edit this file. The same applies to the file
$(PackagesDir)/targets/project_templates.xml which will contain a reference to your
project_templates.xml file.

Usage:

mkpkg [options] packageFileName file1 file2

Option Description
-c Create a new package.
-compress level Change compression level (0 for none, 9 for
maximum).
-d Remove files from a package.
-exclude path Exclude path when adding files to a package
-f Output files to stdout.
-r Replace files in a package.
-readonly Force all files to have read only attribute.
-sub-arch-endian Create architecture and endian specific sub packages.
-sub-arch-endian-compatiblity Create architecture and endian specific sub packages
including compatibility packages for versions of the
IDE that don't have $(LibEndian) macro.
-sub-base-type Specify the type description of the base package.
-sub-type Specify the type description of the sub packages.
-t List the contents of a package.
-v Be chatty.
-V Show version information.
-x Extract files from a package.

328
Embedded Studio for ARM Reference Manual Utilities Reference

Package manager
The pkg program can be used to download, install, remove and search for packages from the command line.

Usage Description
pkg install package_names... Download and install packages
pkg install -manual package_files... Manually install package files
pkg list List all available packagess
pkg list -installed List installed packages
pkg remove package_names... Remove packages
pkg remove -all Remove all packages
pkg search keywords... Search for packages
pkg update Update list of available packages
pkg upgrade Upgrade all installed packages
pkg upgrade package_names... Upgrade selected packages
Option Description
-D macro=value Set a global macro
-legacy Include legacy packages
-nodelete Don't delete downloaded packages after installation
-noverify Don't verify downloaded packages
-packagesdir directory Set the packages directory to be directory
-packagesurl url Set the URL of the packages website to be url
-quiet Do not output any progress messages
-rootuserdir directory Set the root user data directory to directory
-verbose Produce verbose output
-yes Answer yes to all questions without prompting

Before you can download, install or search for packages you must first update the local list of available packages:

$ pkg update

The search command can be used to search for a specific package:

$ pkg search STL


STLport (1.0) - STLport Library Package

The install command can be used to install a package:

$ pkg install STLport

The list command can be used to list installed packages:

329
Embedded Studio for ARM Reference Manual Utilities Reference

$ pkg list -installed


STLport (1.0) - STLport Library Package

The remove command can be used to uninstall a package:

$ pkg remove STLport

330
Embedded Studio for ARM Reference Manual Appendices

Appendices

331
Embedded Studio for ARM Reference Manual Appendices

File formats
This section describes the file formats SEGGER Embedded Studio for ARM uses:

Memory Map file format


Describes the memory map file format that defines memory regions and registers in a microcontroller.

Section Placement file format


Describes the section placement file format that maps program sections to memory areas in the target
microcontroller.

Project file format


Describes the format of SEGGER Embedded Studio project files.

Project Templates file format


Describes the format of project template files used by the New Project wizard.

Property Groups file format


Describes the format of the property groups file you can use to define meta-properties.

Package Description file format


Describes the format of the package description files you use to create packages other users can install in
SEGGER Embedded Studio.

External Tools file format


Describes the format of external tool configuration files you use to extend SEGGER Embedded Studio.

Debugger Type Interpretation file format


Describes the format of the debugger type interpretation file.

332
Embedded Studio for ARM Reference Manual Appendices

Memory Map file format


SEGGER Embedded Studio memory-map files are structured using XML syntax for its simple construction and
parsing.

The first entry of the project file defines the XML document type used to validate the file format.

<!DOCTYPE Board_Memory_Definition_File>

The next entry is the Root element. There can only be one Root element in a memory map file:

<Root name="My Board">

A Root element has a name attribute every element in a memory map file has a name attribute. Names should
be unique within a hierarchy level. Within a Root element, there are MemorySegment elements that represent
regions within the memory map.

<Root name="My Board">


<MemorySegment name="Flash" start="0x1000" size="0x200" access="ReadOnly">

MemorySegment elements have the following attributes:

start:The start address of the memory segment. A simple expression, usually a hexadecimal number with
a 0x prefix.
size:The size of the memory segment. A simple expression, usually a hexadecimal number with a 0x prefix.
access:The permissible access types of the memory segment. One of ReadOnly, Read/Write,
WriteOnly, or None.
address_symbol:A symbolic name for the start address of the memory segment.
size_symbol:A symbolic name for the size of the memory segment.
end_symbol:A symbolic name for the end address of the memory segment.

RegisterGroup elements are used to organize registers into groups. Register elements are used to define
peripheral registers:

<Root name="My Board" >


<MemorySegment name="System" start="0x2000" size="0x200" >
<RegisterGroup name="Peripheral1" start="0x2100" size="0x10" >
<Register name="Register1" start="+0x8" size="4" >

RegisterGroup elements have the same attributes as MemorySegment elements. Register elements
have the following attributes:

name:Register names should be valid C/C++ identifier names, i.e., alphanumeric characters and
underscores are allowed but names cannot start with a number.
start:The start address of the memory segment. Either a C-style hexadecimal number or, if given a + prefix,
an offset from the enclosing element's start address.
size:The size of the register in bytes, either 1, 2, or 4.

333
Embedded Studio for ARM Reference Manual Appendices

access:The same as the access attribute of the MemorySegment element.


address_symbol:The same as the address_symbol attribute of the MemorySegment element.

A Register element can contain BitField elements that represent the bits in a peripheral register:

<Root name="My Board" >


<MemorySegment name="System" start="0x2000" size="0x200" >
<RegisterGroup name="Peripheral1" start="0x2100" size="0x10" >
<Register name="Register1" start="+0x8" size="4" >
<BitField name="Bits_0_to_3" start="0" size="4" />

BitField elements have the following attributes:

name:The same as the name attribute of the RegisterGroup element.


start:The starting bit position, 031.
size:The total number of bits, 132.

A Bitfield element can contain Enum elements:

<Root name="My Board" >


<RegisterGroup name="Peripheral1" start="0x2100" size="0x10" >
<Register name="Register1" start="+0x8" size="4" >
<BitField name="Bits_0_to_3" start="0" size="4" />
<Enum name="Enum3" start="3" />
<Enum name="Enum5" start="5" />

You can import CMSIS SVD files (see http://www.onarm.com/) into a memory map using the ImportSVD
element:

<ImportSVD filename="$(TargetsDir)/targets/Manufacturer1/Processor1.svd.xml">

The filename attribute is an absolute filename which is macro-expanded using SEGGER Embedded Studio for
ARM system macros.

When a memory map file is loaded either for the memory map viewer or to be used for linking or debugging, it is
preprocessed using the (as yet undocumented) SEGGER Embedded Studio for ARM XML preprocessor.

334
Embedded Studio for ARM Reference Manual Appendices

Section Placement file format


SEGGER Embedded Studio section-placement files are structured using XML syntax to enable simple
construction and parsing.

The first entry of the project file defines the XML document type used to validate the file format:

<!DOCTYPE Linker_Placement_File>

The next entry is the Root element. There can only be one Root element in a memory map file:

<Root name="Flash Placement">

A Root element has a name attribute. Every element in a section-placement file has a name attribute. Each
name should be unique within its hierarchy level. Within a Root element, there are MemorySegment elements.
These correspond to memory regions defined in a memory map file that will be used in conjunction with the
section-placement file when linking a program. For example:

<Root name="Flash Placement">


<MemorySegment name="FLASH">

A MemorySegment contains ProgramSection elements that represent program sections created by the C/
C++ compiler and assembler. The order of ProgramSection elements within a MemorySegment element
represents the order in which the sections will be placed when linking a program. The first ProgramSection
will be placed first and the last one will be placed last.

<Root name="My Board" >


<MemorySegment name="FLASH">
<ProgramSection name=".text">

ProgramSection elements have the following attributes:

address_symbol:A symbolic name for the start address of the section.


alignment:The required alignment of the program section; a decimal number specifying the byte
alignment.
end_symbol:A symbolic name for the end address of the section.
fill:The optional value used to fill unspecified regions of memory, a hexadecimal number with a 0x prefix.
inputsections:An expression describing the input sections to be placed in this section. If you omit this
(recommended) and the section name isn't one of .text, .dtors, .ctors, .data, .rodata, or .bss, then the
equivalent input section of *(.name .name.*) is supplied to the linker.
keep:If Yes, the section will be kept even if none of the symbols are referenced by the rest of the program.
load:If Yes, the section is loaded. If No, the section isn't loaded.
place_from_segment_end:If Yes, this section and following sections will be placed at the end of the
segment. Please note that this will only succeed if the section and all following sections have a fixed size
specified with the size attribute.
runin:This specifies the name of the section to copy this section to. Multiple sections can be specified
separated by a semicolon, the first section that exists will be used.

335
Embedded Studio for ARM Reference Manual Appendices

runoffset:This specifies an offset from the load address that the section will be run from.
size:The optional size of the program section in bytes, a hexadecimal number with a 0x prefix. The macro
$(SEGMENT_SIZE_REMAINING) can be used for size calcuations based on the remaining number of bytes in
the segment.
size_symbol:A symbolic name for the size of the section.
start:The optional start address of the program section, a hexadecimal number with a 0x prefix.

When a section placement file is used for linking it is preprocessed using the (as yet undocumented) SEGGER
Embedded Studio for ARM XML preprocessor.

336
Embedded Studio for ARM Reference Manual Appendices

Project file format


SEGGER Embedded Studio project files are held in text files with the .emProject extension. Because you may
want to edit project files, and perhaps generate them, they are structured using XML syntax to enable simple
construction and parsing.

The first entry of the project file defines the XML document type used to validate the file format:

<!DOCTYPE CrossStudio_Project_File>

The next entry is the solution element; there can only be one solution element in a project file. This
specifies the solution name displayed in the Project Explorer and has a version attribute that defines the file-
format version of the project file. Solutions can contain projects, projects can contain folders and files, and
folders can contain folders and files. This hierarchy is reflected in the XML nestingfor example:

<solution version="1" Name="solutionname">


<project Name="projectname">
<file Name="filename" />
<folder Name="foldername">
<file Name="filename2" />
</folder>
</project>
</solution>

Note that each entry has a Name attribute. Names of project elements must be unique to the solution, and
names of folder elements must be unique to the project, but names of files do not need to unique.

Each file element must have a file_name attribute that is unique to the project. Ideally, the file_name
is a file path relative to the project (or solution directory), but you can also specify a full file path, if you want to.
File paths are case-sensitive and use "/" as the directory separator. They may contain macro instantiations, so file
paths cannot contain the "$" character. For example

<file file_name="$(StudioDir)/source/crt0.s" Name="crt0.s" />

will be expanded using the value of $(StudioDir) when the file is referenced from SEGGER Embedded Studio.

Project properties are held in configuration elements with the Name attribute of the configuration element
corresponding to the configuration name, e.g., "Debug". At a given project level (i.e., solution, project, folder),
there can only be one named configuration elementi.e., all properties defined for a configuration are in single
configuration element.

<project Name="projectname">

<configuration project_type="Library" Name="Common" />


<configuration Name="Release" build_debug_information="No" />

</project>

You can use the import element to link projects:

<import file_name="target/libc.emProject" />

337
Embedded Studio for ARM Reference Manual Appendices

Project Templates file format


The SEGGER Embedded Studio New Project dialog works from a file called project_templates.xml in the
targets subdirectory of the SEGGER Embedded Studio installation directory. Because you may want to add
your own new project types, they are structured using XML syntax to enable simple construction and parsing.

The first entry of the project file defines the XML document type used to validate the file format:

<!DOCTYPE Project_Templates_File>

The next entry is the projects element, which is used to group a set of new project entries into an XML
hierarchy.

<projects>
<project>
</projects>

Each entry has a project element that contains the class of the project (attribute caption), the name of the
project (attribute name), its type (attribute type) and a description (attribute description). For example:

<project caption="ARM Evaluator7T" name="Executable"


description="An executable for an ARM Evaluator7T." type="Executable"/>

The project type can be one of these:

Executable: a fully linked executable.


Library: a static library.
Object file: an object file.
Staging: a staging project.
Combining: a combining project.
Externally Built Executable: an externally built executable.

The configurations to be created for the project are defined using the configuration element, which must
have a name attribute:

<configuration name="ARM RAM Release"/>

The property values to be created for the project are defined using the property element. If you have a
defined value, you can specify this using the value attribute and, optionally, set the property in a defined
configuration, such as:

<property name="target_reset_script" configuration="RAM"


value="Evaluator7T_ResetWithRamAtZero()" />

Alternatively, you can include a property that will be shown to the user, prompting them to supply a value as
part of the new-project process.

<property name="linker_output_format"/>

338
Embedded Studio for ARM Reference Manual Appendices

The folders to be created are defined using the folder element. The folder element must have a name
attribute and can also have a filter attribute. For example:

<folder name="Source Files" filter="c;cpp;cxx;cc;h;s;asm;inc" />

The files to be in the project are specified using the file element. You can use build-system macros (see
Project macros) to specify files located in the SEGGER Embedded Studio installation directory. Files will be
copied to the project directory or just left as references, depending on the value of the source attribute:

<file name="main.c" source="$(StudioDir)/samples/Shared/main.c"/>


<file name="$(StudioDir)/source/thumb_crt0.s"/>

You can define the set of configurations that can be referred to in the top-level configurations element:

<configurations>
<configuration>
</configurations>

This contains the set of all configurations that can be created when a project is created. Each configuration is
defined using a configuration element, which can define the property values for that configuration. For
example:

<configuration name="Debug">
<property name="build_debug_information" value="Yes">

339
Embedded Studio for ARM Reference Manual Appendices

Property Groups file format


The SEGGER Embedded Studio project system provides a means to create new properties that change a number
of project property settings and can also set C pre-processor definitions when selected. Such properties are
called property groups and are defined in a property-groups file. The property-group file to use for a project
is defined by the Property Groups File property. These files usually define target-specific properties and are
structured using XML syntax to enable simple construction and parsing.

The first entry of the property groups file defines the XML document type, which is used to validate the file
format:

<!DOCTYPE CrossStudio_Group_Values>

The next entry is the propertyGroups element, which is used to group a set of property groups entries into
an XML hierarchy:

<propertyGroups>
<grouphdots

<grouphdots
</propertyGroups>

Each group has the name of the group (attribute name), the name of the options category (attribute group),
short (attribute short) and long (attribute long) help descriptions, and a default value (attribute default).
For example:

<group short="Target Processor" group="Build Options" short="Target Processor"


long="Select a set of target options" name="Target" default="STR912FW44" />

Each group has a number of groupEntry elements that define the enumerations of the group.

<group\>
<groupEntry>

<groupEntry>
</group>

Each groupEntry has the name of the entry (attribute name), e.g.:

<groupEntry name="STR910FW32">

A groupEntry has the property values and C pre-processor definitions that are set when the groupEntry is
selected; they are specified with property and cdefine elements. For example:

<groupEntry>
<property>
<cdefine>
<property>
</groupEntry>

340
Embedded Studio for ARM Reference Manual Appendices

A property element has the property's name (attribute name), its value (attribute value), and an optional
configuration (attribute configuration):

<property name="linker_memory_map_file"
value="$(StudioDir)/targets/ST_STR91x/ST_STR910FM32_MemoryMap.xml" />

A cdefine element has the C preprocessor name (attribute name) and its value (attribute value):

<cdefine value="STR910FM32" name="TARGET_PROCESSOR" />

341
Embedded Studio for ARM Reference Manual Appendices

Package Description file format


Package-description files are XML files used by SEGGER Embedded Studio to describe a support package, its
contents, and any dependencies it has on other packages.

Each package file must contain one package element that describes the package. Optionally, the package
element can contain a collection of file, history, and documentation elements to be used by SEGGER
Embedded Studio for documentation purposes.

The filename of the package-description file should match that of the package and end in "_package.xml".

Below is an example of two package-description files. The first is for a base chip-support package for the
LPC2000; the second is for a board-support package dependent on the first:

Philips_LPC2000_package.xml
<!DOCTYPE CrossStudio_Package_Description_File>
<package cpu_manufacturer="Philips" cpu_family="LPC2000" version="1.1" ses_versions="8:1-"
author="SEGGER" >
<file file_name="$(TargetsDir)/Philips_LPC210X/arm_target_Philips_LPC210X.htm"
title="LPC2000 Support Package Documentation" />
<file file_name="$(TargetsDir)/Philips_LPC210X/Loader.emProject" title="LPC2000 Loader
Application Solution" />
<group title="System Files">
<file file_name="$(TargetsDir)/Philips_LPC210X/Philips_LPC210X_Startup.s" title="LPC2000
Startup Code" />
<file file_name="$(TargetsDir)/Philips_LPC210X/Philips_LPC210X_Target.js" title="LPC2000
Target Script" />
</group>
<history>
<version name="1.1" >
<description>Corrected LPC21xx header files and memory maps to include GPIO ports 2
and 3.</description>
<description>Modified loader memory map so that .libmem sections will be placed
correctly.</description>
</version>
<version name="1.0" >
<description>Initial Release.</description>
</version>
</history>
<documentation>
<section name="Supported Targets">
<p>This CPU support package supports the following LPC2000 targets:
<ul>
<li>LPC2103</li>
<li>LPC2104</li>
<li>LPC2105</li>
<li>LPC2106</li>
<li>LPC2131</li>
<li>LPC2132</li>
<li>LPC2134</li>
<li>LPC2136</li>
<li>LPC2138</li>
</ul>
</p>
</section>
</documentation>

342
Embedded Studio for ARM Reference Manual Appendices

</package>

CrossFire_LPC2138_package.xml
<!DOCTYPE CrossStudio_Package_Description_File>
<package cpu_manufacturer="Philips" cpu_family="LPC2000" cpu_name="LPC2138"
board_manufacturer="Rowley Associates" board_name="CrossFire LPC2138"
dependencies="Philips_LPC2000" version="1.0">
<file file_name="$(SamplesDir)/CrossFire_LPC2138/CrossFire_LPC2138.emProject"
title="CrossFire LPC2138 Samples Solution" />
<file file_name="$(SamplesDir)/CrossFire_LPC2138/ctl/ctl.emProject" title="CrossFire
LPC2138 CTL Samples Solution" />
</package>

Package elements
The package element describes the support package, its contents, and any dependencies it has on other
packages. Valid attributes for this element are:

Attribute Description
author The author of the package.
board_manufacturer The manufacturer of the board supported by the
package (if omitted, CPU manufacturer will be used).
board_name The name of the specific board supported by the
package (only required for board-support packages).
company_name The name of the company to group the package under
in the package dialogs. (if omitted, the Board/CPU
manufacturer will be used).
cpu_family The family name of the CPU supported by the package
(optional).
cpu_manufacturer The manufacturer of the CPU supported by the
package.
cpu_name The name of the specific CPU supported by the
package (may be omitted if the CPU family is specified).
description A description of the package (optional).
dependencies A semicolon-separated list of packages the package
requires to be installed in order to work (optional).
installation_directory The directory in which the package should be installed
(optional - if undefined, defaults to "$(PackagesDir)").
replaces A semicolon-separated list of package names listing
the packages that this package replaces. The replaced
packages are marked as legacy packages and are only
visible in the package manager if the if the Include
Legacy Packages option is selected (optional).

343
Embedded Studio for ARM Reference Manual Appendices

ses_versions A string describing which version of SEGGER


Embedded Studio supports the package. The format of
the string is target_id_number:version_range_string.
title A short description of the package (optional).
uninstalls A semicolon-separated list of packages names listing
the packages to be uninstalled if this package is
installed (optional).
version The package version number.

File elements
The file element is used by SEGGER Embedded Studio for documentation purposes by adding links to files of
interest within the package such as example project files and documentation.

Attribute Description
file_name The file path of the file.
title A description of the file.

Optionally, file elements can be grouped into categories using the group element.

Group elements
The group element is used for categorizing files described by file elements into a particular group.

Attribute Description
title Title of the group.

History elements
The history element is used to hold a description of the package's version history.

The history element should contain a collection of version elements.

Version element
The version element is used to hold the description of a particular version of the package.

Attribute Description
name The name of the version being described.

The version element should contain a collection of description elements.

344
Embedded Studio for ARM Reference Manual Appendices

Description elements
Each description element contains text that describes a feature of the package version.

Documentation elements
The documentation element is used to provide arbitrary documentation for the package.

The documentation element should contain a collection of one or more section elements.

Section elements
The section element contains package documentation in XHTML format.

Attribute Description
name The title of the documentation section.

target_id_number
The following table lists the possible target ID numbers:

Target ID
ARM 8
RISC-V 20

version_range_string
The version_range_string can be any of the following:

version_number:The package will only work on version_number.


version_number-:The package will work on version_number or any future version.
-version_number:The package will work on version_number or any earlier version.
low_version_number-high_version_number:The package will work on low_version_number,
high_version_number or any version in between.

345
Embedded Studio for ARM Reference Manual Appendices

External Tools file format


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

element.

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:

346
Embedded Studio for ARM Reference Manual Appendices

<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.

347
Embedded Studio for ARM Reference Manual Appendices

Additional macros constructed by SEGGER Embedded Studio are:

$(DEFINES) is the set of -D options applicable to the current file, derived from the current configuration
and project settings.
$(INCLUDES) is the set of -I options applicable to the current file, derived from the current configuration
and project settings.

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 sectionthis is to ensure
that paths that contain spaces are correctly interpreted when the command is executed by SEGGER Embedded
Studio.

348
Embedded Studio for ARM Reference Manual Appendices

Debugger Type Interpretation file format


SEGGER Embedded Studio debugger type interpretation files are used by the debugger to provide list and string
displays of C++ template container types. The files are structured using XML syntax for its simple construction
and parsing.

Consider the following C++ template type

template <class _Type> class VeryBasicArray


{
private:
size_t m_Count;
_Type *m_pData;
public:
VeryBasicArray(size_t count)
: m_Count(count)
, m_pData(new _Type[count])
{
}
}

VeryBasicArray<int> basicArray(5);

To display a variable of this type as a list the type interpretation file contains the following entry

<List Name="VeryBasicArray&lt;*&gt;"
Head="(($(T)*)HEAD).m_pData"
Data="(*($(T0)*)CURRENT)"
Length="(($(T)*)HEAD).m_Count"
Next="CURRENT+sizeof($(T0))"/>

The Name attribute is used to match the template type name note that the &lt and &gt xml entities are used to
match the template argument.

When an entry has been matched the head of the list is located by evaluating the debugger expression in the
Head attribute. The debugger expressions can contain macros that refer to the matched template type and will
use the symbols HEAD and CURRENT.

The macro $(T) refers to the instantiated template type, for the above example $(T)=VeryBasicArray<int>.

The template arguments are referred to using macros $(T0), for the above example $(T0)=int.

The symbol HEAD is the address of the variable being displayed, for the above example if the variable
basicArray is allocated at address 0x20004000 then the Head expression

((VeryBasicArray<int>*)0x20004000).m_pData

will be evaluated by the debugger, note that the . operator and the -> operator are equivalent in debugger
expressions.

To display an element the debugger will evaluate the Data expression. This expression contains the symbol
CURRENT which is the address of the element to display, for the above example the first element is at the
address basicArray.m_pData which is allocated at address 0x20008000 then the Data expression

349
Embedded Studio for ARM Reference Manual Appendices

(*(int*)0x20008000)

will be evaluated by the debugger.

To increment the CURRENT symbol the Next expression

0x20008000+sizeof(int)

will be evaluated by the debugger.

Before the CURRENT symbol is incremented the debugger needs to check if it is at the end of list. The can be
done either as a Condition expression or as a Length expression

((VeryBasicArray<int>*)0x20004000).m_Count

The String display is simpler than the List display since the characters are contiguous and optionally null
terminated. The Data and Length expressions are supported, for example

<String Name="string"
Data="*(($(T) *)HEAD)._M_start_of_storage._M_data"
Length="(($(T) *)HEAD)._M_finish-(($(T) *)HEAD)._M_start_of_storage._M_data"/>

is used to display STLPort std::string types.

350
Embedded Studio for ARM Reference Manual Appendices

Building Environment Options

Build
Property Description
Automatically Build Before Debug
Enables auto-building of a project before downloading
Environment/Build/Build Before
if it is out of date.
DebugBoolean
Confirm Automatically Build Before Debug
Environment/Build/Show Build Before Enables the display of the auto-building popup.
DebugBoolean
Confirm Debugger Stop
Present a warning when you start to build that requires
Environment/Build/Confirm Debugger
the debugger to stop.
StopBoolean
Display ETA Selects whether to attempt to compute and display
Environment/Build/Display ETABoolean the ETA on building.
Display Progress Bar
Environment/Build/Display Progress Selects whether to display progress bar on building.
BarBoolean
Echo Build Command Lines
Selects whether build command lines are written to
Environment/Build/Show Command
the build log.
LinesBoolean
Echo Raw Error/Warning Output
Selects whether the unprocessed error and warning
Environment/Build/Show Unparsed Error
output from tools is displayed in the build log.
OutputBoolean
Find Error After Building
Moves the cursor to the first diagnostic after a build
Environment/Build/Find Error After
completes with errors.
BuildBoolean
Global Macros Build macros that are shared across all solutions and
Environment/Macros/Global MacrosStringList projects e.g. paths to library files.
Keep Going On Error
Environment/Build/Keep Going On Build doesn't stop on error.
ErrorBoolean
Save Project File Before Building
Environment/Build/Save Project File On Selects whether to save the project file prior to build.
BuildBoolean
Show Build Information
Environment/Build/Show Build Show build information.
InformationBoolean

351
Embedded Studio for ARM Reference Manual Appendices

Build Acceleration
Property Description
Disable Unity Build
Ignore Unity Build project properties and always build
Environment/Build/Disable Unity
individual project components.
BuildBoolean
Parallel Building Threads
Environment/Build/Building The number of threads to launch when building.
ThreadsIntegerRange

Compatibility
Property Description
Default Assembler Variant
ARM/Build/Assembler Variant Specifies the default assembler variant to use.
DefaultEnumeration
Default Compiler Variant
ARM/Build/Compiler Variant Specifies the default compiler variant to use.
DefaultEnumeration
Default Use Compiler Driver Specifies the default for the Use Compiler Driver
ARM/Build/Use Compiler DriverEnumeration project property.

Window
Property Description
Show Build Log On Build
Environment/Show Transcript On Show the build log when a build starts.
BuildBoolean

352
Embedded Studio for ARM Reference Manual Appendices

Debugging Environment Options

Breakpoint
Property Description
Disassembly Breakpoints
What to do with disassembly breakpoints on debug
Environment/Debugger/Disassembly
stop/start.
BreakpointsBoolean
Focus On Breakpoint
Environment/Debugger/Focus On Focus IDE when breakpoint is hit.
BreakpointBoolean

Display
Property Description
Close Disassembly On Mode Switch
Environment/Debugger/Close Disassembly On Close Disassembly On Mode Switch.
Mode SwitchBoolean
Data Tips Display a Maximum Of
Selects the maximum number of array elements
Environment/Debugger/Maximum Array
displayed in a data tip.
Elements DisplayedIntegerRange
Default Display Mode
Environment/Debugger/Default Variable Selects the format that data values are shown in.
Display ModeEnumeration
Display Floating Point Number In
The printf format directive used to display floating
Environment/Debugger/Floating Point
point numbers.
Format DisplayCustom
Maximum Backtrace Calls
Selects the maximum number of calls when
Environment/Debugger/Maximum Backtrace
backtracing.
CallsIntegerRange
Prompt To Display If More Than
Environment/Debugger/Array Elements The array size to display with prompt.
Prompt SizeIntegerRange
Show Data Tips In Text Editor
Show Data Tips In Text Editor.
Environment/Debugger/Show Data TipsBoolean
Show ELF Header
Display ELF Headers when executable and object files
ElfDwarf/Environment/Show ELF
are displayed in text editor.
HeaderBoolean
Show Folds In Disassembly
Environment/Debugger/Disassembly Show Show Folds In Disassembly.
FoldsBoolean

353
Embedded Studio for ARM Reference Manual Appendices

Show Labels In Disassembly


Environment/Debugger/Disassembly Show Show Labels In Disassembly.
LabelsBoolean
Show Source In Disassembly
Environment/Debugger/Disassembly Show Show Source In Disassembly.
SourceBoolean
Show char * as null terminated string
Environment/Debugger/Display Char Ptr As Show char * as null terminated string.
StringBoolean
Source Path
Global search path to find source files.
Environment/Debugger/Source PathStringList
Use objdump For File Disassembly
Specifies whether to use objdump to disassemble files
ElfDwarf/Environment/Use Objdump For
rather than the built-in disassembler.
DisassemblyBoolean

Extended Data Tips


Property Description
ASCII
Environment/Debugger/Extended Tooltip Display ASCII extended data tips.
Display Mode/ASCIIBoolean
Binary
Environment/Debugger/Extended Tooltip Display Binary extended data tips.
Display Mode/BinaryBoolean
Decimal
Environment/Debugger/Extended Tooltip Display Decimal extended data tips.
Display Mode/DecimalBoolean
Hexadecimal
Environment/Debugger/Extended Tooltip Display Hexadecimal extended data tips.
Display Mode/HexadecimalBoolean
Octal
Environment/Debugger/Extended Tooltip Display Octal extended data tips.
Display Mode/OctalBoolean
Unsigned Decimal
Environment/Debugger/Extended Tooltip Display Unsigned Decimal extended data tips.
Display Mode/Unsigned DecimalBoolean

Ozone
Property Description

354
Embedded Studio for ARM Reference Manual Appendices

Ozone Executable
The path to the Ozone executable.
ARM/Debugger/Ozone ExecutableFileName

Target
Property Description
Switch Project To Text Editor
Switch Project To Text Editor.
Environment/Debugger/Switch ProjectBoolean

Window
Property Description
Clear Debug Terminal On Run
Clear the debug terminal automatically when a
Environment/Clear Debug Terminal On
program is run.
RunBoolean
Hide Output Window On Successful Load
Hide the Output window when a load completes
Debugging/Hide Transcript On Successful
without error.
LoadBoolean
Show Target Log On Load
Show the target log when a load starts.
Debugging/Show Transcript On LoadBoolean

355
Embedded Studio for ARM Reference Manual Appendices

IDE Environment Options

Browser
Property Description
Text Size Sets the text size of the integrated HTML and help
Environment/Browser/Text SizeEnumeration browser.
Underline Hyperlinks In Browser
Enables underlining of hypertext links in the
Environment/Browser/Underline Web
integrated HTML and help browser.
LinksBoolean

File Extension
Property Description
ELF Archive File Extensions
ElfDwarf/Environment/Archive File The file extensions used for ELF archive files.
ExtensionsStringList
ELF Executable File Extensions
ElfDwarf/Environment/Executable File The file extensions used for ELF executable files.
ExtensionsStringList
ELF Object File Extensions
ElfDwarf/Environment/Object File The file extensions used for ELF object files.
ExtensionsStringList

File Search
Property Description
Collapse Search Results
Whether to initially collapse search results.
Find In Files/Collapse ResultsBoolean
Files To Exclude The wildcard used to exclude files in Find In Files
Find In Files/Exclude File TypesStringList searches.
Files To Search The wildcard used to match files in Find In Files
Find In Files/File TypeStringList searches.
Find History
The list of strings recently used in searches.
Find In Files/Find HistoryStringList
Flat Search Result Output
Whether to display file search results as a flat list.
Find In Files/Flat OutputBoolean

356
Embedded Studio for ARM Reference Manual Appendices

Folder History
The set of folders recently used in file searches.
Find In Files/Folder HistoryStringList
Match Case Whether the case of letters must match exactly when
Find In Files/Match CaseBoolean searching.
Match Whole Word
Whether the whole word must match when searching.
Find In Files/Match Whole WordBoolean
Replace History
The list of strings recently used in searches.
Find In Files/Replace HistoryStringList
Search Dependencies
Controls searching of dependent files."
Find In Files/Search DependenciesBoolean
Search In
Where to look to find files.
Find In Files/ContextEnumeration
Use Regular Expressions Whether to use a regular expression or plain text
Find In Files/Use RegExpBoolean search.

Find And Replace


Property Description
Greedy Regular Expressions Enables greedy matching when using regular
Find/Greedy RegExpBoolean expressions.

Internet
Property Description
Automatically Check For Packages Specifies whether to enable downloading of the list of
Environment/Internet/Check PackagesBoolean available packages.
Automatically Check For Updates
Specifies whether to check for software updates.
Environment/Internet/Check UpdatesBoolean
Check For Latest News
Specifies whether to update the latest news window.
Environment/Internet/RSS UpdateBoolean
Enable Connection Debugging
Controls debugging traces of internet connections and
Environment/Internet/Enable
downloads.
DebuggingBoolean
External Web Browser The path to the external web browser to use when
Environment/External Web BrowserFileName accessing non-local files.
HTTP Caching Specifies if caching should be permitted when carrying
Environment/Internet/HTTP CachingBoolean out HTTP requests.
HTTP Proxy Host
Specifies the IP address or hostname of the HTTP proxy
Environment/Internet/HTTP Proxy
server. If empty, no HTTP proxy server will be used.
ServerString

357
Embedded Studio for ARM Reference Manual Appendices

HTTP Proxy Port


Environment/Internet/HTTP Proxy Specifies the HTTP proxy server's port number.
PortIntegerRange
Maximum Download History Items
The maximum amount of download history kept in the
Environment/Internet/Max Download History
downloads window.
ItemsIntegerRange
Use Content Delivery Network
Specifies whether to use content delivery network to
Environment/Package/Use Content Delivery
deliver packages."
NetworkBoolean

Launcher
Property Description
Confirm Check Solution Target Specifies whether the SEGGER Embedded Studio
Environment/Launcher/Confirm Check launcher should present a warning if the solution
Solution TargetBoolean being launched targets a device it does not support.
Launch Latest Installations Only Specifies whether the SEGGER Embedded Studio
Environment/Launcher Use Latest launcher should only consider the latest installations
Installations OnlyBoolean when deciding which one to use.
Specifies whether the SEGGER Embedded Studio
Launcher Enabled
launcher should be used when the operating system
Environment/Launcher EnabledBoolean
or an external application requests a file to be opened.

Licensing
Property Description
Check J-Link For Licenses
Specifies whether to check J-Link's for licenses.
Environment/Check J-Link LicensesBoolean

Package Manager
Property Description
Check Solution Package Dependencies
Specifies whether to check package dependencies
Environment/Package/Check Solution
when a solution is loaded.
Package DependenciesBoolean
Delete Package Downloads
Specifies whether to delete downloaded package files
Environment/Package/Delete
after they have been installed.
DownloadsBoolean

358
Embedded Studio for ARM Reference Manual Appendices

Install Default Packages


Specifies whether default packages should be installed
Environment/Package/Install Default
on startup if they are not installed already.
PackagesBoolean
Package Directory
Environment/Package/Destination Specifies the directory packages are installed to.
DirectoryString
Show Check For Packages Dialog
Specifies whether the package manager should
Environment/Package/Show Check For
prompt for a package list refresh.
Packages DialogBoolean
Show Logos Specifies whether the package manager should display
Environment/Package/Show LogosEnumeration company logos.
Verify Package Downloads
Specifies whether to carry out an MD5 sum check on
Environment/Package/Verify
downloaded package files.
DownloadsBoolean

Print
Property Description
Bottom Margin
Environment/Printing/Bottom The page's bottom margin in millimetres.
MarginIntegerRange
Left Margin
The page's left margin in millimetres.
Environment/Printing/Left MarginIntegerRange
Page Orientation
The page's orientation.
Environment/Printing/OrientationEnumeration
Page Size
The page's size.
Environment/Printing/Page SizeEnumeration
Right Margin
Environment/Printing/Right The page's right margin in millimetres.
MarginIntegerRange
Top Margin
The page's top margin in millimetres.
Environment/Printing/Top MarginIntegerRange

Startup
Property Description
Allow Multiple SEGGER Embedded Studios
Allow more than one SEGGER Embedded Studio to run
Environment/Permit Multiple Studio
at the same time.
InstancesBoolean

359
Embedded Studio for ARM Reference Manual Appendices

Load Last Project On Startup


Specifies whether to load the last project the next time
Environment/Load Last Project On
SEGGER Embedded Studio runs.
StartupBoolean
New Project Directory
Environment/General/Solution The directory where projects are created.
DirectoryString
Show Support Expired Dialog
Specifies whether to show the support expired dialog.
Environment/Support Reminder NagBoolean
Splash Screen
How to display the splash screen on startup.
Environment/Splash ScreenEnumeration

Status Bar
Property Description
(Visible)
Show or hide the status bar.
Environment/Status BarBoolean
Show Build Status Pane
Environment/General/Status Bar/Show Build Show or hide the Build pane in the status bar.
StatusBoolean
Show Caret Position Pane
Environment/General/Status Bar/Show Caret Show or hide the Caret Position pane in the status bar.
PosBoolean
Show Insert/Overwrite Status Pane
Show or hide the Insert/Overwrite pane in the status
Environment/General/Status Bar/Show
bar.
Insert ModeBoolean
Show Read-Only Status Pane
Environment/General/Status Bar/Show Read Show or hide the Read Only pane in the status bar.
OnlyBoolean
Show Size Grip
Environment/General/Status Bar/Show Size Show or hide the status bar size grip.
GripBoolean
Show Target Pane
Environment/General/Status Bar/Show Show or hide the Target pane in the status bar.
TargetBoolean
Show Time Pane
Environment/General/Status Bar/Show Show or hide the Time pane in the status bar.
TimeBoolean

Title Bar
Property Description

360
Embedded Studio for ARM Reference Manual Appendices

Show Full Solution Path


Environment/General/Title Bar/Show Full Show the full solution path in title bar.
Solution PathBoolean

User Interface
Property Description
Application Main Font
The font to use for the user interface as a whole.
Environment/Application Main FontFont
Application Monospace Font
The fixed-size font to use for the user interface as a
Environment/Application Monospace
whole.
FontFixedPitchFont
Error Display Timeout
The minimum time, in seconds, that errors are shown
Environment/Error Display
for in the status bar.
TimeoutIntegerRange
Errors Are Displayed
How errors are reported in SEGGER Embedded Studio.
Environment/Error Display ModeEnumeration
How to display sizes of items in the user interface. SI
File Size Display Units
defines 1kB=1000 bytes, IEC defines 1kiB=1024 bytes,
Environment/Size Display UnitEnumeration
Alternate SI defines 1kB=1024 bytes.
Number File Names in Menus Number the first nine file names in menus for quick
Environment/Number MenusBoolean keyboard access.
Qt Style Sheet The Qt style sheet to use in order to customize the user
Environment/Qt Style SheetFileName interface (experimental).
Show Large Icons In Toolbars
Show large or small icons on toolbars.
Environment/General/Large IconsEnumeration
Show Ribbon
Show or hide the ribbon.
Environment/General/Ribbon/ShowBoolean
Present the Window Selector on Next Window and
Show Window Selector On Ctrl+Tab
Previous Window commands activated from the
Environment/Show SelectorBoolean
keyboard.
Theme
The user interface style and color theme to use.
Environment/Studio ThemeEnumeration
Window Menu Contains At Most
The maximum number of windows appearing in the
Environment/Max Window Menu
Windows menu.
ItemsIntegerRange

361
Embedded Studio for ARM Reference Manual Appendices

Programming Language Environment Options

Assembly Language
Property Description
Column Guide Columns
Text Editor/Indent/Assembly Language/ The columns that guides are drawn for.
Column GuidesString
Indent Closing Brace
Text Editor/Indent/Assembly Language/ Indent the closing brace of compound statements.
Close BraceBoolean
Indent Context
Text Editor/Indent/Assembly Language/ The number of lines to use for context when indenting.
Context LinesIntegerRange
Indent Mode
Text Editor/Indent/Assembly Language/ How to indent when a new line is inserted.
Indent ModeEnumeration
Indent Opening Brace
Text Editor/Indent/Assembly Language/Open Indent the opening brace of compound statements.
BraceBoolean
Indent Size
Text Editor/Indent/Assembly Language/ The number of columns to indent a code block.
SizeIntegerRange
Tab Size
Text Editor/Indent/Assembly Language/Tab The number of columns between tabstops.
SizeIntegerRange
Use Tabs
Text Editor/Indent/Assembly Language/Use Insert tabs when indenting.
TabsBoolean
User-Defined Keywords
Text Editor/Indent/Assembly Language/ Additional identifiers to highlight as keywords.
KeywordsStringList

C and C++
Property Description
Column Guide Columns
Text Editor/Indent/C and C++/Column The columns that guides are drawn for.
GuidesString

362
Embedded Studio for ARM Reference Manual Appendices

Indent Closing Brace


Text Editor/Indent/C and C++/Close Indent the closing brace of compound statements.
BraceBoolean
Indent Context
Text Editor/Indent/C and C++/Context The number of lines to use for context when indenting.
LinesIntegerRange
Indent Mode
Text Editor/Indent/C and C++/Indent How to indent when a new line is inserted.
ModeEnumeration
Indent Opening Brace
Text Editor/Indent/C and C++/Open Indent the opening brace of compound statements.
BraceBoolean
Indent Size
Text Editor/Indent/C and C++/ The number of columns to indent a code block.
SizeIntegerRange
Tab Size
Text Editor/Indent/C and C++/Tab The number of columns between tabstops.
SizeIntegerRange
Use Tabs
Text Editor/Indent/C and C++/Use Insert tabs when indenting.
TabsBoolean
User-Defined Keywords
Text Editor/Indent/C and C++/ Additional identifiers to highlight as keywords.
KeywordsStringList

Default
Property Description
Column Guide Columns
Text Editor/Indent/Default/Column The columns that guides are drawn for.
GuidesString
Indent Closing Brace
Text Editor/Indent/Default/Close Indent the closing brace of compound statements.
BraceBoolean
Indent Context
Text Editor/Indent/Default/Context The number of lines to use for context when indenting.
LinesIntegerRange
Indent Mode
Text Editor/Indent/Default/Indent How to indent when a new line is inserted.
ModeEnumeration

363
Embedded Studio for ARM Reference Manual Appendices

Indent Opening Brace


Text Editor/Indent/Default/Open Indent the opening brace of compound statements.
BraceBoolean
Indent Size
The number of columns to indent a code block.
Text Editor/Indent/Default/SizeIntegerRange
Tab Size
Text Editor/Indent/Default/Tab The number of columns between tabstops.
SizeIntegerRange
Use Tabs
Insert tabs when indenting.
Text Editor/Indent/Default/Use TabsBoolean
User-Defined Keywords
Text Editor/Indent/Default/ Additional identifiers to highlight as keywords.
KeywordsStringList

Java
Property Description
Column Guide Columns
The columns that guides are drawn for.
Text Editor/Indent/Java/Column GuidesString
Indent Closing Brace
Indent the closing brace of compound statements.
Text Editor/Indent/Java/Close BraceBoolean
Indent Context
Text Editor/Indent/Java/Context The number of lines to use for context when indenting.
LinesIntegerRange
Indent Mode
Text Editor/Indent/Java/Indent How to indent when a new line is inserted.
ModeEnumeration
Indent Opening Brace
Indent the opening brace of compound statements.
Text Editor/Indent/Java/Open BraceBoolean
Indent Size
The number of columns to indent a code block.
Text Editor/Indent/Java/SizeIntegerRange
Tab Size
The number of columns between tabstops.
Text Editor/Indent/Java/Tab SizeIntegerRange
Use Tabs
Insert tabs when indenting.
Text Editor/Indent/Java/Use TabsBoolean
User-Defined Keywords
Additional identifiers to highlight as keywords.
Text Editor/Indent/Java/KeywordsStringList

364
Embedded Studio for ARM Reference Manual Appendices

Source Control Environment Options

External Tools
Property Description
Diff Command Line
Environment/Source Code Control/ The diff command line.
DiffCommandStringList
Merge Command Line
Environment/Source Code Control/ The merge command line.
MergeCommandStringList

Preference
Property Description
Add Immediately
Bypasses the confirmation dialog and immediately
Environment/Source Code Control/Immediate
adds items to source control.
AddBoolean
Commit Immediately
Bypasses the confirmation dialog and immediately
Environment/Source Code Control/Immediate
commits items.
CommitBoolean
Get Immediately
Bypasses the confirmation dialog and immediately
Environment/Source Code Control/Immediate
gets items from source control.
GetBoolean
Lock Immediately
Bypasses the confirmation dialog and immediately
Environment/Source Code Control/Immediate
locks items.
LockBoolean
Remove Immediately
Bypasses the confirmation dialog and immediately
Environment/Source Code Control/Immediate
removes items from source control.
RemoveBoolean
Resolved Immediately
Bypasses the confirmation dialog and immediately
Environment/Source Code Control/Immediate
mark items resolved.
ResolvedBoolean
Revert Immediately
Bypasses the confirmation dialog and immediately
Environment/Source Code Control/Immediate
revert items.
RevertBoolean
Unlock Immediately
Bypasses the confirmation dialog and immediately
Environment/Source Code Control/Immediate
unlocks items.
UnlockBoolean

365
Embedded Studio for ARM Reference Manual Appendices

Update Immediately
Bypasses the confirmation dialog and immediately
Environment/Source Code Control/Immediate
updates items.
UpdateBoolean

366
Embedded Studio for ARM Reference Manual Appendices

Text Editor Environment Options

Auto Recovery
Property Description
Auto Recovery Backup Time
The time in minutes between saving of auto recovery
Text Editor/Auto Recovery Backup
backups files or 0 to disable generation of backup files.
TimeIntegerRange
Auto Recovery Keep Time
The time in days to keep unrecovered backup files or 0
Text Editor/Auto Recovery Keep
to disable deletion of unrecovered backup files.
TimeIntegerRange

Cursor Fence
Property Description
Bottom Margin
The number of lines in the bottom margin.
Text Editor/Margins/BottomIntegerRange
Keep Cursor Within Fence
Enable margins to fence and scroll around the cursor.
Text Editor/Margins/EnabledBoolean
Left Margin
The number of characters in the left margin.
Text Editor/Margins/LeftIntegerRange
Right Margin
The number of characters in the right margin.
Text Editor/Margins/RightIntegerRange
Top Margin
The number of lines in the right margin.
Text Editor/Margins/TopIntegerRange

Editing
Property Description
Allow Drag and Drop Editing Enables dragging and dropping of selections in the
Text Editor/Drag Drop EditingBoolean text editor.
Bold Popup Diagnostic Messages Displays popup diagnostic messages in bold for easier
Text Editor/Bold Popup DiagnosticsBoolean reading.
Column-mode Tab Tab key moves to the next textual column using the
Text Editor/Column Mode TabBoolean line above.
Confirm Modified File Reload
Display a confirmation prompt before reloading a file
Text Editor/Confirm Modified File
that has been modified on disk.
ReloadBoolean

367
Embedded Studio for ARM Reference Manual Appendices

Copy Action When Nothing Selected


What Copy copies when nothing is selected.
Text Editor/Copy ActionEnumeration
Cut Action When Nothing Selected
What Cut cuts when nothing is selected.
Text Editor/Cut ActionEnumeration
Selects whether to place text on the clipboard when
a single blank line is cut. When set to Yes, cutting
Cut Single Blank Line
a single blank line will put the blank line on the
Text Editor/Cut Blank LinesBoolean
clipboard. When set to No, cutting a single blank line
deletes the line and does not place it on the clipboard.
Diagnostic Cycle Mode
Iterates through diagnostics either from most severe
Text Editor/Diagnostic Cycle
to least severe or in reported order.
ModeEnumeration
Edit Read-Only Files
Allow editing of read-only files.
Text Editor/Edit Read OnlyBoolean
Enable Virtual Space Permit the cursor to move into locations that do not
Text Editor/Enable Virtual SpaceBoolean currently contain text.
Numeric Keypad Editing Selects whether the numeric keypad plus and minus
Text Editor/Numeric Keypad EnabledBoolean buttons copy and cut text.
Tab Key Indents Preprocessor Directives Enables or disables the indentation of C preprocessor
Text Editor/Tab Key Indents Preprocessor directives when using tab key indentation on a
DirectivesBoolean selection.
Undo And Redo Behavior How Undo and Redo group your typing when it is
Text Editor/Undo ModeEnumeration undone and redone.

Find And Replace


Property Description
Case Sensitive Matching Enables or disables the case sensitivity of letters when
Text Editor/Find/Match CaseBoolean searching.
Find History
The list of strings recently used in searches.
Text Editor/Find/HistoryStringList
Regular Expression Matching Enables regular expression matching rather than plain
Text Editor/Find/Use RegExpBoolean text matching.
Replace History
The list of strings recently used in replaces.
Text Editor/Replace/HistoryStringList
Whole Word Matching Enables or disables whole word matching when
Text Editor/Find/Match Whole WordBoolean searching.

Formatting
Property Description

368
Embedded Studio for ARM Reference Manual Appendices

Access Modifier Offset


The extra indent or outdent of access modifiers, e.g.
Text Editor/Formatting/
public:.
AccessModifierOffsetInteger
Additional Formatting Styles
Text Editor/Additional Formatting Additional styles to pass to clang-format.
StylesStringList
Align After Open Bracket
If enabled, horizontally aligns arguments after an open
Text Editor/Formatting/
bracket.
AlignAfterOpenBracketBoolean
Align Consecutive Assignments
Text Editor/Formatting/ If enabled, aligns consecutive assignments.
AlignConsecutiveAssignmentsBoolean
Align Consecutive Declarations
Text Editor/Formatting/ If enabled, aligns consecutive declarations.
AlignConsecutiveDeclarationsBoolean
Align Escaped Newlines Left If enabled, aligns escaped newlines as far left as
Text Editor/Formatting/ possible otherwise puts them into the right-most
AlignEscapedNewlinesLeftBoolean column.
Align Operands
If enabled, horizontally align operands of binary and
Text Editor/Formatting/
ternary expressions.
AlignOperandsBoolean
Align Trailing Comments
Text Editor/Formatting/ If enabled, aligns trailing comments.
AlignTrailingCommentsBoolean
Allow All Parameters Of Declaration On Next Line
Allow putting all parameters of a function declaration
Text Editor/Formatting/ onto the next line even if Bin-pack Parameters is
disabled.
AllowAllParametersOfDeclarationOnNextLineBoolean
Allow Short 'if' Statements On A Single Line
Text Editor/Formatting/ If enabled, short 'if' statements are put on a single line.
AllowShortIfStatementsOnASingleLineBoolean
Allow Short Blocks On A Single Line
If enabled, allows contracting simple braced
Text Editor/Formatting/
statements to a single line.
AllowShortBlocksOnASingleLineBoolean
Allow Short Case Labels On A Single Line
If enabled, short case labels will be contracted to a
Text Editor/Formatting/
single line.
AllowShortCaseLabelsOnASingleLineBoolean
Allow Short Functions On A Single Line
Text Editor/Formatting/ Optionally compress small functions to a single line.
AllowShortFunctionsOnASingleLineEnumeration
Allow Short Loop Statements On A Single Line
If enabled, short loop statements are put on a single
Text Editor/Formatting/
line.
AllowShortLoopsOnASingleLineBoolean

369
Embedded Studio for ARM Reference Manual Appendices

Always Break After Return Type


The function declaration return type breaking style to
Text Editor/Formatting/
use.
AlwaysBreakAfterReturnTypeEnumeration
Always Break Before Multiline Strings
Text Editor/Formatting/ If enabled, always break before multiline strings.
AlwaysBreakBeforeMultilineStringsBoolean
Always Break Template Declarations
If enabled, always break after the 'template<...>' of a
Text Editor/Formatting/
template declaration.
AlwaysBreakTemplateDeclarationsBoolean
Bin-Pack Arguments
If disabled, a function call?s arguments will either be all
Text Editor/Formatting/
on the same line or will have one line each.
BinPackArgumentsBoolean
Bin-Pack Parameters If disabled, a function call's or function definition's
Text Editor/Formatting/ parameters will either all be on the same line or will
BinPackParametersBoolean have one line each.
Break Before Binary Operators
Text Editor/Formatting/ The way to wrap binary operators.
BreakBeforeBinaryOperatorsBoolean
Break Before Braces
Text Editor/Formatting/ The brace breaking style to use.
BreakBeforeBracesEnumeration
Break Before Inheritance Comma
If enabled, the class inheritance expression will break
Text Editor/Formatting/
before : and , if there is multiple inheritance.
BreakBeforeInheritanceCommaBoolean
Break Before Ternary Operators
If enabled, ternary operators will be placed after line
Text Editor/Formatting/
breaks.
BreakBeforeTernaryOperatorsBoolean
Break Constructor Initializers Before Comma
If enabled, always break constructor initializers before
Text Editor/Formatting/
commas and align the commas with the colon.
BreakConstructorInitializersBeforeCommaBoolean
Break String Literals
Text Editor/Formatting/ Allow breaking string literals when formatting.
BreakStringLiteralsBoolean
C++11 Braced List Style
If enabled, format braced lists as best suited for C++11
Text Editor/Formatting/
braced lists.
Cpp11BracedListStyleBoolean
Column Limit The column limit which limits the width of formatted
Text Editor/Formatting/ColumnLimitInteger lines.
A regular expression that describes comments with
Comment Pragmas
special meaning, which should not be split into lines or
Text Editor/Formatting/CommentPragmasString
otherwise changed.

370
Embedded Studio for ARM Reference Manual Appendices

Compact Namespaces If enabled, consecutive namespace declarations will


Text Editor/Formatting/ be on the same line. If disabled, each namespace is
CompactNamespacesBoolean declared on a new line.
Constructor Initializer All On One Line Or One Per Line
If enabled and the constructor initializers don't fit on a
Text Editor/Formatting/
line, put each initializer on its own line.
ConstructorInitializerAllOnOneLineOrOnePerLineBoolean
Constructor Initializer Indent Width
The number of characters to use for indentation of
Text Editor/Formatting/
constructor initializer lists.
ConstructorInitializerIndentWidthInteger
Continuation Indent Width
Text Editor/Formatting/ Indent width for line continuations.
ContinuationIndentWidthInteger
Derive Pointer Alignment If enabled, analyze the formatted file for the most
Text Editor/Formatting/ common alignment of address of and dereference.
DerivePointerAlignmentBoolean PointerAlignment is then used only as fallback.
Empty Lines At End Of File
Text Editor/Extra Formatting/ The number of lines to add at the end of the file.
LinesAtEOFIntegerRange
Fix Namespace Comments
If enabled, add missing namespace end comments and
Text Editor/Formatting/
fix invalid existing ones.
FixNamespaceCommentsBoolean
For-Each Macros
A list of macros that should be interpreted as foreach
Text Editor/Formatting/
loops rather than function calls.
ForEachMacrosStringList
The number of columns the code formatter uses for
Formatting Indent Width indentation. Note that this is not the indent width
Text Editor/Formatting/IndentWidthInteger used by the text editor, that value is specified in the
'Languages' environment option group.
Formatting Style Select a set of formatting options based on a named
Text Editor/FormattingStyleEnumeration standard.
The number of columns the code formatter uses
Formatting Tab Width for tab stops. Note that this is not the tab width
Text Editor/Formatting/TabWidthIntegerRange used by the text editor, that value is specified in the
'Languages' environment option group.
Include Is Main Regex
Specify a regular expression of suffixes that are
Text Editor/Formatting/
allowed in the file-to-main-include mapping.
IncludeIsMainRegexString
Indent Case Labels
If enabled, indent case labels one level from the switch
Text Editor/Formatting/
statement.
IndentCaseLabelsBoolean
Indent Wrapped Function Names
If enabled, Indent if a function definition or declaration
Text Editor/Formatting/
is wrapped after the type.
IndentWrappedFunctionNamesBoolean

371
Embedded Studio for ARM Reference Manual Appendices

Keep Empty Lines At The Start Of Blocks


Text Editor/Formatting/ If enabled, empty lines at the start of blocks are kept.
KeepEmptyLinesAtTheStartOfBlocksBoolean
Macro Block Begin
A regular expression matching macros that start a
Text Editor/Formatting/
block.
MacroBlockBeginString
Macro Block End A regular expression matching macros that end a
Text Editor/Formatting/MacroBlockEndString block.
Maximum Empty Lines To Keep
The maximum number of consecutive empty lines to
Text Editor/Formatting/
keep.
MaxEmptyLinesToKeepInteger
Namespace Indentation
Text Editor/Formatting/ The indentation used for namespaces.
NamespaceIndentationEnumeration
Penalty Break Assignment
The penalty for breaking around an assignment
Text Editor/Formatting/
operator.
PenaltyBreakAssignmentIntegerRange
Penalty Break Before First Call Parameter
Text Editor/Formatting/ The penalty for breaking a function call after 'call('.
PenaltyBreakBeforeFirstCallParameterIntegerRange
Penalty Break Before First Less-Less
Text Editor/Formatting/ The penalty for breaking before the first less-less.
PenaltyBreakFirstLessLessIntegerRange
Penalty Break Comment
The penalty for each line break introduced inside a
Text Editor/Formatting/
comment.
PenaltyBreakCommentIntegerRange
Penalty Break String
The penalty for each line break introduced inside a
Text Editor/Formatting/
string literal.
PenaltyBreakStringIntegerRange
Penalty Excess Character
The penalty for each character outside of the column
Text Editor/Formatting/
limit.
PenaltyExcessCharacterIntegerRange
Penalty Return Type On Its Own Line
Penalty for putting the return type of a function onto
Text Editor/Formatting/
its own line.
PenaltyReturnTypeOnItsOwnLineIntegerRange
Pointer Alignment
Text Editor/Formatting/ Pointer and reference alignment style.
PointerAlignmentEnumeration
Reflow Comments
If enabled, clang-format will attempt to re-flow
Text Editor/Formatting/
comments.
ReflowCommentsBoolean
Sort Includes
If enabled, sort #includes.
Text Editor/Formatting/SortIncludesBoolean

372
Embedded Studio for ARM Reference Manual Appendices

Sort Using Declarations


Text Editor/Formatting/ If enabled, sort using declarations.
SortUsingDeclarationsBoolean
Space After C Style Cast
Text Editor/Formatting/ If enabled, a space may be inserted after C style casts.
SpaceAfterCStyleCastBoolean
Space After Template Keyword
If enabled, a space will be inserted after the ?template?
Text Editor/Formatting/
keyword.
SpaceAfterTemplateKeywordBoolean
Space Before Assignment Operators
If disabled spaces will be removed before assignment
Text Editor/Formatting/
operators.
SpaceBeforeAssignmentOperatorsBoolean
Space Before Parentheses
Defines in which cases to put a space before opening
Text Editor/Formatting/
parentheses.
SpaceBeforeParensEnumeration
Space In Empty Parentheses
Text Editor/Formatting/ If enabled, spaces may be inserted into '()'.
SpaceInEmptyParenthesesBoolean
Spaces Before Trailing Comments
Text Editor/Formatting/ The number of spaces before trailing line comments.
SpacesBeforeTrailingCommentsIntegerRange
Spaces In Angles
If enabled, spaces will be inserted around the angle
Text Editor/Formatting/
brackets in template argument lists.
SpacesInAnglesBoolean
Spaces In C-style Cast Parentheses
Text Editor/Formatting/ If enabled, spaces may be inserted into C style casts.
SpacesInCStyleCastParenthesesBoolean
Spaces In Container Literals
Text Editor/Formatting/ If enabled, spaces are inserted inside container literals.
SpacesInContainerLiteralsBoolean
Spaces In Parentheses
Text Editor/Formatting/ If true, spaces will be inserted after '(' and before ')'.
SpacesInParenthesesBoolean
Spaces In Square Brackets
Text Editor/Formatting/ If true, spaces will be inserted after '[' and before ']'.
SpacesInSquareBracketsBoolean
Standard
Format compatible with this standard
Text Editor/Formatting/StandardEnumeration
Tab Style
The way to use hard tab characters in the resulting file.
Text Editor/Formatting/UseTabEnumeration

373
Embedded Studio for ARM Reference Manual Appendices

Load code formatting style configuration from


Use .clang-format File a .clang-format file located in one of the parent
Text Editor/Use .clang-format FileBoolean directories of the source file rather than use the
formatting options.

International
Property Description
Auto-Detect UTF-8
Auto-detect UTF-8 encoding without signature.
Text Editor/Auto-Detect UTF-8Boolean
Default Text File Encoding The encoding to use if not overridden by a project
Text Editor/Default CodecEnumeration property or file is not in a known format.
Verify Text File Decoding Specifies whether the decoding of a text file should be
Text Editor/Verify DecodeBoolean verified when file is loaded.

Mouse
Property Description
Alt+Left Click Action
Environment/Project Explorer/Alt+Left The action the editor performs on Alt+Left Click.
Click ActionEnumeration
Alt+Middle Click Action
Environment/Project Explorer/Alt+Middle The action the editor performs on Alt+Middle Click.
Click ActionEnumeration
Alt+Right Click Action
Environment/Project Explorer/Alt+Right The action the editor performs on Alt+Right Click.
Click ActionEnumeration
Copy On Mouse Select Automatically copy text to clipboard when marking a
Text Editor/Copy On Mouse SelectBoolean selection with the mouse.
Ctrl+Left Click Action
Environment/Project Explorer/Ctrl+Left The action the editor performs on Ctrl+Left Click.
Click ActionEnumeration
Ctrl+Middle Click Action
Environment/Project Explorer/Ctrl+Middle The action the editor performs on Ctrl+Middle Click.
Click ActionEnumeration
Ctrl+Right Click Action
Environment/Project Explorer/Ctrl+Right The action the editor performs on Ctrl+Right Click.
Click ActionEnumeration
Middle Click Action
Environment/Project Explorer/Middle Click The action the editor performs on Middle Click.
ActionEnumeration

374
Embedded Studio for ARM Reference Manual Appendices

Mouse Wheel Adjusts Font Size


Enable or disable resizing of font by mouse wheel
Text Editor/Mouse Wheel Adjusts Font
when CTRL key pressed.
SizeBoolean
Shift+Middle Click Action
Environment/Project Explorer/Shift+Middle The action the editor performs on Shift+Middle Click.
Click ActionEnumeration
Shift+Right Click Action
Environment/Project Explorer/Shift+Right The action the editor performs on Shift+Right Click.
Click ActionEnumeration

Programmer Assistance
Property Description
ATTENTION Tag List
Set the tags to display as ATTENTION comments.
Text Editor/ATTENTION TagsStringList
Ask For Index Ask to index the project if goto symbol fails in current
Text Editor/Ask For IndexBoolean editor context.
Enable or disable automatically swapping
Auto-Comment Text
commenting on source lines by typing '/' with an
Text Editor/Auto CommentBoolean
active selection.
Enable or disable automatically surrounding selected
Auto-Surround Text
text when typing triangular brackets, quotation marks,
Text Editor/Auto SurroundBoolean
parentheses, brackets, or braces.
Check Spelling
Enable spell checking in comments.
Text Editor/Spell CheckingBoolean
Code Completion Replaces Existing Word
Replace existing word with completion suggestion if
Text Editor/Completion Replaces Existing
cursor is located on one.
WordBoolean
Code Completion Suggestion Selection Key
Text Editor/Suggestion Selection The key used to select a code completion suggestion.
KeyEnumeration
Display Code Completion Suggestions While Typing
Enable code completion as you type without needing
Text Editor/Suggest Completion While
to use the show suggestions key (Ctrl+J).
TypingBoolean
Enable Popup Diagnostics
Text Editor/Enable Popup Enables on-screen diagnostics in the text editor.
DiagnosticsBoolean
FIXME Tag List
Set the tags to display as FIXME comments.
Text Editor/FIXME TagsStringList
Inactive Code Opacity
Specifies the opacity of code that has been
Text Editor/Inactive Code
conditionally excluded by the preprocessor.
OpacityIntegerRange

375
Embedded Studio for ARM Reference Manual Appendices

Include Preprocessor Definitions in Suggestions


Include or exclude preprocessor definitions in code
Text Editor/Preprocessor Definition
completion suggestions.
SuggestionsBoolean
Include Templates in Suggestions Include or exclude templates in code completion
Text Editor/Template SuggestionsBoolean suggestions.
Lint Tag List
Set the tags to display as Lint directives.
Text Editor/LINT TagsStringList
Show Inactive Code Show code that has been conditionally excluded by
Text Editor/Show Inactive CodeBoolean the preprocessor.
Show Symbol Declaration Tooltips
Show tooltips when hovering over symbols.
Text Editor/Show TooltipBoolean
Template Characters To Match
The number of characters to match before suggesting
Text Editor/Template Suggestions
a template.
CharactersIntegerRange

Save
Property Description
Backup File History Depth The number of backup files to keep when saving an
Text Editor/Backup File DepthIntegerRange existing file.
The line ending format to use for a new file or a file
Default Line Endings
where the existing line ending format cannot be
Text Editor/Default Line EndingsEnumeration
determined.
Delete Trailing Space On Save
Deletes trailing whitespace from each line when a file
Text Editor/Delete Trailing Space On
is saved.
SaveBoolean
Tab Cleanup On Save
Cleans up tabs when a file is saved.
Text Editor/Cleanup Tabs On SaveEnumeration

Visual Appearance
Property Description
Font
The font to use for text editors.
Text Editor/FontFixedPitchFont
Font Rendering
The font rendering scheme to use in text editors.
Text Editor/Font RenderingEnumeration
Font Smoothing Threshold The minimum size for font smoothing: font sizes
Text Editor/Antialias ThresholdIntegerRange smaller than this will have antialiasing turned off.
Hide Cursor When Typing
Hide or show the I-beam cursor when you start to type.
Text Editor/Hide Cursor When TypingBoolean

376
Embedded Studio for ARM Reference Manual Appendices

Highlight All Selected Text


Enable or disable visually highlighting all text that
Text Editor/Highlight All Selected
matches the current selection.
TextBoolean
Highlight Cursor Line
Enable or disable visually highlighting the cursor line.
Text Editor/Highlight Cursor LineBoolean
Horizontal Scroll Bar
Show or hide the horizontal scroll bar.
Text Editor/HScroll BarEnumeration
Insert Caret Style How the caret is displayed with the editor in insert
Text Editor/Insert Caret StyleEnumeration mode.
Line Numbers
How often line numbers are displayed in the margin.
Text Editor/Line Number ModeEnumeration
Mate Match Off Screen Specifies whether braces, brackets, and parentheses
Text Editor/Mate Match Off ScreenBoolean are matched when off screen.
Mate Matching Mode Controls when braces, brackets, and parentheses are
Text Editor/Mate Matching ModeEnumeration matched.
Maximum Collapsed Fold Preview Lines
The maximum number of lines to show in a collapsed
Text Editor/Maximum Collapsed Fold
fold preview tooltip.
Preview LinesIntegerRange
Minimum Scroll Width Specifies the minimum width of the scrolling region in
Text Editor/Minimum Scroll WidthIntegerRange characters.
Overwrite Caret Style
How the caret is displayed with the editor in overwrite
Text Editor/Overwrite Caret
mode.
StyleEnumeration
Selection Opacity
Specifies the opacity of text selection.
Text Editor/Selection OpacityIntegerRange
Show Bookmarks In Vertical Scroll Bar
Annotate the vertical scroll bar with bookmark
Text Editor/Show Bookmarks In Vertical
positions.
Scroll BarBoolean
Show Breakpoints In Vertical Scroll Bar
Annotate the vertical scroll bar with breakpoint
Text Editor/Show Breakpoints In Vertical
positions.
Scroll BarBoolean
Show Caret Position In Vertical Scroll Bar
Annotate the vertical scroll bar with the caret's
Text Editor/Show Caret In Vertical Scroll
position within the document.
BarBoolean
Show Diagnostic Icons In Gutter
Enables display of diagnostic icons in the icon gutter.
Text Editor/Diagnostic IconsBoolean
Show Errors In Vertical Scroll Bar
Text Editor/Show Errors In Vertical Annotate the vertical scroll bar with error positions.
Scroll BarBoolean
Show Fold Gutter Show or hide the left-hand gutter containing folding
Text Editor/Fold GutterBoolean controls.

377
Embedded Studio for ARM Reference Manual Appendices

Show Icon Gutter Show or hide the left-hand gutter containing


Text Editor/Icon GutterBoolean breakpoint, bookmark, and optional diagnostic icons.
Show Mini Toolbar Show the mini toolbar when selecting text with the
Text Editor/Mini ToolbarBoolean mouse.
Show Toolbar
Show or hide the Editor toolbar in the dock window.
Text Editor/ShowWidgetStripBoolean
Show Warnings In Vertical Scroll Bar
Text Editor/Show Warnings In Vertical Annotate the vertical scroll bar with warning positions.
Scroll BarBoolean
Use I-beam Cursor
Show an I-beam or arrow cursor in the text editor.
Text Editor/Ibeam cursorBoolean
Vertical Scroll Bar
Show or hide the vertical scroll bar.
Text Editor/VScroll BarEnumeration
View Whitespace
Make whitespace characters visible in the text editor.
Text Editor/View WhitespaceBoolean

378
Embedded Studio for ARM Reference Manual Appendices

Windows Environment Options

Autos
Property Description
Show Digit Separator
Environment/AutosWindow/Show Digit Show digit separator in variable value display.
SeparatorBoolean
Show Member Functions
Controls whether C++ class member functions are
Environment/AutosWindow/Show Member
displayed.
FunctionsBoolean
Show Variable Address Column
Controls whether the variable address column is
Environment/AutosWindow/Show Address
displayed.
ColumnBoolean
Show Variable Size Column
Environment/AutosWindow/Show Size Controls whether the variable size column is displayed.
ColumnBoolean
Show Variable Type Column
Controls whether the variable type column is
Environment/AutosWindow/Show Type
displayed.
ColumnBoolean

Call Stack
Property Description
Execution Frame at Top
Controls whether the most recent call is at the top or
Environment/Call Stack/Most Recent At
the bottom of the list.
TopBoolean
Show Call Address
Environment/Call Stack/Show Call Enables the display of the call address in the call stack.
AddressBoolean
Show Call Source Location
Enables the display of the call source location in the
Environment/Call Stack/Show Call
call stack.
LocationBoolean
Show Frame Size
Enables the display of the amount of stack used by the
Environment/Call Stack/Show Stack
call.
UsageBoolean
Show Frame Size In Bytes
Environment/Call Stack/Show Stack Usage Display the stack usage in bytes rather than words.
In BytesBoolean

379
Embedded Studio for ARM Reference Manual Appendices

Show Parameter Names


Enables the display of parameter names in the call
Environment/Call Stack/Show Parameter
stack.
NamesBoolean
Show Parameter Types
Environment/Call Stack/Show Parameter Enables the display of parameter types in the call stack.
TypesBoolean
Show Parameter Values
Enables the display of parameter values in the call
Environment/Call Stack/Show Parameter
stack.
ValuesBoolean
Show Stack Pointer
Enables the display of the stack pointer in the call
Environment/Call Stack/Show Stack
stack.
PointerBoolean
Show Stack Usage
Environment/Call Stack/Show Cumulative Enables the display of the amount of stack used.
Stack UsageBoolean
Show Stack Usage In Bytes
Environment/Call Stack/Show Cumulative Display the stack usage in bytes rather than words.
Stack Usage In BytesBoolean

Clipboard Ring
Property Description
Maximum Items Held In Ring
The maximum number of items held on the clipboard
Environment/Clipboard Ring/Max
ring before they are recycled.
EntriesIntegerRange
Preserve Contents Between Runs Save the clipboard ring across SEGGER Embedded
Environment/Clipboard Ring/SaveBoolean Studio runs.

Debug Terminal
Property Description
Backscroll Buffer Lines
The number of lines you can see when you scroll
Debug Terminal/Backscroll Buffer
backward in the debug terminal window.
LinesIntegerRange
Use Window System Colors
Substitute window system colors for ANSI black
Debug Terminal/Use Window System
background and white foreground in debug terminal.
ColorsBoolean

Globals
Property Description

380
Embedded Studio for ARM Reference Manual Appendices

Show Digit Separator


Environment/GlobalsWindow/Show Digit Show digit separator in variable value display.
SeparatorBoolean
Show Member Functions
Controls whether C++ class member functions are
Environment/GlobalsWindow/Show Member
displayed.
FunctionsBoolean
Show Variable Address Column
Controls whether the variable address column is
Environment/GlobalsWindow/Show Address
displayed.
ColumnBoolean
Show Variable Size Column
Environment/GlobalsWindow/Show Size Controls whether the variable size column is displayed.
ColumnBoolean
Show Variable Type Column
Controls whether the variable type column is
Environment/GlobalsWindow/Show Type
displayed.
ColumnBoolean

Locals
Property Description
Show Digit Separator
Environment/LocalsWindow/Show Digit Show digit separator in variable value display.
SeparatorBoolean
Show Member Functions
Controls whether C++ class member functions are
Environment/LocalsWindow/Show Member
displayed.
FunctionsBoolean
Show Variable Address Column
Controls whether the variable address column is
Environment/LocalsWindow/Show Address
displayed.
ColumnBoolean
Show Variable Size Column
Environment/LocalsWindow/Show Size Controls whether the variable size column is displayed.
ColumnBoolean
Show Variable Type Column
Controls whether the variable type column is
Environment/LocalsWindow/Show Type
displayed.
ColumnBoolean

Memory
Property Description
Confirm Large Download
Present a warning if you attempt to download a large
Environment/Memory Window/Confirm
amount of memory in the memory window.
SizeBoolean

381
Embedded Studio for ARM Reference Manual Appendices

Group Auto Columns


Selects whether columns are grouped in automatic
Environment/Memory Window/Group Auto
column mode.
ColumnsBoolean
Locate Sets Entry Width
Set the memory window entry width if possible when
Environment/Memory Window/Locate Sets
locating.
Entry WidthBoolean
Locate Sets Size
Environment/Memory Window/Locate Sets Set the memory window size when locating.
SizeBoolean
Scroll Wheel Modifies Start Address
Selects whether the mouse scroll wheel can change
Environment/Memory Window/Scroll Wheel
the memory window start address.
Modifies Start AddressBoolean

Outline
Property Description
Group #define Directives Group consecutive #define and #undef preprocessor
Windows/Outline/Group DefinesBoolean directives.
Group #include Directives
Group consecutive #include preprocessor directives.
Windows/Outline/Group IncludesBoolean
Group Top-Level Declarations
Group consecutive top-level variable and type
Windows/Outline/Group Top Level
declarations.
ItemsBoolean
Show Function Arguments
Show function arguments.
Windows/Outline/Show Function ArgsBoolean

Project Explorer
Property Description
Add Filename Replace Macros
Macros (system and global) used to replace the start of
Environment/Project Explorer/Filename
a filename on project file addition.
Replace MacrosStringList
Check Solution Target
Specifies whether to check target is correct when
Environment/Project Explorer/Check
loading a solution.
Solution TargetBoolean
Color Project Nodes
Show the project nodes colored for identification in
Environment/Project Explorer/Color
the Project Explorer.
NodesBoolean
Confirm Configuration Folder Delete
Display a confirmation prompt before deleting a
Project Explorer/Confirm Configuration
configuration folder cotaining properties.
Folder DeleteBoolean

382
Embedded Studio for ARM Reference Manual Appendices

Confirm File Replacement Warning


Display a confirmation prompt before replacing
Project Explorer/Confirm File Replacement
project files for import and creation
WarningBoolean
Confirm Forget Modified Options
Display a confirmation prompt before forgetting
Project Explorer/Confirm Reject Property
option modifications.
ChangesBoolean
Context Menu Edit Options At Top
Controls where Edit Options are displayed by the
Environment/Project Explorer/Context Menu
Project Explorer's context menu.
Properties PositionBoolean
Context Menu Uses Common Folder
Controls how common options are displayed by the
Environment/Project Explorer/Context Menu
Project Explorer's context menu.
Common FolderBoolean
The file name of the application to use as the external
External Editor
text editor. The external editor is started by holding
Environment/Project Explorer/External
down the Shift key when opening files from the
EditorFileName
project explorer.
Highlight Dynamic Items
Show an overlay on an item if it is populated from a
Environment/Project Explorer/Show Dynamic
dynamic folder.
OverlayBoolean
Highlight External Items
Show an overlay on an item if it is not held within the
Environment/Project Explorer/Show Non-
project directory.
Local OverlayBoolean
Output Files Folder
Show the build output files in an Output Files folder in
Environment/Project Explorer/Show Output
the project explorer.
FilesBoolean
Read-Only Data In Code
Configures whether read-only data contributes to the
Environment/Project Explorer/Statistics
Code or Data statistic.
Read-Only Data HandlingBoolean
Show Dependencies
Environment/Project Explorer/Dependencies Controls how the dependencies are displayed.
DisplayEnumeration
Show Favorite Properties
Controls if favorite properties are displayed by the
Environment/Project Explorer/Context Menu
Project Explorer's context menu.
Show FavoritesBoolean
Show File Count on Folder
Show the number of files contained in a folder as a
Environment/Project Explorer/Count
badge in the Project Explorer.
FilesBoolean
Show Modified Options on Folder/File
Show if a folder or file has modified options as a badge
Environment/Project Explorer/Show
in the Project Explorer.
Modified PropertiesBoolean
Show Options
Environment/Project Explorer/Properties Controls how the options are displayed.
DisplayEnumeration

383
Embedded Studio for ARM Reference Manual Appendices

Show Project Count on Solution


Show the number of projects contained in a solution
Environment/Project Explorer/Count
as a badge in the Project Explorer.
ProjectsBoolean
Show Source Control Annotation
Annotate items in the project explorer with their
Environment/Project Explorer/Show Source
source control status.
Control AnnotationBoolean
Show Statistics Rounded
Environment/Project Explorer/Statistics Show exact or rounded sizes in the project explorer.
FormatBoolean
Source Control Status Column
Show the source control status column in the project
Environment/Project Explorer/Show Source
explorer.
Control ColumnBoolean
Starred Files Names The list of wildcard-matched file names that are
Environment/Project Explorer/Starred File highligted with stars, to bring attention to themselves,
NamesStringList in the Project Explorer.
Statistics Column
Show the code and data size columns in the Project
Environment/Project Explorer/Statistics
Explorer.
DisplayBoolean
Synchronize Explorer With Editor
Synchronizes the Project Explorer with the document
Environment/Project Explorer/Sync
being edited.
EditorBoolean
Use Common Options Folder
Environment/Project Explorer/Common Controls how common options are displayed.
Properties DisplayBoolean

Registers 1
Property Description
Show Digit Separator
Environment/Registers1Window/Show Digit Show digit separator in register value display.
SeparatorBoolean
Show Register Address Column
Controls whether the register address column is
Environment/Registers1Window/Show Address
displayed.
ColumnBoolean

Registers 2
Property Description
Show Digit Separator
Environment/Registers2Window/Show Digit Show digit separator in register value display.
SeparatorBoolean

384
Embedded Studio for ARM Reference Manual Appendices

Show Register Address Column


Controls whether the register address column is
Environment/Registers2Window/Show Address
displayed.
ColumnBoolean

Registers 3
Property Description
Show Digit Separator
Environment/Registers3Window/Show Digit Show digit separator in register value display.
SeparatorBoolean
Show Register Address Column
Controls whether the register address column is
Environment/Registers3Window/Show Address
displayed.
ColumnBoolean

Registers 4
Property Description
Show Digit Separator
Environment/Registers4Window/Show Digit Show digit separator in register value display.
SeparatorBoolean
Show Register Address Column
Controls whether the register address column is
Environment/Registers4Window/Show Address
displayed.
ColumnBoolean

Source Navigator
Property Description
Show definitions only. When set to Yes only symbols
Show Definitions Only that are defined will be included in the source
Windows/Source Navigator/Show Definitions navigator display. When set to No declarations of
OnlyBoolean symbols will also be included in the source navigator
display.
Show Function Arguments
Windows/Source Navigator/Show Function Show function arguments.
ArgsBoolean

Symbol Browser
Property Description

385
Embedded Studio for ARM Reference Manual Appendices

Code Field
Environment/Symbol Browser/Display Selects whether the Code field is displayed.
CodeBoolean
Const Field
Environment/Symbol Browser/Display Selects whether the Const field is displayed.
ConstBoolean
Data Field
Environment/Symbol Browser/Display Selects whether the Data field is displayed.
DataBoolean
Frame Size Field
Environment/Symbol Browser/Display Frame Selects whether the Frame Size field is displayed.
SizeBoolean
Range Field
Environment/Symbol Browser/Display Selects whether the Range field is displayed.
RangeBoolean
Section Field
Environment/Symbol Browser/Display Selects whether the Section field is displayed.
SectionBoolean
Size Field
Environment/Symbol Browser/Display Selects whether the Size field is displayed.
SizeBoolean
Sort Criteria
Environment/Symbol Browser/ Selects how to sort or group the symbols displayed.
GroupingEnumeration
Type Field
Environment/Symbol Browser/Display Selects whether the Type field is displayed.
TypeBoolean
Value Field
Environment/Symbol Browser/Display Selects whether the Value field is displayed.
ValueBoolean

Terminal Emulator
Property Description
Backscroll Buffer Lines
The number of lines you can see when you scroll
Terminal Emulator/Backscroll Buffer
backward in the terminal emulator window.
LinesIntegerRange
Baud Rate
Terminal Emulator/Communications/Baud Baud rate used when transmitting and receiving data.
RateEnumeration

386
Embedded Studio for ARM Reference Manual Appendices

Data Bits
Number of data bits to use when transmitting and
Terminal Emulator/Communications/Data
receiving data.
BitsEnumeration
Flow Control
Terminal Emulator/Communications/Flow The flow control method to use.
ControlEnumeration
Line Feed On Carriage Return
Append a line feed character when a carriage return
Terminal Emulator/Line Feed On Carriage
character is received.
ReturnBoolean
Local Echo Displays every character typed before sending to the
Terminal Emulator/Local EchoBoolean remote computer.
Maximum Input Block Size
Terminal Emulator/Maximum Input Block The maximum number of bytes to read at a time.
SizeIntegerRange
Parity
Terminal Emulator/Communications/ Parity used when transmitting and receiving data.
ParityEnumeration
Port
The communications port to use, e.g. /dev/ttyS0, /dev/
Terminal Emulator/Communications/
ttyS1, etc.
PortCOMPort
Port Used By Target Interface The COM port will be disconnected when the target
Terminal Emulator/Communications/Port interface is connected and reconnected when the
Used By Target InterfaceBoolean target interface is disconnected.
Set DTR
Terminal Emulator/Communications/ Set the DTR signal.
DTRBoolean
Stop Bits
Terminal Emulator/Communications/Stop Number of stop bits to use when transmitting data.
BitsEnumeration

Watch 1
Property Description
Show Digit Separator
Environment/Watch1Window/Show Digit Show digit separator in variable value display.
SeparatorBoolean
Show Member Functions
Controls whether C++ class member functions are
Environment/Watch1Window/Show Member
displayed.
FunctionsBoolean
Show Variable Address Column
Controls whether the variable address column is
Environment/Watch1Window/Show Address
displayed.
ColumnBoolean

387
Embedded Studio for ARM Reference Manual Appendices

Show Variable Size Column


Environment/Watch1Window/Show Size Controls whether the variable size column is displayed.
ColumnBoolean
Show Variable Type Column
Controls whether the variable type column is
Environment/Watch1Window/Show Type
displayed.
ColumnBoolean

Watch 2
Property Description
Show Digit Separator
Environment/Watch2Window/Show Digit Show digit separator in variable value display.
SeparatorBoolean
Show Member Functions
Controls whether C++ class member functions are
Environment/Watch2Window/Show Member
displayed.
FunctionsBoolean
Show Variable Address Column
Controls whether the variable address column is
Environment/Watch2Window/Show Address
displayed.
ColumnBoolean
Show Variable Size Column
Environment/Watch2Window/Show Size Controls whether the variable size column is displayed.
ColumnBoolean
Show Variable Type Column
Controls whether the variable type column is
Environment/Watch2Window/Show Type
displayed.
ColumnBoolean

Watch 3
Property Description
Show Digit Separator
Environment/Watch3Window/Show Digit Show digit separator in variable value display.
SeparatorBoolean
Show Member Functions
Controls whether C++ class member functions are
Environment/Watch3Window/Show Member
displayed.
FunctionsBoolean
Show Variable Address Column
Controls whether the variable address column is
Environment/Watch3Window/Show Address
displayed.
ColumnBoolean
Show Variable Size Column
Environment/Watch3Window/Show Size Controls whether the variable size column is displayed.
ColumnBoolean

388
Embedded Studio for ARM Reference Manual Appendices

Show Variable Type Column


Controls whether the variable type column is
Environment/Watch3Window/Show Type
displayed.
ColumnBoolean

Watch 4
Property Description
Show Digit Separator
Environment/Watch4Window/Show Digit Show digit separator in variable value display.
SeparatorBoolean
Show Member Functions
Controls whether C++ class member functions are
Environment/Watch4Window/Show Member
displayed.
FunctionsBoolean
Show Variable Address Column
Controls whether the variable address column is
Environment/Watch4Window/Show Address
displayed.
ColumnBoolean
Show Variable Size Column
Environment/Watch4Window/Show Size Controls whether the variable size column is displayed.
ColumnBoolean
Show Variable Type Column
Controls whether the variable type column is
Environment/Watch4Window/Show Type
displayed.
ColumnBoolean

Windows
Property Description
Buffer Grouping How the files are grouped or listed in the Windows
Environment/Windows/GroupingEnumeration window.
Show File Path as Tooltip
Show the full file name as a tooltip when hovering
Environment/Windows/Show Filename
over files in the Windows window.
TooltipsBoolean
Show Line Count and File Size Show the number of lines and size of each file in the
Environment/Windows/Show SizesBoolean windows list.

389
Embedded Studio for ARM Reference Manual Appendices

Code Options

Assembler
Property Description
Enables additional options to be supplied to the
Additional Assembler Options
assembler. This property will have macro expansion
asm_additional_optionsStringList
applied to it.
Enables additional options to be supplied to the
Additional Assembler Options From File
assembler from a file. This property will have macro
asm_additional_options_from_fileProjFileName
expansion applied to it.
Assembler
Specifies which assembler to use.
arm_assembler_variantEnumeration
Backup Additional Assembler Options Value of additional assembler options prior to generic
asm_additional_options_backupString options processing.
Run Preprocessor The assembly code file is preprocessed before
arm_preprocess_assembly_codeBoolean assembly

Build
Property Description
Always Rebuild Specifies whether or not to always rebuild the project/
build_always_rebuildBoolean folder/file.
Batch Build Configurations
The set of configurations to batch build.
batch_build_configurationsStringList
Build Options Generic File Name
The file name containing the generic options.
build_generic_options_file_nameProjFileName
Build Quietly Suppress the display of startup banners and
build_quietlyBoolean information messages.
Dependency File Name
The file name to contain the dependencies.
build_dependency_file_nameFileName
Enable Unused Symbol Removal Enable the removal of unused symbols from the
build_remove_unused_symbolsBoolean executable.
Exclude From Build Specifies whether or not to exclude the project/folder/
build_exclude_from_buildBoolean file from the build.
The string that is prepended to the gcc toolname e.g
GCC Prefix
arm-none-eabi-. The macro $(GCCPrefix) is set to this
gcc_prefixString
value for external build command lines.
GCC Target The macro $(GCCTarget) is set to this value for build
gcc_targetString command lines.

390
Embedded Studio for ARM Reference Manual Appendices

Include Debug Information Specifies whether symbolic debug information is


build_debug_informationBoolean generated.
Specifies a relative path to the intermediate file
Intermediate Directory
directory. This property will have macro expansion
build_intermediate_directoryDirPath
applied to it. The macro $(IntDir) is set to this value.
Object File Name Specifies a name to override the default object file
build_object_file_nameFileName name.
Specifies a relative path to the output file directory.
This property will have macro expansion applied
Output Directory
to it. The macro $(OutDir) is set to this value. The
build_output_directoryDirPath
macro $(RootRelativeOutDir) is set relative to the Root
Output Directory if specified.
Specifies that dependent projects can be built in
Project Can Build In Parallel
parallel. Default is No for Staging and Combining
project_can_build_in_parallelEnumeration
project types, Yes for all other project types.
Project Dependencies Specifies the projects the current project depends
project_dependenciesStringList upon.
Path of the project directory relative to the directory
Project Directory
containing the project file. The macro $(ProjectDir) is
project_directoryString
set to the absolute path of this property.
Specifies macro values which are expanded in
Project Macros project properties and for file names in Common
macrosStringList configuration only. Each macro is defined as
name=value and are seperated by ;.
Specifies the type of project to build. The options are
Project Type Executable, Library, Object file, Staging, Combining,
project_typeEnumeration Externally Built Executable, Externally Built Library,
Externally Built Object file.
The file containing the property groups for this project.
Property Groups File
This is applicable to Executable and Externally Built
property_groups_file_pathProjFileName
Executable project types only.
Root Output Directory Allows a common root output directory to be specified
build_root_output_directoryDirPath that can be referenced using the $(RootOutDir) macro.
Suppress Warnings
Don't report warnings.
build_suppress_warningsBoolean
Specify the root of the toolchain directory. This
Toolchain Directory
property will have macro expansion applied to it. The
build_toolchain_directoryDirPath
macro $(ToolChainDir) is set to this value.
Treat Warnings as Errors
Treat all warnings as errors.
build_treat_warnings_as_errorsBoolean

391
Embedded Studio for ARM Reference Manual Appendices

Code Analyzer
Property Description
Analyze After Compile
Run the static code analyzer after compile
analyze_after_compileBoolean
The command to execute for the Analyze action. This
property will have macro expansion applied to it with
the additional macros:

Analyze Command $(DEFINES) contains a space seperated list


analyze_commandCommandLine of preprocessor definitions as set in the
Preprocessor Definitions property.
$(INCLUDES) contains a space seperated list of
user include directories as set in the User Include
Directories property.
Analyze Command Options C Options to supply to the analyze command for C
analyze_command_c_optionsStringList source files.
Analyze Command Options C++ Options to supply to the analyze command for C++
analyze_command_cpp_optionsStringList source files.
Clang Tidy Checks C
Checks to supply to clang-tidy for C source files.
clang_tidy_checks_cStringList
Clang Tidy Checks C++
Checks to supply to clang-tidy for C++ source files.
clang_tidy_checks_cppStringList

Code Generation
Property Description
ARM Advanced SIMD Auto Vectorize
Enable automatic code generation for Advanced SIMD.
arm_advanced_SIMD_auto_vectorizeBoolean
Specifies the Advanced SIMD type to generate code
ARM Advanced SIMD Type for. The options are:
arm_advanced_SIMD_typeEnumeration
NEON - Cortex-A based processors

392
Embedded Studio for ARM Reference Manual Appendices

Specifies the version of the instruction set to generate


code for. The options are:

v4T - ARM7TDMI and ARM920T processors


v5TE - ARM9E, Feroceon and XScale processors
v6 - ARM11 processors
v6M - Cortex-M0 and Cortex-M1 processors
v7M - Cortex-M3 processors
v7EM - Cortex-M4 and Cortex-M7 processors
v7R - Cortex-R processors
v7A - Cortex-A processors
v8R - Cortex-R AArch32 processors
v8A - Cortex-A AArch32 processors
v8M_Baseline - Cortex M23 processor
v8M_Mainline - Cortex M33 processor
v8M.1_Mainline - Cortex-M55 processors
ARM Architecture None
arm_architectureEnumeration
The corresponding preprocessor definitions:

__ARM_ARCH_4T__
__ARM_ARCH_5TE__
__ARM_ARCH_6__
__ARM_ARCH_6M__
__ARM_ARCH_7M__
__ARM_ARCH_7EM__
__ARM_ARCH_7R__
__ARM_ARCH_7A__
__ARM_ARCH_8R__
__ARM_ARCH_8A__
__ARM_ARCH_8M_BASELINE__
__ARM_ARCH_8M_MAINLINE__
__ARM_ARCH_81M_MAINLINE__

are defined.

393
Embedded Studio for ARM Reference Manual Appendices

Specifies the core to generate code for. The options


are:

ARM7TDMI, ARM7TDMI-S, ARM720T


ARM920T, ARM946E-S, ARM966E-S, ARM968E-S,
ARM926EJ-S
ARM1136J-S, ARM1136JF-S, ARM1176JZ-S,
ARM1176JZF-S
Cortex-M0, Cortex-M0+, Cortex-M1, Cortex-M23,
Cortex-M3, Cortex-M33, Cortex-M4, Cortex-M55,
Cortex-M7
ARM Core Type
Cortex-R4, Cortex-R4F, Cortex-R5, Cortex-R7,
arm_core_typeEnumeration
Cortex-R8
Cortex-R52
Cortex-A5, Cortex-A7, Cortex-A8, Cortex-A9,
Cortex-A15, Cortex-A17
Cortex-A32, Cortex-A35, Cortex-A53, Cortex-A55,
Cortex-A57, Cortex-A72, Cortex-A73, Cortex-A75
XScale
None

If this property is set to None then the architecture


property is used
Specifies the FP ABI type to generate code for. The
options are:

Soft generate calls to the C library to implement


floating point operations.
ARM FP ABI Type SoftFP generate VFP code to implement floating
arm_fp_abiEnumeration point operations.
Hard generate VFP code to implement floating
point operations and use VFP registers to pass
floating point parameters on function calls.
None will not specify the FP ABI or the FPU.

394
Embedded Studio for ARM Reference Manual Appendices

Specifies the FPU type to generate code for. The


options are:

VFP - ARM9/ARM11 based processors


VFP9 - the same as VFP
VFPv3-D32 - Cortex-A/Cortex-R based processors
VFPv3-D16 - Cortex-A/Cortex-R based processors
VFPv4-D32 - Cortex-A/Cortex-R based processors
VFPv4-D16 - Cortex-A/Cortex-R based processors
FPv4-SP-D16 - Cortex-M4 processors
FPv5-SP-D16 - Cortex-M7/Cortex-M33/Cortex-R52
processors
FPv5-D16 - Cortex-M7 processors
ARM FPU Type FP-ARMv8 - Cortex-A/Cortex-R AArch32
arm_fpu_typeEnumeration processors

The corresponding preprocessor definitions:

__ARM_ARCH_VFP__
__ARM_ARCH_VFP3_D32__
__ARM_ARCH_VFP3_D16__
__ARM_ARCH_VFP4_D32__
__ARM_ARCH_VFP4_D16__
__ARM_ARCH_FPV4_SP_D16__
__ARM_ARCH_FPV5_SP_D16__
__ARM_ARCH_FPV5_D16__
__ARM_ARCH_FP_ARMv8__

are defined.
Specifies whether ARM/Thumb interworking code
ARM/Thumb Interworking should be generated. Setting this property to No
arm_interworkEnumeration may result in smaller code sizes when compiling for
architecture v4T.
Specify the byte order of the target processor. The
options are:
Byte Order
arm_endianEnumeration Little little endian code and data.
Big big endian code and data.
BE-8 little endian code and big endian data.
CM0/CM0+/CM1 Has Small Multiplier
The CM0/CM0+/CM1 core has the small multiplier.
arm_cm0_has_small_multiplierBoolean

395
Embedded Studio for ARM Reference Manual Appendices

Specifies the level of debugging information to


generate. The options are:

None - no debugging information


Debugging Level Level 1 - backtrace and line number debugging
gcc_debugging_levelEnumeration information
Level 2 - Level 1 and variable display debugging
information
Level 3 - Level 2 and macro display debugging
information
Disable Function Inlining Disable auto inlining of functions when optimization
gcc_disable_function_inliningBoolean enables this.
Dwarf Version Specifies the version of Dwarf debugging information
gcc_dwarf_versionEnumeration to generate.
Emit Assembler CFI Emit DWARF 2 unwind info using GAS .cfi_* directives
gcc_emit_assembler_cfiBoolean rather than a compiler generated .eh_frame section.
Enable Coroutines
Enable compiler coroutine support.
gcc_enable_coroutinesBoolean
Enable Exception Support Specifies whether exception support is enabled for C+
cpp_enable_exceptionsBoolean + programs.
Enable RTTI Support Specifies whether RTTI support is enabled for C++
cpp_enable_rttiBoolean programs.
Enable Use Of __cxa_atexit
Enable compiler usage of __cxa_atexit.
gcc_use_cxa_at_exitBoolean
Enumeration Size Select between minimal container sized enumerations
gcc_short_enumEnumeration and int sized enumerations.
Generate Dwarf Debug Types
Generate Dwarf .debug_types section.
gcc_dwarf_generate_debug_typesBoolean
Generate Dwarf Pubnames Generate Dwarf .debug_pubnames
gcc_dwarf_generate_pubnamesBoolean and .debug_pubtypes sections.
Generate Listing File An source/assembler listing file is generated which can
asm_generate_listing_fileBoolean be found in the output files folder
Instruction Set
Specifies the instruction set to generate code for.
arm_instruction_setEnumeration
Instrument Functions Specifies whether instrumentation calls are generated
arm_instrument_functionsBoolean for function entry and exit.
Keep Link Time Optimization Intermediate Files Specifies whether to keep the link time optimization
link_keep_lto_filesBoolean resolution and object files.
Link Time Optimization Specifies whether the project should be built for
link_time_optimizationBoolean optimization at link time.
Link Time Optimization Additional Options Enables additional options to be supplied to the link
lto_additional_optionsStringList time optimization process

396
Embedded Studio for ARM Reference Manual Appendices

Long Calls Specifies whether function calls are made using


arm_long_callsBoolean absolute addresses.
Select machine outliner mode. An optimization
that reduces code size by identifying identical code
Machine Outliner [clang+segger-cc]
sequences across functions and replaces them with
clang_machine_outlinerEnumeration
a call to a function which contains the identical code
sequence.
Math Errno Set errno after calling math functions that are
arm_math_errnoBoolean executed with a single instruction, e.g., sqrt.
Select whether global declarations are merged. This
may reduce code size and increase execution speed
Merge Globals [clang+segger-cc] for some applications. However, if functions are not
clang_merge_globalsBoolean used in an application and are eliminated by the
linker, merged globals may increase the data size
requirement of an application.
No COMMON
Don't put globals in the common section
gcc_no_commonBoolean
Omit Frame Pointer Specifies whether a frame pointer register is omitted if
gcc_omit_frame_pointerBoolean not required.
Specifies the optimization level to use. The options are:

None - don't specify an optimization level


Level 0 - no optimization, fastest compilation and
best debug experience.
Optimization Level Level 1 - optimize minimally.
gcc_optimization_levelEnumeration Level 2 for speed
Level 2 balanced
Level 2 for size
Level 3 for more speed - optimize even more, will
take longer to compile and may produce much
larger code.
Relocation Model [clang+segger-cc]
Select relocation model.
clang_relocation_modelEnumeration
Stack Sizes [clang+segger-cc]
Generate stack sizes section
generate_stack_sizesBoolean
Unaligned word and half-words can be accessed. The
options are:

Unaligned Access Support. Yes enable unaligned word and half-words.


arm_unaligned_accessEnumeration No disable unaligned word and half-words.
Auto disable unaligned word and half-word
access for v4T/v5TE/v6M/v8M_Baseline
architectures, enable for others.
Unwind Tables
Generate unwind tables for C code.
arm_unwind_tablesBoolean

397
Embedded Studio for ARM Reference Manual Appendices

Use Builtins
Use built-in library functions e.g. scanf.
arm_use_builtinsBoolean
Specifies the vector extension type to generate code
for. The options are:
Vector Extension
arm_v81M_mve_typeEnumeration MVE - integer instructions
MVE.FP - integer and single precision floating-
point instructions
Wide Character Size Select between standard 32-bit or shorter 16-bit size
gcc_wchar_sizeEnumeration for wide characters and wchar_t.
The v7A architecture has integer divide instructions
in both ARM and Thumb instruction sets. The v7R
v7A/v7R Has Integer Divide Instructions
architecture has integer divide instructions in the ARM
arm_v7_has_divide_instructionsBoolean
instruction set. The v7R architecture always has integer
divide instructions in the Thumb instruction set.
v8A Has CRC Instructions
The v8A architecture has CRC instructions.
arm_v8A_has_crcBoolean
v8A Has Crypto Instructions
The v8A architecture has crypto instructions.
arm_v8A_has_cryptoBoolean
v8M Has CMSE Instructions
The v8M architecture has CMSE instructions.
arm_v8M_has_cmseBoolean
v8M Has DSP Instructions
The v8M architecture has DSP instructions.
arm_v8M_has_dspBoolean

Combining
Property Description
The command to execute. This property will have
macro expansion applied to it with the macro
Combine Command $(CombiningOutputFilePath) set to the output
combine_commandCommandLine filepath of the combine command and the macro
$(CombiningRelInputPaths) is set to the (project
relative) names of all of the files in the project.
The working directory in which the combine command
Combine Command Working Directory
is run. This property will have macro expansion applied
combine_command_wdString
to it.
Output File Path The output file path the stage command will create.
combine_output_filepathString This property will have macro expansion applied to it.
Set To Read-only
Set the output file to read only or read/write.
combine_set_readonlyEnumeration

398
Embedded Studio for ARM Reference Manual Appendices

Compiler
Property Description
Enables additional options to be supplied to the
Additional C Compiler Only Options
C compiler only. This property will have macro
c_only_additional_optionsStringList
expansion applied to it.
Enables additional options to be supplied to the C
Additional C Compiler Only Options From File
compiler only from a file. This property will have macro
c_only_additional_options_from_fileProjFileName
expansion applied to it.
Enables additional options to be supplied to the
Additional C++ Compiler Only Options
C++ compiler only. This property will have macro
cpp_only_additional_optionsStringList
expansion applied to it.
Enables additional options to be supplied to the C++
Additional C++ Compiler Only Options From File
compiler only from a file. This property will have macro
cpp_only_additional_options_from_fileProjFileName
expansion applied to it.
Enables additional options to be supplied to the
Additional C/C++ Assembler Options
assembler when used by the C/C++ compiler. This
c_asm_additional_optionsStringList
property will have macro expansion applied to it.
Enables additional options to be supplied to the C/C+
Additional C/C++ Compiler Options
+ compiler. This property will have macro expansion
c_additional_optionsStringList
applied to it.
Enables additional options to be supplied to the C/C
Additional C/C++ Compiler Options From File
++ compiler from a file. This property will have macro
c_additional_options_from_fileProjFileName
expansion applied to it.
Backup Additional C Compiler Only Options Value of additional C compiler options prior to generic
c_only_additional_options_backupString options processing
Backup Additional C++ Compiler Only Options Value of additional C++ compiler options prior to
cpp_only_additional_options_backupString generic options processing
Backup Additional Compiler Options Value of additional compiler options prior to generic
c_additional_options_backupString options processing
Specifies the language standard to use when
compiling C files. The options are:

None - don't specify a language standard


C Language Standard c89/gnu89
gcc_c_language_standardEnumeration c90/gnu90
c99/gnu99
c11/gnu11
c17/gnu17

399
Embedded Studio for ARM Reference Manual Appendices

Specifies the language standard to use when


compiling C files. The options are:

None - don't specify a language standard


C++ Language Standard c++98/gnu++98
gcc_cplusplus_language_standardEnumeration c++11/gnu++11
c++14/gnu++14
c++20/gnu++20
c++17/gnu++17
Color Diagnostics
Specifies whether to enable color diagnostic output.
compiler_color_diagnosticsBoolean
Compile C Files As C++ Compile files that have the .c extension with the C++
c_files_are_cppBoolean compiler.
Compiler
Specifies which compiler to use.
arm_compiler_variantEnumeration
Enables all the warnings about constructions that
Enable All Warnings some users consider questionable, and that are easy
gcc_enable_all_warningsBoolean to avoid (or modify to prevent the warning), even in
conjunction with macros.
Enable All Warnings C Compiler Only Command Line
The command line options supplied to the C compiler
Options
when Enable All Warnings is enabled.
gcc_c_only_all_warnings_command_line_optionsStringList
Enable All Warnings C++ Compiler Only Command
The command line options supplied to the C++
Line Options
compiler when Enable All Warnings is enabled.
gcc_cpp_only_all_warnings_command_line_optionsStringList
Enable All Warnings Command Line Options The command line options supplied to the compiler
when Enable All Warnings is enabled.
gcc_all_warnings_command_line_optionsStringList
Perform additional checks for ensure strict
Enforce ANSI Checking
conformance to the selected ISO (ANSI) C or C++
c_enforce_ansi_checkingBoolean
standard.
Enforce ANSI Checking C Command Line Options The command line options supplied to the C compiler
when Enforce ANSI Checking is enabled.
gcc_c_only_enforce_ansi_checking_command_line_optionsStringList
Enforce ANSI Checking C++ Command Line Options The command line options supplied to the C++
compiler when Enforce ANSI Checking is enabled.
gcc_cpp_only_enforce_ansi_checking_command_line_optionsStringList
Enforce ANSI Checking Command Line Options The command line options supplied to the compiler
when Enforce ANSI Checking is enabled.
gcc_enforce_ansi_checking_command_line_optionsStringList
GNU Version [clang+segger-cc]
Specifies value of __GNU__ and related macros
clang_gnu_versionEnumeration
Keep Assembly Source Specifies whether assembly code generated by the
arm_keep_assemblyBoolean compiler is kept.
Keep Preprocessor Output Specifies whether preprocessor output generated by
arm_keep_preprocessor_outputBoolean the compiler is kept.

400
Embedded Studio for ARM Reference Manual Appendices

Show Caret Specifies whether caret is displayed in compiler


compiler_diagnostics_show_caretBoolean diagnostics.
Supply Absolute File Path Specifies whether absolute file paths are supplied to
arm_supply_absolute_file_pathBoolean the compiler.
Use Compiler Driver
The build will issue cc commands.
use_compiler_driverBoolean

External Build
Property Description
The command line to archive object files. This property
will have macro expansion applied to it with the
additional macros:

$(TargetPath) contains the full file name of the


Library File Name property
$(RelTargePath) contains the project directory
Archive Command relative file name of the Object File Name
external_archive_commandCommandLine property.
$(Objects) a space seperated list of files to archive,
generated from the source files of the project OR.
$(ObjectsFilePath) contains the full file name of
the file containing the list of files to archive
$(RelObjectsFilePath) contains the project
directory relative file name of the file containing
the list of files to link

401
Embedded Studio for ARM Reference Manual Appendices

The command line to assemble an assembly source


file. This property will have macro expansion applied
to it with the additional macros:

$(TargetPath) contains the full file name of the


Object File Name property.
$(RelTargePath) contains the project directory
relative file name of the Object File Name
property.
$(AsmOptions) contains a space seperated list
of options as set in the Additional Assembler
Options property.
$(DependencyPath) contains the filename of
Assemble Command the .d file that is required to be output by the
external_assemble_commandCommandLine compilation for dependency support.
$(RelDependencyPath) contains the relative
filename of the .d file that is required to be output
by the compilation for dependency support.
$(Defines) contains a space seperated list
of preprocessor definitions as set in the
Preprocessor Definitions property.
$(Undefines) contains a space seperated list
of preprocessor undefinitions as set in the
Preprocessor Definitions property.
$(Includes) contains a space seperated list of
user include directories as set in the User Include
Directories property.
Build Command The command line to build the executable e.g. make.
external_build_commandCommandLine This property will have macro expansion applied to it.

402
Embedded Studio for ARM Reference Manual Appendices

The command line to compile a C source file. This


property will have macro expansion applied to it with
the additional macros:

$(TargetPath) contains the full file name of the


Object File Name property.
$(RelTargePath) contains the project directory
relative file name of the Object File Name
property.
$(COptions) contains a space seperated list of
options as set in the C Additional C/C++ Compiler
Options property.
$(COnlyOptions) contains a space seperated list
of options as set in the C Additional C Compiler
C Compile Command Only Options property.
external_c_compile_commandCommandLine $(DependencyPath) contains the filename of
the .d file that is required to be output by the
compilation for dependency support.
$(RelDependencyPath) contains the relative
filename of the .d file that is required to be output
by the compilation for dependency support.
$(Defines) contains a space seperated list
of preprocessor definitions as set in the
Preprocessor Definitions property.
$(Undefines) contains a space seperated list
of preprocessor undefinitions as set in the
Preprocessor Definitions property.
$(Includes) contains a space seperated list of
user include directories as set in the User Include
Directories property.

403
Embedded Studio for ARM Reference Manual Appendices

The command line to compile a C++ source file. This


property will have macro expansion applied to it with
the additional macros:

$(TargetPath) contains the full file name of the


Object File Name property.
$(RelTargePath) contains the project directory
relative file name of the Object File Name
property.
$(COptions) contains a space seperated list of
options as set in the C Additional C/C++ Compiler
Options property.
$(CppOnlyOptions) contains a space seperated
list of options as set in the C Additional C++
C++ Compile Command Compiler Only Options property.
external_cpp_compile_commandCommandLine $(DependencyPath) contains the filename of
the .d file that is required to be output by the
compilation for dependency support.
$(RelDependencyPath) contains the relative
filename of the .d file that is required to be output
by the compilation for dependency support.
$(Defines) contains a space seperated list
of preprocessor definitions as set in the
Preprocessor Definitions property
$(Undefines) contains a space seperated list
of preprocessor undefinitions as set in the
Preprocessor Definitions property.
$(Includes) contains a space seperated list of
user include directories as set in the User Include
Directories property.

404
Embedded Studio for ARM Reference Manual Appendices

The command line to link an executable. This property


will have macro expansion applied to it with the
additional macros:

$(TargetPath) contains the full file name of the


Executable File Name property.
$(RelTargePath) contains the project directory
relative file name of the Executable File Name
property.
$(LinkOptions) contains a space seperated list of
options as set in the Additional Linker Options
property.
$(Objects) a space seperated list of files to link,
generated from the source files of the project and
C++ Link Command the outputs of any dependent projects OR.
external_cpp_link_commandCommandLine $(ObjectsFilePath) contains the full file name of
the file containing the list of files to link
$(RelObjectsFilePath) contains the project
directory relative file name of the file containing
the list of files to link
$(LinkerScriptPath) contains the full file name of
the Linker Script File property.
$(RelLinkerScriptPath) contains the project
directory relative file name of the Linker Script
File property.
$(MapPath) contains the full file name of the
required map file.
$(RelMapPath) contains the project directory
relative file name of the required map file.
The command line to clean the executable e.g. make
Clean Command
clean. This property will have macro expansion applied
external_clean_commandCommandLine
to it.

405
Embedded Studio for ARM Reference Manual Appendices

The command line to link an executable. This property


will have macro expansion applied to it with the
additional macros:

$(TargetPath) contains the full file name of the


Executable File Name property.
$(RelTargePath) contains the project directory
relative file name of the Executable File Name
property.
$(LinkOptions) contains a space seperated list of
options as set in the Additional Linker Options
property.
$(Objects) a space seperated list of files to link,
generated from the source files of the project and
Link Command the outputs of any dependent projects OR.
external_link_commandCommandLine $(ObjectsFilePath) contains the full file name of
the file containing the list of files to link
$(RelObjectsFilePath) contains the project
directory relative file name of the file containing
the list of files to link
$(LinkerScriptPath) contains the full file name of
the Linker Script File property.
$(RelLinkerScriptPath) contains the project
directory relative file name of the Linker Script
File property.
$(MapPath) contains the full file name of the
required map file.
$(RelMapPath) contains the project directory
relative file name of the required map file.
The name of the file containing the list of files to
archive or link, generated from the source files of
Objects File
the project.This property will have macro expansion
external_objects_file_nameCommandLine
applied to it. The macro $(ObjectsFilePath) is set to this
value.

File
Property Description
File Encoding Specifies the encoding to use when reading and
file_codecEnumeration writing the file.

406
Embedded Studio for ARM Reference Manual Appendices

The name of the file. This property will have global


macro expansion applied to it. The following macros
are set based on the value: $(InputDir) relative
File Name directory of file, $(InputName) file name without
file_nameString directory or extension, $(InputFileName) file name,
$(InputExt) file name extension, $(InputPath) absolute
path to the file name, $(RelInputPath) relative path
from project directory to the file name.
File Open Action Specifies how to open the file when it is double
file_open_withEnumeration clicked.
File Type The type of file. Default setting uses the file extension
file_typeEnumeration to determine file type.
Flag Flag which you can use to draw attention to important
file_flagEnumeration files in your project.

Folder
Property Description
Dynamic folder directory specification - ; seperated
Dynamic Folder Directory
directory names that will have global macro expansion
pathDirPath
applied to them.
Dynamic Folder Exclude Dynamic folder exclude specification - ; seperated
excludeStringList wildcards.
Dynamic Folder Filter Dynamic folder filter specification - ; seperated
filterString wildcards.
Dynamic Folder Recurse
Dynamic folder recurse into subdirectories.
recurseBoolean
Unity Build Exclude Filter The filter specification to exclude from the unity build
unity_build_exclude_filterString - ; seperated wildcards.
Unity Build File Name The file name created that #includes all files in the
unity_build_file_nameFileName folder for the unity build.

General
Property Description
Environment Variables
Environment variables to set on solution load.
environment_variablesStringList
Inherited Configurations The list of configurations that are inherited by this
inherited_configurationsStringList configuration.

407
Embedded Studio for ARM Reference Manual Appendices

Library
Property Description
Specifies which Debug I/O mechanism to use for I/O
operations.
Options are:
Debug I/O Implementation
arm_link_debugio_typeEnumeration Breakpoint: Hardware breakpoint instruction and
memory locations are used
DCC: ARM debug communication channel is used
Memory Poll: Memory locations are polled
Exclude Default Library Helper Functions Specifies whether to exclude default library helper
link_use_multi_threaded_librariesBoolean functions.
Include Standard Libraries Specifies whether the standard libraries should be
link_include_standard_librariesBoolean linked into your application.
Library ARM Architecture Specifies the architecture variant of the library to link
arm_library_architectureEnumeration with. The default uses the ARM Architecture value
Library File Name Specifies a name to override the default library file
build_output_file_nameFileName name.
Specifies how the library heap is implemented.
Options are:

Library Heap Basic: Use low-overhead heap allocator.


LIBRARY_HEAP_TYPEEnumeration Minimal: Use alloc-only heap allocator.
Real-Time: Use real-time heap allocator.
None: Do not implement heap allocator. (Use
application-supplied allocator).
Specifies how the library heap locking is implemented.
Options are:
Library Heap Locking
LIBRARY_HEAP_LOCKINGEnumeration Disable Interrupts: Disable global interrupts.
User: Call user supplied __heap_lock/
__heap_unlock functions.

408
Embedded Studio for ARM Reference Manual Appendices

Specifies how the library does I/O.


Options are:

RTT: Use SEGGER Real-Time Transfer for I/


O operations without halting the system.
Recommended for maximum speed.
SEMIHOST: Format output and write to RAM
buffer. Halt CPU for I/O operation. Provides hosted
file I/O.
SEMIHOST (host-formatted): Halt CPU for I/O
operation. Recommended for minimum size.
SWO: Format output and write to RAM buffer.
Library I/O
Use SWO for Output operation. Use CMSIS
LIBRARY_IO_TYPEEnumeration
ITM_RxBuffer/ITM_RXBUFFER_EMPTY memory
access for Input Operation.
SWO (Interrupts Disabled): Format output
and write to RAM buffer. Use SWO for Output
operation with interrupts disabled. Use CMSIS
ITM_RxBuffer/ITM_RXBUFFER_EMPTY memory
access for Input Operation.
None: Do not include I/O implementation. Use
user-supplied I/O Mechanism.

For more information read: https://wiki.segger.com/


Embedded_Studio_Library_IO
Library Instruction Set Specifies the instruction set variant of the libraries to
arm_library_instruction_setEnumeration link with.
Library Optimization Specifies whether to link with libraries optimized for
arm_library_optimizationEnumeration speed or size.
Standard Libraries Directory
Specifies where to find the standard libraries
link_standard_libraries_directoryString

Linker
Property Description
Additional Input Files Enables additional object and library files to be
linker_additional_filesStringList supplied to the linker.
Additional Linker Options
Enables additional options to be supplied to the linker.
linker_additional_optionsStringList
Additional Linker Options From File Enables additional options to be supplied to the linker
from a file.
linker_additional_options_from_fileProjFileName
Additional Linker Script Generator Options Enables additional options to be supplied to the linker
arm_additional_mkld_optionsStringList script generator
Additional Output File Gap Fill Value The value to fill gaps between sections in additional
output file.
arm_linker_additional_output_file_gap_fillString

409
Embedded Studio for ARM Reference Manual Appendices

The format used when creating an additional linked


output file.The options are:
Additional Output Format None do not create an additional output file.
linker_output_formatEnumeration bin create a binary file.
srec create a Motorola S-Record file.
hex create an Intel Hex file.
Additional System Libraries Enables additional system libraries to be supplied to
linker_additional_system_librariesStringList the linker.
Align ro Section [segger-ld]
Specifies the linker byte alignment of the ro section
link_align_roEnumeration
Align rw Section [segger-ld]
Specifies the linker byte alignment of the rw section
link_align_rwEnumeration
Align rx Section [segger-ld]
Specifies the linker byte alignment of the rx section
link_align_rxEnumeration
Align zi Section [segger-ld]
Specifies the linker byte alignment of the zi section
link_align_ziEnumeration
Allow Multiple Symbol Definition Do not report error if the same symbol is defined more
arm_linker_allow_multiple_definitionBoolean than once in object files/libraries.
Backup Additional Linker Options Value of additional linker options prior to generic
link_additional_options_backupString options processing
Breakpad Symbols Directory
Specifies location of the breakpad symbols directory.
linker_breakpad_symbols_directoryString
CMSE Import Library File Specifies the name of the CMSE import library to
generate.
arm_linker_cmse_import_library_file_nameFileName
Check CMSE Import Library File Specifies the name of the file to check the generated
CMSE import library with.
arm_linker_check_cmse_import_library_file_nameFileName
Check For Memory Section Overflow Specifies whether the linker should check whether
program sections exceed their specified size.
arm_library_check_memory_section_overflowBoolean
Check For Memory Segment Overflow Specifies whether the linker should check whether
program sections fit in their memory segments.
arm_library_check_memory_segment_overflowBoolean
Deduplicate Code Sections [segger-ld] Specifies whether the linker finds readonly code
link_dedupe_codeBoolean sections that are identical and discard duplicates.
Deduplicate Data Sections [segger-ld] Specifies whether the linker finds readonly data
link_dedupe_dataBoolean sections that are identical and discard duplicates.
Specifies the default pattern used to fill unspecified
Default Fill Pattern regions of memory in a generated linker script. This
pattern maybe overidden by the fill attribute of a
arm_linker_script_generator_default_fill_patternString
program section in the section placement file.
Emit Relocations
Output relocation information into the executable.
arm_linker_emit_relocationsBoolean

410
Embedded Studio for ARM Reference Manual Appendices

Entry Point
Specifies the entry point of the program.
gcc_entry_pointString
Generate Breakpad Symbols Specifies whether to generate breakpad symbols from
linker_generate_breakpad_symbolsBoolean the linked image.
Generate Log File [segger-ld]
Specifies whether to generate a linkage log file.
linker_log_fileBoolean
Generate Map File
Specifies whether to generate a linkage map file.
linker_map_fileBoolean
Generate Map File [segger-ld]
Specifies whether to generate a linkage map file.
link_map_fileEnumeration
Indirect File Supported
Linker can use @indirect file for input files.
linker_use_indirect_filesBoolean
Inline Small Functions [segger-ld] Specifies whether the linker inlines small functions at
link_inlineBoolean the call site rather than calling the function.
Keep Symbols Specifies the symbols that should be kept by the linker
linker_keep_symbolsStringList even if they are not reachable.
Link Dependent Projects Specifies whether to link the output of dependent
link_dependent_projectsBoolean library projects.
Linker
Specifies which linker to use.
arm_linker_variantEnumeration
Linker Script File
The name of the manual linker script file.
link_linker_script_fileProjFileName
Linker Search Path
Specify the linker script search path.
arm_linker_search_pathStringList
Linker Symbol Definitions
Specifies one or more linker symbol definitions.
link_symbol_definitionsStringList
Map File Format [segger-ld]
Specifies map file format generated by the linker.
link_map_file_formatEnumeration
Memory Map File The name of the file containing the memory map
linker_memory_map_fileProjFileName description.
Macro values to substitue in memory map nodes. Each
Memory Map Macros
macro is defined as name=value and are seperated by
linker_memory_map_macrosStringList
;.
The start, access and size of named segments in the
target, these are used when no memory map file is
Memory Segments
available.Each segment is specified by NAME RWX
linker_section_placements_segmentsString
HEXSTART HEXSIZE for example FLASH RX 0x08000000
0x00010000
Merge Sections [segger-ld] Specifies whether the linker merges compatible
link_merge_sectionsBoolean sections.

411
Embedded Studio for ARM Reference Manual Appendices

Merge String Constants [segger-ld] Specifies whether the linker merges duplicate string
link_merge_stringsBoolean constants.
No Enum Size Warning Do not generate warnings when object files have
arm_linker_no_enum_size_warningBoolean different ARM EABI enum size attributes.
No Start File
Do not use startup files when linking.
arm_linker_no_start_filesBoolean
No Wide Char Size Warning Do not generate warnings when object files have
arm_linker_no_wchar_size_warningBoolean different ARM EABI wide character size attributes.
Pad ro Section [segger-ld]
Specifies whether the linker pads the ro section
link_pad_roBoolean
Pad rw Section [segger-ld]
Specifies whether the linker pads the rw section
link_pad_rwBoolean
Pad rx Section [segger-ld]
Specifies whether the linker pads the rx section
link_pad_rxBoolean
Pad zi Section [segger-ld]
Specifies whether the linker pads the zi section
link_pad_ziBoolean
Section Placement File The name of the file containing section placement
linker_section_placement_fileProjFileName description.
Section Placement Macros Macro values to substitue in section placement nodes -
linker_section_placement_macrosStringList MACRO1=value1;MACRO2=value2.
Start/End Group Required Linker requires --start-group and --end-group for input
linker_requires_start_groupBoolean files.
Strip Debug Information Specifies whether debug information should be
linker_strip_debug_informationBoolean stripped from the linked image.
Strip Symbols
Specifies whether symbols should be stripped.
gcc_strip_symbolsBoolean
Supply Memory Segments To Linker [segger-ld] Specifies whether to supply memory segments on the
linker_supply_memory_segmentsBoolean linker command line.
Suppress Warning on Mismatch
No warning on mismatched object files/libraries.
arm_linker_no_warn_on_mismatchBoolean
Symbols File
Specify the name of a symbols file to link.
arm_linker_symbols_filesFileName
Treat Linker Warnings as Errors
Treat linker warnings as errors.
arm_linker_treat_warnings_as_errorsBoolean
Use Manual Linker Script
Specifies whether to use a manual linker script.
link_use_linker_script_fileBoolean

Package
Property Description

412
Embedded Studio for ARM Reference Manual Appendices

Package Dependencies Specifies the packages the current project depends


package_dependenciesStringList upon.

Preprocessor
Property Description
Ignore Includes
Ignore the include directories properties.
c_ignore_includesBoolean
Preprocessor Definitions Specifies one or more preprocessor definitions. This
c_preprocessor_definitionsStringList property will have macro expansion applied to it.
Preprocessor Undefinitions Specifies one or more preprocessor undefinitions. This
c_preprocessor_undefinitionsStringList property will have macro expansion applied to it.
System Include Directories Specifies the system include path. This property will
c_system_include_directoriesStringList have macro expansion applied to it.
Undefine All Preprocessor Definitions
Does not define any standard preprocessor definitions.
c_undefine_all_preprocessor_definitionsBoolean
User Include Directories Specifies the user include path. This property will have
c_user_include_directoriesStringList macro expansion applied to it.

Printf/Scanf
Property Description
Printf Floating Point Supported Are floating point numbers supported by the printf
linker_printf_fp_enabledEnumeration function group.
Printf Integer Support The largest integer type supported by the printf
linker_printf_fmt_levelEnumeration function group.
Printf Width/Precision Supported Enables support for width and precision specification
in the printf function group.
linker_printf_width_precision_supportedBoolean
Scanf Classes Supported Enables support for %[...] and %[^...] character class
matching in the scanf functions.
linker_scanf_character_group_matching_enabledBoolean
Scanf Floating Point Supported Are floating point numbers supported by the scanf
linker_scanf_fp_enabledBoolean function group.
Scanf Integer Support The largest integer type supported by the scanf
linker_scanf_fmt_levelEnumeration function group.
Wide Characters Supported Are wide characters supported by the printf function
linker_printf_wchar_enabledBoolean group.

413
Embedded Studio for ARM Reference Manual Appendices

Project
Property Description
Flag Flag which you can use to draw attention to important
project_flagEnumeration projects in your solution.

Runtime Memory Area


Property Description
The size of the heap in bytes. The size must be a
Heap Size
multiple of 8. The preprocessor define __HEAP_SIZE__
arm_linker_heap_sizeIntegerRange
is set to this value.
Main Stack Size The size of the main stack in bytes. The size must be a
arm_linker_stack_sizeIntegerRange multiple of 8.
Process Stack Size The size of the process stack in bytes. The size must be
arm_linker_process_stack_sizeIntegerRange a multiple of 8.
Stack Size (Abort Mode) The size of the Abort mode stack in bytes. The size
arm_linker_abt_stack_sizeIntegerRange must be a multiple of 8.
Stack Size (FIQ Mode) The size of the FIQ mode stack in bytes. The size must
arm_linker_fiq_stack_sizeIntegerRange be a multiple of 8.
Stack Size (IRQ Mode) The size of the IRQ mode stack in bytes. The size must
arm_linker_irq_stack_sizeIntegerRange be a multiple of 8.
Stack Size (Supervisor Mode) The size of the Supervisor mode stack in bytes. The size
arm_linker_svc_stack_sizeIntegerRange must be a multiple of 8.
Stack Size (Undefined Mode) The size of the Undefined mode stack in bytes. The size
arm_linker_und_stack_sizeIntegerRange must be a multiple of 8.

Section
Property Description
Code Section Name Specifies the default name to use for the program code
default_code_sectionString section.
Constant Section Name Specifies the default name to use for the read-only
default_const_sectionString constant section.
Data Section Name Specifies the default name to use for the initialized,
default_data_sectionString writable data section.
ISR Section Name
Specifies the default name to use for the ISR code.
default_isr_sectionString
Vector Section Name Specifies the default name to use for the interrupt
default_vector_sectionString vector section.

414
Embedded Studio for ARM Reference Manual Appendices

Zeroed Section Name Specifies the default name to use for the zero-
default_zeroed_sectionString initialized, writable data section.

Solution
Property Description
Flag Flag which you can use to draw attention to important
solution_flagEnumeration projects in your solution.
Properties Filter The names of project properties that can be displayed
properties_filterStringList at the solution

Source Code
Property Description
Additional Code Completion Compiler Options Additional source indexing and code completion
code_completion_optionsStringList compiler options.
Disable source indexing and code completion for files/
Inhibit Source Indexing
folders/projects that would normally be indexed (C/C+
project_inhibit_indexingBoolean
+ files in executable and library projects).
Source Code Control Directory
Source code control directory root.
source_code_control_directoryDirPath

Staging
Property Description
Output File Path The output file path the stage command will create.
stage_output_filepathString This property will have macro expansion applied to it.
Set To Read-only Set the output file permissions to read only or read/
stage_set_readonlyEnumeration write.
The command to execute. This property will have
Stage Command macro expansion applied to it with the additional
stage_commandCommandLine $(StageOutputFilePath) macro set to the output
filepath of the stage command.
The working directory in which the stage command is
Stage Command Working Directory
run. This property will have macro expansion applied
stage_command_wdString
to it.
The command to execute after staging commands
Stage Project Command
have executed. This property will have macro
stage_post_build_commandCommandLine
expansion applied to it.

415
Embedded Studio for ARM Reference Manual Appendices

The working directory where the post build command


Stage Project Command Working Directory
runs. This property will have macro expansion applied
stage_post_build_command_wdString
to it.

User Build Step


Property Description
A command to run after the link but prior to additional
binary file generation. This property will have
Link Patch Command
macro expansion applied to it with the additional
linker_patch_build_commandCommandLine
$(TargetPath) macro set to the output filepath of the
linker command.
The working directory where the link patch command
Link Patch Working Directory
is run. This property will have macro expansion applied
linker_patch_build_command_wdDirPath
to it.
A command to run after the archive command has
Post-Archive Command completed.This property will have macro expansion
archive_post_build_commandCommandLine applied to it with the additional $(TargetPath) macro
set to the output filepath of the archive command.
The working directory where the post-archive
Post-Archive Working Directory
command is run. This property will have macro
archive_post_build_command_wdDirPath
expansion applied to it.
Post-Build Command The command to execute after a project build. This
post_build_commandCommandLine property will have macro expansion applied to it.
Post-Build Command Control Controls when the post-build command is run, either
post_build_command_controlEnumeration Always Run or when Run When Build Has Occurred.
The working directory in which the post-build
Post-Build Command Working Directory
command is run. This property will have macro
post_build_command_wdString
expansion applied to it.
A command to run after the compile command has
Post-Compile Command completed. This property will have macro expansion
compile_post_build_commandCommandLine applied to it with the additional $(TargetPath) macro
set to the output filepath of the compiler command.
The working directory where the post-compile
Post-Compile Working Directory
command is run. This property will have macro
compile_post_build_command_wdDirPath
expansion applied to it.
A command to run after the link command has
completed.This property will have macro expansion
Post-Link Command applied to it with the additional $(TargetPath) macro
linker_post_build_commandCommandLine set to the output filepath of the linker command and
$(PostLinkOutputFilePath) set to the value of the
output filepath of the post link command.

416
Embedded Studio for ARM Reference Manual Appendices

The name of the file created by the post-link


Post-Link Output File
command. This property will have macro expansion
linker_post_build_command_output_fileString
applied to it.
The working directory where the post-link command is
Post-Link Working Directory
run. This property will have macro expansion applied
linker_post_build_command_wdDirPath
to it.
Pre-Build Command The command to execute before a project build. This
pre_build_commandCommandLine property will have macro expansion applied to it.
Pre-Build Command Control Controls when the pre-build command is run, either
pre_build_command_controlEnumeration Always Run or when Run When Build Required.
The working directory in which the pre-build
Pre-Build Command Working Directory
command is run. This property will have macro
pre_build_command_wdString
expansion applied to it.
Pre-Compile Command A command to run before the compile command. This
compile_pre_build_commandCommandLine property will have macro expansion applied to it.
Pre-Compile Command Output File Path The pre-compile generated file name. This property
will have macro expansion applied to it.
compile_pre_build_command_output_file_nameString
The working directory where the pre-compile
Pre-Compile Working Directory
command is run. This property will have macro
compile_pre_build_command_wdDirPath
expansion applied to it.
Pre-Link Command A command to run before the link command. This
linker_pre_build_commandCommandLine property will have macro expansion applied to it.
The working directory where the pre-link command is
Pre-Link Working Directory
run. This property will have macro expansion applied
linker_pre_build_command_wdDirPath
to it.

417
Embedded Studio for ARM Reference Manual Appendices

Debug Options

Debugger
Property Description
Alternative LDR Disassembly
Show alternative disassembly of ldr*/vldr instructions
debug_alternative_ldr_disBoolean
CPU Register File The name of the file containing CPU register
debug_cpu_registers_fileProjFileName definitions.
Command Arguments The command arguments passed to the executable.
debug_command_argumentsString This property will have macro expansion applied to it.
The debugger will load (if not already loaded by
Debug Additional Projects
Load Additional Projects) and debug the specified
debug_dependent_projectsStringList
additional projects.
The name of the debug symbols file. This property will
Debug Symbols File[0]
have macro expansion applied to it. If it is not defined
external_debug_symbols_file_nameProjFileName
then the main load file is used.
The name of the debug symbols file. This property will
Debug Symbols File[1]
have macro expansion applied to it. If it is not defined
external_debug_symbols_file_name1ProjFileName
then the main load file is used.
The name of the debug symbols file. This property will
Debug Symbols File[2]
have macro expansion applied to it. If it is not defined
external_debug_symbols_file_name2ProjFileName
then the main load file is used.
The name of the debug symbols file. This property will
Debug Symbols File[3]
have macro expansion applied to it. If it is not defined
external_debug_symbols_file_name3ProjFileName
then the main load file is used.
Debug Symbols Load Address[0] The (code) address to be added to the debug symbol
external_debug_symbols_load_addressString (code) addresses.
Debug Symbols Load Address[1] The (code) address to be added to the debug symbol
external_debug_symbols_load_address1String (code) addresses.
Debug Symbols Load Address[2] The (code) address to be added to the debug symbol
external_debug_symbols_load_address2String (code) addresses.
Debug Symbols Load Address[3] The (code) address to be added to the debug symbol
external_debug_symbols_load_address3String (code) addresses.
Debug Terminal Log File
A file to write the output from the debug terminal to.
debug_terminal_log_fileUnknown
Default debugIO implementation
The default debugIO implementation.
arm_debugIO_ImplementationEnumeration
Display DCC data The debugger will display data that is written to the
arm_display_DCCBoolean DCC when debugIO is not used.

418
Embedded Studio for ARM Reference Manual Appendices

Entry Point Symbol


Debugger will start execution at symbol if defined.
debug_entry_point_symbolString
HTML Watch File
The file used by the debugger's HTML Watch window.
debug_html_watchProjFileName
Has Hypervisor Mode
Show hypervisor mode registers
arm_has_hypervisor_modeBoolean
Has Monitor Mode
Show monitor mode registers
arm_has_monitor_modeBoolean
Ignore .debug_aranges Section
The debugger will not use the .debug_aranges section.
debug_ignore_debug_arangesBoolean
Ignore .debug_frame Section
The debugger will not use the .debug_frame section.
debug_ignore_debug_frameBoolean
Load Additional Projects The debugger will load the outputs of the specified
debug_load_additional_projectsStringList additional projects.
The offset to add to the load address of the load
file.This offset is added to any absolute relocations
Load Offset
of symbols (whose address is less than Load Offset
debug_load_file_offsetString
Symbol Limit) if the load file contains relocation
sections.
Memory Upload Page Size The aligned page size the debugger uses when
debug_memory_upload_page_sizeInteger uploading address ranges.
RTT Control Block Address The symbol or 0x prefixed address of the RTT control
debug_RTTCBString block.
RTT Enable If enabled the debugger will service RTT input/output
debug_enable_RTTBoolean in the debug terminal.
Register Definition File
The name of the file containing register definitions.
debug_register_definition_fileProjFileName
The struct reserved member name. Struct members
Reserved Member Name
that contain the (case insensitive) string will not be
reservedMember_nameString
displayed.
If enabled the debugger will only display variables
Restrict Memory Access
located in the address ranges of the memory map or
debug_restrict_memory_accessBoolean
the sections in the elf file.
Run To
The initial breakpoint to set
debug_initial_breakpointString
Run To Control
Specify when the initial breakpoint should be set
debug_initial_breakpoint_set_optionEnumeration
Start Address The address to start the externally built executable
external_start_addressString running from.

419
Embedded Studio for ARM Reference Manual Appendices

If yes the debugger will start execution from the entry


Start From Entry Point Symbol
point symbol.If no the debugger will start execution
debug_start_from_entry_point_symbolBoolean
from the core specific location.
Starting Stack Pointer Value The symbol or 0x prefixed value to set the stack
debug_stack_pointer_startString pointer on start debugging.
Specifies the point in the program where startup is
Startup Completion Point
complete. Software breakpoints and debugIO will be
debug_startup_completion_pointString
enabled after this point has been reached.
Target Connection Specifies the target to connect to for debugging
debug_target_connectionEnumeration actions.
The name of the device to connect to. The macro
Target Device
$(Target) is substituted with the Target Processor
arm_target_device_nameString
project property value.
Thread Maximum
The maximum number of threads to display.
debug_threads_maxIntegerRange
Threads Script File
The threads script used by the debugger.
debug_threads_scriptProjFileName
Type Interpretation File
Specifies the type interpretation file to use.
debug_type_fileFileName
Working Directory The working directory for a debug session. This
debug_working_directoryDirPath property will have macro expansion applied to it.

GDB Server
Property Description
Specifies whether memory can be access while target
Allow Memory Access During Execution
is running. If set to No, target will be stopped each
gdb_server_allow_memory_access_during_executionBoolean
time memory is accessed.
Auto Start GDB Server Specifies whether a GDB server should be started on
gdb_server_autostart_serverBoolean connect.
Breakpoint Types
Specifies the type of breakpoints to use.
gdb_breakpoint_typesEnumeration
Connect Timeout The length of time in seconds to attempt to connect to
gdb_server_connect_timeoutInteger server before failing.
GDB Server Command Line
The command line to start the gdb server
gdb_server_command_lineCommandLine
Host
The hostname of the GDB server to connect to.
gdb_server_hostnameString
Ignore Checksum Errors Specifies whether an incorrect GDB server checksum
gdb_server_ignore_checksum_errorsBoolean causes and error.

420
Embedded Studio for ARM Reference Manual Appendices

Log File Specifies a file to output a log of GDB server


gdb_server_log_fileUnknown transactions to.
Port
The port number to use to connect to the GDB server.
gdb_server_portInteger
Read Timeout The length of time in seconds to attempt to read from
gdb_server_read_timeoutInteger server before failing.
Register Access
Specifies how registers are accessed
gdb_server_register_accessEnumeration
Reset and Stop Command The remote GDB server command to use to reset and
gdb_server_reset_commandString stop the target.
Target XML File If specified, points to a target.xml file to use in place of
gdb_server_target_xml_fileFileName file returned by the GDB server.
Specifies the type of GDB server being connected
Type
to. J-Link, OpenOCD, ST-LINK and pyOCD gdb server
gdb_server_typeEnumeration
implementations are currently supported.
Write Timeout The length of time in seconds to attempt to write to
gdb_server_write_timeoutInteger server before failing.

J-Link
Property Description
Specify additional J-Link options to allow enabling or
Additional J-Link Options
disabling advanced features and fine tuning.
JLinkExecuteCommandString
For more information see J-Link Command Strings
Enable Adaptive Clocking
Adaptive clocking is enabled.
adaptiveEnumeration
Address range to exclude from flash cache.
Exclude Flash Cache Range This can be specified by either 'start_address-
JLinkExcludeFlashCacheRangeString end_address' or 'address,size'.
For example: 0x08000000,0x10000.
Defines how to connect the host to the J-Link:

"USB": Connect to J-Link via USB


"USB S/N": Connect to J-Link with specified serial
Host Connection number via USB e.g. USB 174300001
ConnectionEnumeration "IP S/N": Connect to J-Link with specified serial
number via IP e.g. IP 174300001
"IP n.n.n.n port": Connect to J-Link with specified
IP address and optional port number e.g. IP
192.168.20.20 19020

421
Embedded Studio for ARM Reference Manual Appendices

Specifies the number of bits in the instruction


register before the target (as seen from TDI), which
JTAG Instruction Register Size Before Target
is the number of bits to pad the JTAG instruction
arm_linker_jtag_pad_post_irIntegerRange
register with the BYPASS instruction after the target
instruction.
Specifies the number of devices before the target (as
JTAG Number Of Devices Before Target
seen from TDI), which is the number of bits to pad the
arm_linker_jtag_pad_post_drIntegerRange
JTAG data register.
Log File
The file to output the J-Link log to.
JLinkLogFileNameFileName
Script File
The file path of the optional J-Link script file to use.
JLinkScriptFileNameFileName
Show Log Messages In Output Window
Display the J-Link log messages to the output window.
JLinkShowLogBoolean
Speed The required JTAG clock frequency in kHz (0 to auto-
speedIntegerRange detect best possible).
Supply Power
The J-Link supplies power to the target.
supplyPowerBoolean
Specifies the type of interface the target has. The
options are:
Target Interface Type
arm_target_interface_typeEnumeration JTAG - Use JTAG interface
SWD - Use SWD interface
cJTAG - Use cJTAG interface

Loader
Property Description
Additional Load File Address[0]
The address to load the additional load file.
debug_additional_load_file_addressString
Additional Load File Address[1]
The address to load the additional load file.
debug_additional_load_file_address1String
Additional Load File Address[2]
The address to load the additional load file.
debug_additional_load_file_address2String
Additional Load File Address[3]
The address to load the additional load file.
debug_additional_load_file_address3String
Additional Load File Type[0] The file type of the additional load file. The options are
debug_additional_load_file_typeEnumeration Detect, elf, bin, ihex, hex, tihex, srec.
Additional Load File Type[1] The file type of the additional load file. The options are
debug_additional_load_file_type1Enumeration Detect, elf, bin, ihex, hex, tihex, srec.
Additional Load File Type[2] The file type of the additional load file. The options are
debug_additional_load_file_type2Enumeration Detect, elf, bin, ihex, hex, tihex, srec.

422
Embedded Studio for ARM Reference Manual Appendices

Additional Load File Type[3] The file type of the additional load file. The options are
debug_additional_load_file_type3Enumeration Detect, elf, bin, ihex, hex, tihex, srec.
Additional Load File[0] Additional file to load on debug load. This property will
debug_additional_load_fileProjFileName have macro expansion applied to it.
Additional Load File[1] Additional file to load on debug load. This property will
debug_additional_load_file1ProjFileName have macro expansion applied to it.
Additional Load File[2] Additional file to load on debug load. This property will
debug_additional_load_file2ProjFileName have macro expansion applied to it.
Additional Load File[3] Additional file to load on debug load. This property will
debug_additional_load_file3ProjFileName have macro expansion applied to it.
Check Load Sections Fit Target Description Specifies whether load sections in the program match
target_check_load_sections_fitBoolean the memory segments described in the memory map.
Load ELF Sections The debugger will load ELF sections rather than ELF
debug_load_sectionsEnumeration programs.
The name of the main load file. This property will have
Load File
macro expansion applied to it. If it is not defined then
external_build_file_nameProjFileName
the output filepath of the linker command is used.
Load File Address
The address to download the main load file to.
external_load_addressString
Load File Type The file type of the main load file. The options are
external_load_file_typeEnumeration Detect, elf, bin, ihex, hex, tihex, srec.
No Load Sections
Names of (loadable) sections not to load.
target_loader_no_load_sectionsStringList

Simulator
Property Description
Specifies the dll that simulates the memory system.
Memory Simulation File This property will have macro expansion applied to it.
If not specified then the default memory simulation
arm_simulator_memory_simulation_filenameProjFileName
will be used.
Parameter passed to the memory simulation. This
property will have macro expansion applied to it.The
format of this is specific to the memory simulation.
Memory Simulation Parameter
The default memory simulation takes a list of RX|RWX
arm_simulator_memory_simulation_parameterString
'hex start address', 'hex size in bytes', 'default hex
word value' for example RX 00000000, 10000000,
FFFFFFFF;RWX 10000000, 10000000, CDCDCDCD.
Macros to apply to the parameter passed to the
Memory Simulation Parameter Macros memory simulation on creation. If null then the macro
MemorySegments is set to the value of the address
arm_simulator_memory_simulation_parameter_macrosStringList
ranges specified by the project.

423
Embedded Studio for ARM Reference Manual Appendices

Stop On Branch .
Stop when the simulator executes a b . instruction.
arm_simulator_stop_on_branch_dotBoolean
Stop On Memory Error Specifies the simulator behaviour when a memory
arm_simulator_stop_on_read_writeEnumeration error occurs.
Trace Buffer Size
The number of trace entries to store.
arm_simulator_num_trace_entriesInteger

Target Script
Property Description
Attach Script The script that is executed when the target is attached
target_attach_scriptJavaScript to.
Debug Begin Script The script that is executed when the debugger begins
target_debug_begin_scriptJavaScript a debug session.
Debug End Script The script that is executed when the debugger ends a
target_debug_end_scriptJavaScript debug session.
Load Begin Script The script that is executed when the debugger begins
target_load_begin_scriptJavaScript a load.
Load End Script The script that is executed when the debugger ends a
target_load_end_scriptJavaScript load.
Reset Script
The script that is executed when the target is reset.
target_reset_scriptJavaScript
The target script file, the contents of this file are
Target Script File
prepended to script project properties before they are
target_script_fileFileName
executed.

Target Trace
Property Description
ITM Stimulus Port To Display Specifies the ITM Stimulus port to display in the debug
terminal -1 disables this
arm_target_itm_stimulus_port_displayIntegerRange
ITM Stimulus Ports Enable
Specifies the ITM Stimulus ports to enable.
arm_target_itm_stimulus_port_enableIntegerHex
Specifies ITM timestamping. The options are:
ITM Timestamping
arm_target_itm_timestamping_enableEnumeration Disable - disable timestamping
Local - use the local timestamp clock
ITM/DWT PC Sampling
Specifies the DWT PC sampling rate.
arm_target_dwt_PC_sampling_enableEnumeration
ITM/DWT Trace Exceptions
Specifies whether to trace exception entry and return.
arm_target_dwt_trace_exceptionsBoolean

424
Embedded Studio for ARM Reference Manual Appendices

MTB RAM Address Specifies the MTB RAM Address - note that this must
arm_target_mtb_ram_addressIntegerHex be aligned to the MTB RAM size.
MTB RAM Size
Specifies the MTB RAM size in bytes.
arm_target_mtb_ram_sizeEnumeration
SWO Baud Rate Specifies the baud rate of the SWO - zero selects auto
arm_target_trace_SWO_speedIntegerRange detection.
The speed of the trace clock. This is usually the same as
Trace Clock Speed
the CPU clock and is used to program the prescaler for
arm_target_trace_clock_speedIntegerRange
the SWO
Specifies the type of trace interface the target has. The
options are:

SWO - Use asynchronous SWO trace interface.


Trace Interface Type TracePort - Use synchronous parallel trace
arm_target_trace_interface_typeEnumeration interface.
ETB - Use on-chip embedded trace buffer.
MTB - Use on-chip MTB - Cortex-M0+ only.
None
Specifies the trace port size the target has. The options
are:
Trace Port Size
arm_target_trace_port_sizeEnumeration 1-bit
2-bit
4-bit

425
Embedded Studio for ARM Reference Manual Appendices

System Macros

System Macro Values


Property Description
$(Date)
Day Month Year e.g. 21 June 2011.
$(Date)String
$(DateDay)
Day e.g. 21.
$(DateDay)String
$(DateMonth)
Month e.g. 01 to 12.
$(DateMonth)String
$(DateYear)
Year e.g. 2011.
$(DateYear)String
$(DesktopDir)
Path to users desktop directory.
$(DesktopDir)String
$(DocumentsDir)
Path to users documents directory.
$(DocumentsDir)String
$(EmbeddedStudioVersionNumber)
The release version number.
$(EmbeddedStudioVersionNumber)String
$(HomeDir)
Path to users home directory.
$(HomeDir)String
$(HostArch) The CPU architecture that SEGGER Embedded Studio is
$(HostArch)String running on e.g. x86.
$(HostArchClass) The class of CPU architecture that SEGGER Embedded
$(HostArchClass)String Studio is running on e.g. intel, arm.
$(HostDLL) The file extension for dynamic link libraries on the CPU
$(HostDLL)String that SEGGER Embedded Studio is running on e.g. .dll.
The file extension for dynamic link libraries used by the
$(HostDLLExt)
operating system that SEGGER Embedded Studio is
$(HostDLLExt)String
running on e.g. .dll, .so, .dylib.
$(HostEXE) The file extension for executables on the CPU that
$(HostEXE)String SEGGER Embedded Studio is running on e.g. .exe.
$(HostOS) The name of the operating system that SEGGER
$(HostOS)String Embedded Studio is running on e.g. win.
$(JLinkDir)
Path to J-Link software.
$(JLinkDir)String
$(Micro)
The SEGGER Embedded Studio target e.g. ARM.
$(Micro)String
$(PackagesDir)
Path to the users packages directory.
$(PackagesDir)String

426
Embedded Studio for ARM Reference Manual Appendices

$(Platform)
The target platform.
$(Platform)String
$(ProductNameShort)
The product name.
$(ProductNameShort)String
$(StudioArchiveFileExt)
The filename extension of a studio archive file.
$(StudioArchiveFileExt)String
$(StudioBuildToolExeName)
The filename of the build tool executable.
$(StudioBuildToolExeName)String
$(StudioBuildToolName)
The name of the build tool executable.
$(StudioBuildToolName)String
$(StudioDir)
The install directory of the product.
$(StudioDir)String
$(StudioExeName)
The filename of the studio executable.
$(StudioExeName)String
$(StudioLicenseToolExeName)
The filename of the license tool executable.
$(StudioLicenseToolExeName)String
$(StudioLicenseToolName)
The name of the license tool executable.
$(StudioLicenseToolName)String
$(StudioMajorVersion)
The major release version of software.
$(StudioMajorVersion)String
$(StudioMinorVersion)
The minor release version of software.
$(StudioMinorVersion)String
$(StudioName)
The full name of studio.
$(StudioName)String
$(StudioNameShort)
The short name of studio.
$(StudioNameShort)String
$(StudioPackageFileExt)
The filename extension of a studio package file.
$(StudioPackageFileExt)String
$(StudioProjectFileExt)
The filename extension of a studio project file.
$(StudioProjectFileExt)String
$(StudioScriptToolExeName)
The filename of the script tool executable.
$(StudioScriptToolExeName)String
$(StudioScriptToolName)
The name of the script tool executable.
$(StudioScriptToolName)String
$(StudioSessionFileExt)
The filename extension of a studio session file.
$(StudioSessionFileExt)String
$(StudioSimulatorExeName)
The filename of the simulator executable.
$(StudioSimulatorExeName)String
$(StudioSimulatorName)
The name of the simulator executable.
$(StudioSimulatorName)String

427
Embedded Studio for ARM Reference Manual Appendices

$(StudioUserDir)
The directory containing the user data.
$(StudioUserDir)String
$(TargetID) ID number representing the SEGGER Embedded Studio
$(TargetID)String target.
$(Time)
Hour:Minutes:Seconds e.g. 15:34:03.
$(Time)String
$(TimeHour)
Hour e.g. 15.
$(TimeHour)String
$(TimeMinute)
Minute e.g. 34.
$(TimeMinute)String
$(TimeSecond)
Seconds e.g. 03.
$(TimeSecond)String
$(UnixTime)
Seconds since 00:00, Jan 1 1970 UTC
$(UnixTime)String

428
Embedded Studio for ARM Reference Manual Appendices

Build Macros

(Build Macro Values)


Property Description
$(AR)
The path to the binutils ar command.
$(AR)String
$(AS)
The path to the binutils as command.
$(AS)String
$(Arch) The lower case value of the ARM Architecture project
$(Arch)String property.
$(AsmOptions) A space seperated list of assembler options for the
$(AsmOptions)String external assemble command.
$(CC1)
The path to the gcc cc1 command.
$(CC1)String
$(CLANG)
The path to the clang command.
$(CLANG)String
$(CLANGTIDY)
The path to the clang-tidy command.
$(CLANGTIDY)String
$(COnlyOptions) A space seperated list of compiler options for the
$(COnlyOptions)String external c compile command.
$(COptions) A space seperated list of compiler options for the
$(COptions)String external c and c++ compile commands.
$(CombiningOutputFilePath) The full path of the output file of the combining
$(CombiningOutputFilePath)String command.
$(CombiningRelInputPaths)
The relative inputs to the combining command.
$(CombiningRelInputPaths)String
$(Configuration)
The build configuration e.g. ARM Flash Debug.
$(Configuration)String
$(CoreType) The lower case value of the ARM Core Type project
$(CoreType)String property.
$(Defines) The preprocessor defines property value for the
$(Defines)String external compile command.
$(DependencyPath) The path of the dependency file for the external
$(DependencyPath)String compile command.
$(EXE) The default file extension for an executable file
$(EXE)String including the dot e.g. .elf.
$(Endian) The lower case value of the Byte Order project
$(Endian)String property.

429
Embedded Studio for ARM Reference Manual Appendices

$(FPABI)
The value of the ARM FP ABI Type project property.
$(FPABI)String
$(FPU) The lower case value of the ARM FPU Type project
$(FPU)String property.
$(FPU2) Alternative value of the ARM FPU Type project
$(FPU2)String property.
$(FPU3) Alternative value of the ARM FPU Type project
$(FPU3)String property.
$(FolderName)
The folder name of the containing folder.
$(FolderName)String
$(FolderPath)
The folder path of the containing folders.
$(FolderPath)String
$(GCC)
The path to the gcc command.
$(GCC)String
$(GCCPrefix) The macro-expanded value of the GCC Prefix project
$(GCCPrefix)String property.
$(GCCTarget) The macro-expanded value of the GCC Target project
$(GCCTarget)String property.
$(GPLUSPLUS)
The path to the g++ command.
$(GPLUSPLUS)String
$(Includes) The user includes property value for the external
$(Includes)String compile command.
$(InputDir)
The absolute directory of the input file.
$(InputDir)String
$(InputExt) The extension of an input file not including the dot e.g
$(InputExt)String cpp.
$(InputFileName) The name of an input file relative to the project
$(InputFileName)String directory.
$(InputName) The name of an input file relative to the project
$(InputName)String directory without the extension.
$(InputPath) The absolute name of an input file including the
$(InputPath)String extension.
$(IntDir) The macro-expanded value of the Intermediate
$(IntDir)String Directory project property.
$(LD)
The path to the binutils ld command.
$(LD)String
$(LIB) The default file extension for a library file including the
$(LIB)String dot e.g. .lib.
$(LIBLTO)
The path to the LTO dll.
$(LIBLTO)String

430
Embedded Studio for ARM Reference Manual Appendices

$(LTO1)
The path to the gcc lto1 command.
$(LTO1)String
$(LibArch)
The library architecture.
$(LibArch)String
$(LibEndianExt)
The endian specific library extension.
$(LibEndianExt)String
$(LibExt)
The architecture and build specific library extension.
$(LibExt)String
$(LinkOptions) A space seperated list of compiler options for the
$(LinkOptions)String external link command.
$(LinkerScriptPath) The full path of the linker script file for the link
$(LinkerScriptPath)String command.
$(MapPath) The full path of the map file of the external link
$(MapPath)String command.
$(MemorySegments) The value of the Memory Segments property supplied
$(MemorySegments)String to pre/post link command.
$(OBJ) The default file extension for an object file including
$(OBJ)String the dot e.g. .o.
$(OBJCOPY)
The path to the binutils objcopy command.
$(OBJCOPY)String
$(OBJDUMP)
The path to the binutils objdump command.
$(OBJDUMP)String
$(Objects) A space seperated list of files for the external archive or
$(Objects)String link command.
$(ObjectsFilePath) The full path containing the files for the external
$(ObjectsFilePath)String archive or link command.
$(OutDir) The macro-expanded value of the Output Directory
$(OutDir)String project property.
$(PackageExt)
The file extension of a package file e.g. emPackage.
$(PackageExt)String
$(PostLinkOutputFilePath) The full path of the output file of the post link
$(PostLinkOutputFilePath)String command.
The absolute value of the Project Directory project
$(ProjectDir)
property of the current proje ct. If this isn't set then the
$(ProjectDir)String
directory containing the solution file.
$(ProjectName)
The project name of the current project.
$(ProjectName)String
$(ProjectNodeName)
The name of the selected project node.
$(ProjectNodeName)String
$(RANLIB)
The path to the binutils ranlib command.
$(RANLIB)String

431
Embedded Studio for ARM Reference Manual Appendices

$(RelDependencyPath) The relative path of the dependency file for the


$(RelDependencyPath)String external compile command.
$(RelInputDir) The relative path to the directory containing the input
$(RelInputDir)String file from the project directory or dot if not relative.
$(RelInputPath) The relative path to the input file from the project
$(RelInputPath)String directory or the full path if not relative.
$(RelLinkerScriptPath) The relative path of the linker script file for the link
$(RelLinkerScriptPath)String command.
$(RelMapPath) The relative path of the map file of the external link
$(RelMapPath)String command.
$(RelObjectsFilePath) The relative path containing the files for the external
$(RelObjectsFilePath)String archive or link command.
$(RelTargetPath) The project directory relative path of the output file of
$(RelTargetPath)String the link or compile command.
$(RootOutDir) The macro-expanded value of the Root Output
$(RootOutDir)String Directory project property.
The relative path to get from the path specified by
$(RootRelativeOutDir) the Output Directory project property to the path
$(RootRelativeOutDir)String specified by the Root Output Directory project
property.
$(SASM)
The path to the SEGGER assembler.
$(SASM)String
$(SCC)
The path to the SEGGER compiler.
$(SCC)String
$(SLINK)
The path to the SEGGER linker.
$(SLINK)String
$(STRIP)
The path to the binutils strip command.
$(STRIP)String
$(SolutionDir) The absolute path of the directory containing the
$(SolutionDir)String solution file.
$(SolutionExt)
The extension of the solution file without the dot.
$(SolutionExt)String
$(SolutionFileName)
The filename of the solution file.
$(SolutionFileName)String
$(SolutionName)
The basename of the solution file.
$(SolutionName)String
$(SolutionPath)
The absolute path of the solution file.
$(SolutionPath)String
$(StageOutputFilePath)
The full path of the output file of the stage command.
$(StageOutputFilePath)String

432
Embedded Studio for ARM Reference Manual Appendices

$(TargetPath) The full path of the output file of the link or compile
$(TargetPath)String command.
$(ToolChainDir) The macro-expanded value of the Tool Chain
$(ToolChainDir)String Directory project property.
$(Undefines) The preprocessor undefines property value for the
$(Undefines)String external compile command.

433
Embedded Studio for ARM Reference Manual Appendices

BinaryFile
The following table lists the BinaryFile object's member functions.

BinaryFile.crc32(offset, length) returns the CRC-32 checksum of an address range length bytes long, starting
at offset. This function computes a CRC-32 checksum on a block of data using the standard CRC-32 polynomial
(0x04C11DB7) with an initial value of 0xFFFFFFFF. Note that this implementation doesn't reflect the input or the
output and the result is inverted.
BinaryFile.length() returns the length of the binary file in bytes.
BinaryFile.load(path) loads binary file from path.
BinaryFile.loadAppend(path) loads binary file from path and appends it to the binary image.
BinaryFile.peekBytes(offset, length) returns byte array containing length bytes peeked from offset.
BinaryFile.peekUint32(offset, littleEndian) returns a 32-bit word peeked from offset. The littleEndian argument
specifies the endianness of the access, if true or undefined it will be little endian, otherwise it will be big endian.
BinaryFile.pokeBytes(offset, byteArray) poke byte array byteArray to offset.
BinaryFile.pokeUint32(offset, value, littleEndian) poke a value to 32-bit word located at offset. The littleEndian
argument specifies the endianness of the access, if true or undefined it will be little endian, otherwise it will be
big endian.
BinaryFile.resize(length, fill) resizes the binary image to length bytes. If the operation extends the size, the
binary image will be padded with bytes of value fill.
BinaryFile.save(path) saves binary file to path.
BinaryFile.saveRange(path, offset, length) saves part of the binary file to path. The offset argument specifies
the byte offset to start from. The length argument specifies the maximum number of bytes that should be
saved.

434
Embedded Studio for ARM Reference Manual Appendices

CWSys
The following table lists the CWSys object's member functions.

CWSys.appendStringToFile(path, string) appends string to the end of the file path.


CWSys.copyFile(srcPath, destPath) copies file srcPath to destPath.
CWSys.crc32(array) returns the CRC-32 checksum of the byte array array. This function computes a CRC-32
checksum on a block of data using the standard CRC-32 polynomial (0x04C11DB7) with an initial value of
0xFFFFFFFF. Note that this implementation doesn't reflect the input or the output and the result is inverted.
CWSys.fileExists(path) returns true if file path exists.
CWSys.fileSize(path) return the number of bytes in file path.
CWSys.getRunStderr() returns the stderr output from the last CWSys.run() call.
CWSys.getRunStdout() returns the stdout output from the last CWSys.run() call.
CWSys.makeDirectory(path) create the directory path.
CWSys.packU32(array, offset, number, le) packs number into the array at offset.
CWSys.popup(text, caption) prompt the user with text and return true for yes and false for no.
CWSys.readByteArrayFromFile(path) returns the byte array contained in the file path.
CWSys.readStringFromFile(path) returns the string contained in the file path.
CWSys.removeDirectory(path) remove the directory path.
CWSys.removeFile(path) deletes file path.
CWSys.renameFile(oldPath, newPath) renames file oldPath to be newPath.
CWSys.run(cmd, wait) runs command line cmd optionally waits for it to complete if wait is true.
CWSys.unpackU32(array, offset, le) returns the number unpacked from the array at offset.
CWSys.writeByteArrayToFile(path, array) creates a file path containing the byte array array.
CWSys.writeStringToFile(path, string) creates a file path containing string.

435
Embedded Studio for ARM Reference Manual Appendices

Debug
The following table lists the Debug object's member functions.

Debug.evaluate(expression) evaluates debug expression and returns it as a JavaScript value.


Debug.getfunction(address) return function name containing address.

436
Embedded Studio for ARM Reference Manual Appendices

ElfFile
The following table lists the ElfFile object's member functions.

ElfFile.crc32(address, length, virtualNotPhysical, padding, programNotSection) returns the CRC-32


checksum of an address range length bytes long, located at address. If virtualNotPhysical is true or undefined,
address is a virtual address otherwise it is a physical address. If padding is defined, it specifies the byte value
used to fill gaps in the program. If programNotSection is true or undefined, data is read using program headers
rather than section headers. This function computes a CRC-32 checksum on a block of data using the standard
CRC-32 polynomial (0x04C11DB7) with an initial value of 0xFFFFFFFF. Note that this implementation doesn't
reflect the input or the output and the result is inverted.
ElfFile.findProgram(address) returns an object with start, the data and the size to allocate of the Elf program
that contains address.
ElfFile.getEntryPoint() returns the entry point in the ELF file.
ElfFile.getSection(name) returns an object with start and the data of the Elf section corresponding to the
name.
ElfFile.isLittleEndian() returns true if the Elf file has numbers encoded as little endian.
ElfFile.load(path) loads Elf file from path.
ElfFile.peekBytes(address, length, virtualNotPhysical, padding, programNotSection) returns byte array
containing length bytes peeked from address. If virtualNotPhysical is true or undefined, address is a virtual
address otherwise it is a physical address. If padding is defined, it specifies the byte value used to fill gaps in
the program. If programNotSection is true or undefined, data is read using program headers rather than section
headers.
ElfFile.peekUint32(address, virtualNotPhysical) returns a 32-bit word peeked from address. If
virtualNotPhysical is true or undefined, address is a virtual address otherwise it is a physical address.
ElfFile.pokeBytes(address, byteArray, virtualNotPhysical) poke byte array byteArray to address. If
virtualNotPhysical is true or undefined, address is a virtual address otherwise it is a physical address.
ElfFile.pokeUint32(address, value, virtualNotPhysical) poke a value to 32-bit word located at address. If
virtualNotPhysical is true or undefined, address is a virtual address otherwise it is a physical address.
ElfFile.save(path) saves Elf file to path.
ElfFile.symbolValue(symbol) returns the value of symbol in Elf file.

437
Embedded Studio for ARM Reference Manual Appendices

TargetInterface
The following table lists the TargetInterface object's member functions.

TargetInterface.crc32(address, length) reads a block of bytes from target memory starting at address for
length bytes, generates a crc32 on the block of bytes and returns it.
TargetInterface.delay(ms) waits for ms milliseconds
TargetInterface.error(message) terminates execution of the script and outputs a target interface error
message to the target log.
TargetInterface.executeFunction(address, parameter, timeout) calls a function at address with the parameter
and returns the function result. The timeout is in milliseconds.
TargetInterface.expandMacro(string) returns the string with macros expanded.
TargetInterface.findByte(address, length, byte) returns the index of the byte in the specified target memory
range.
TargetInterface.findNotByte(address, length, byte) returns the index of the byte that isn't in the specified
target memory range.
TargetInterface.getProjectProperty(savename) returns the value of the savename project property.
TargetInterface.getTargetProperty(savename) returns the value of the savename target property.
TargetInterface.go() allows the target to run.
TargetInterface.isStopped() returns true if the target is stopped.
TargetInterface.message(message) outputs a target interface message to the target log.
TargetInterface.peekBinary(address, length, filename) reads a block of bytes from target memory starting at
address for length bytes and writes them to filename.
TargetInterface.peekByte(address) reads a byte of target memory from address and returns it.
TargetInterface.peekBytes(address, length) reads a block of bytes from target memory starting at address for
length bytes and returns the result as an array containing the bytes read.
TargetInterface.peekMultUint16(address, length) reads length unsigned 16-bit integers from target memory
starting at address and returns them as an array.
TargetInterface.peekMultUint32(address, length) reads length unsigned 32-bit integers from target memory
starting at address and returns them as an array.
TargetInterface.peekUint16(address) reads a 16-bit unsigned integer from target memory from address and
returns it.
TargetInterface.peekUint32(address) reads a 32-bit unsigned integer from target memory from address and
returns it.
TargetInterface.peekWord(address) reads a word as an unsigned integer from target memory from address
and returns it.
TargetInterface.pokeBinary(address, filename) reads a block of bytes from filename and writes them to target
memory starting at address.
TargetInterface.pokeByte(address, data) writes the byte data to address in target memory.

438
Embedded Studio for ARM Reference Manual Appendices

TargetInterface.pokeBytes(address, data) writes the array data containing 8-bit data to target memory at
address.
TargetInterface.pokeMultUint16(address, data) writes the array data containing 16-bit data to target memory
at address.
TargetInterface.pokeMultUint32(address, data) writes the array data containing 32-bit data to target memory
at address.
TargetInterface.pokeUint16(address, data) writes data as a 16-bit value to address in target memory.
TargetInterface.pokeUint32(address, data) writes data as a 32-bit value to address in target memory.
TargetInterface.pokeWord(address, data) writes data as a word value to address in target memory.
TargetInterface.readBinary(filename) reads a block of bytes from filename and returns them in an array.
TargetInterface.reset() resets the target.
TargetInterface.resetAndStop() resets and stops the target.
TargetInterface.runFromAddress(address, timeout) start the target executing at address and waits for a
breakpoint to be hit. The timeout is in milliseconds.
TargetInterface.runFromToAddress(from, to, timeout) start the target executing at address from and waits for
the breakpoint to be hit. The timeout is in milliseconds.
TargetInterface.runToAddress(address, timeout) sets a breakpoint at address, starts the target executing and
waits for the breakpoint to be hit. The timeout is in milliseconds.
TargetInterface.setTargetProperty(savename) set the value of the savename target property.
TargetInterface.stop() stops the target.
TargetInterface.writeBinary(array, filename) write the bytes in array to filename.

439
Embedded Studio for ARM Reference Manual Appendices

WScript
The following table lists the WScript object's member functions.

WScript.Echo(s) echos string s to the output terminal.

440

You might also like