Atmel CAVR-4 Manual De Usuario
![Atmel](https://files.manualsbrain.com/attachments/0369829915bda09f9c2e00fb805a7753579683b5/common/fit/150/50/8d2bf08978ec3e5bc63f4343ac5e91ce8d0e40045619fa520d910d64af8f/brand_logo.png)
CAVR-4
Part 1. Using the compiler
Placing code and data
37
Note: Copy initialization segments—
BASENAME_I
and
BASENAME_ID
—must be
placed using -Z.
Data segments
This section contains descriptions of the segments used for storing the different types of
data—static, stack, heap, and located. In moste cases these segments are located in the
data memory space. However, some of the segments are located in the code memory
space.
data—static, stack, heap, and located. In moste cases these segments are located in the
data memory space. However, some of the segments are located in the code memory
space.
To get a clear understanding about how the data segments work, you must be familiar
with the different memory types and the different memory models available in the
with the different memory types and the different memory models available in the
AVR
IAR C/C++ Compiler
. If you need to refresh these details, see the chapter Data storage.
STATIC MEMORY SEGMENTS
Static memory is memory that contains variables that are global or declared static, as
described in the chapter Data storage. Declared static variables can be divided into the
following categories:
described in the chapter Data storage. Declared static variables can be divided into the
following categories:
●
Variables that are initialized to a non-zero value
●
Variables that are initialized to zero
●
Variables that are located by use of the
@
operator or the
#pragma location
directive
●
Variables that are declared as
const
and therefore can be stored in external ROM
●
Variables defined with the
_ _no_init
keyword, meaning that they should not be
initialized at all.
For the static memory segments it is important to be familiar with:
●
The segment naming
●
How the memory types correspond to segment groups and the segments that are part
of the segment groups
of the segment groups
●
Restrictions for segments holding initialized data
●
The placement and size limitation of the segments of each group of static memory
segments.
segments.
Segment naming
All static data segment names consist of two parts—the segment base name and a
suffix—for instance,
suffix—for instance,
NEAR_Z
. The segment base names are derived from the memory
type attributes, for example the attribute:
_ _near