The following regions are defined for ARM EABI.
Region | Contents |
---|---|
itcm | ITCM |
ram |
|
rom |
|
Note that not all regions are provided in every linker script or profile; see the documentation of the individual linker scripts in the section called “Supported Boards for ARM EABI”, above.
Regions documented as "Memory regions" correspond to
similarly-named program sections.
For example, the linker script assigns the .ram
section to the ram
region.
You can explicitly locate data or code in these sections using
section attributes in your source C or C++ code.
Section attributes are especially useful on code compiled for
boards that include special memory banks, such as a fast on-chip
cache memory, in addition to the default
ram
and/or rom
regions.
CS3 arranges for additional data-like sections to be initialized
in the same way as the default .data
section.
As an example to illustrate the attribute syntax, you can put a variable
v
in the .ram
section using:
int v __attribute__ ((section (".ram")));
To declare a function f
in this section, use:
int f (void) __attribute__ ((section (".ram"))) {...}
For more information about attribute syntax, see the GCC manual.
Regions documented as "Other regions" do not have a corresponding
program section. Typically, these regions correspond to
memory-mapped control and I/O registers that cannot be used for
general data or program storage. If you need to manipulate data in
these regions, you can use the CS3 memory layout facilities
declared in cs3.h
, as described in
the section called “Memory Layout”.
Memory maps for boards supported by Sourcery G++ Lite for ARM EABI
are documented in
XML files in the arm-none-eabi/lib/boards/
subdirectory of your Sourcery G++ installation directory.