7.2 Arm® Compiler and Toolchain Options: GUI

To get help with Arm GCC Toolchain, you can do the following:

  • For general information about GCC, visit the official GNU GCC website
  • Alternatively, you can write arm-none-eabi-gcc --help and see the explanation of some of the parameters in the command output

This section illustrates the GUI options available for the Arm GNU Toolchain in Microchip Studio.

Figure 7-1. Arm® GNU Toolchain Properties
Table 7-1. Arm® GNU Common Options
OptionDescription

Thumb(-mthumb)/Arm(-marm)

Switch between Arm and Thumb processor mode

Table 7-2. Arm® GNU C Compiler Options
OptionDescription

Preprocessor Options

-nostdinc

Do not search system include directories

-E

Preprocess only; Do not compile, Assemble, or link

Symbols Options

One can define (-D) or undefine (-U) several in-source symbols. New symbol declarations can be added, modified, or reordered, using the interface buttons below:

  • Add a new symbol. This icon and all the following icons are reused with the same meaning in other parts of the Microchip Studio interface.

  • Remove a symbol.

  • Edit symbol.

  • Move the symbol up in the parsing order.

  • Move the symbol down in the parsing order.

Include Directories

Default Include Path

Enabling this option will add the include path that is specific to the selected SAM device

Contains all the included header and definition directories, can be modified using the same interface as symbols

Optimization Options

Optimization level (drop-down menu): -O0, -O1, -O2, -O3, -Os

No optimization, optimize for speed (level 1 - 3), optimize for size

Other optimization flags (manual input form)

Here you should write optimization flags specific to the platform and your requirements

-ffunction-sections

Place each function into its own section

-funsafe-math-optimizations

Enable unsafe match optimizations

-ffast-math

Enable fast math

-fpic

Generate position-independent code

Debug Options

Debug level (drop-down menu): none, -g1, -g2, -g3

Specifies the level of tracing and debugging code and headers left or inserted in the source code

Other debug options (form field)

Architecture-specific debug options

-pg

Generate gprof information

-p

Generate prof information

Warning Messages Output Options

-Wall

All warnings

-Werror

Treat all warnings as errors

-fsyntax-only

Check syntax only

-pedantic

Check conformity to GNU, raise warnings on non-standard programming practice

-pedantic-errors

Same as above, plus escalate warnings to errors

-w

Inhibits all warnings

Miscellaneous Options

Other flags (form field)

Input other project-specific flags

-v

Verbose (Display the programs invoked by the compiler)

-ansi

Support ANSI programs

-save-temps

Do not delete intermediate files

OptionDescription
Table 7-3. Arm® GCC Linker Options
OptionDescription

-Wl -nostartfiles

Do not use standard files

-Wl -nodefault

Do not use default libraries

-Wl -nostdlib

No start-up or default libraries

-Wl -s

Omit all symbol information

-Wl -static

Link statically

-Map

Generates Map file

Libraries Options

Libraries -Wl, -l (form field)

You can add, prioritize, or edit library names here, using those buttons:

,
,
,
,

Library search path -Wl, -L (form field)

You can add, prioritize, or edit the path where the linker will search for dynamically linked libraries. Same interface as above.

Optimization Options

-Wl, -gc-sections

Garbage collect unused sections

-funsafe-math-optimizations

Enable unsafe math optimizations

-ffast-math

Enable fast math

-fpic

Generate position independent code

Miscellaneous Options

Other linker flags (form field)

Input other project-specific flags

OptionDescription

Linker Scripts

  • In 'linker->miscellaneous->linker flags' ($LinkerScript_FLASH) is added by default. During Build, it will be replaced by the appropriate (device_name)_flashld file. Similarly, ($LinkerScript_SRAM) will be replaced with the appropriate (device_name)_sram.ld file.
  • You can always override the default Flash linker scripts by replacing ($LinkerScript_FLASH) or ($LinkerScript_SRAM) with your custom linker script option -T'custom_linker_script.ld'
Note: These device-specific linker scripts will be available in the 'ProjectFolder/Linkerscripts' directory. In case of changing the device after project creation, Microchip Studio will automatically add the correct linker scripts for the selected device.

Arm® Assembler Options

Table 7-4. Arm® Assembler Options
OptionDescription

Optimization Options

Assembler flags (form field)

Miscellaneous assembler flags

Include path (form field)

You can add, prioritize, or edit the path to the architecture and platform-specific included files here

-v

Announce version in the assembler output

-W

Suppress Warnings

Debugging Options

Debugging level (drop-down menu) None, (-g).

Enable debugging symbols and debugging source insertion

OptionDescription

Arm® Preprocessing Assembler Options

Table 7-5. Arm® Preprocessing Assembler Options
OptionDescription

Optimization Options

Assembler flags (form field)

Miscellaneous assembler flags

Include path (form field)

You can add, prioritize, or edit the path to the architecture and platform-specific included files here

-v

Announce version in the assembler output

-W

Suppress Warnings

Debugging Options

Debugging level (drop-down menu) None, -Wa -g.

Enables debugging symbols and debugging source insertion

OptionDescription