Default memory usage – Echelon Neuron C User Manual

Page 192

Advertising
background image

180 Memory

Management

compiler and linker to place specific objects in the offchip and onchip

RAMFAR areas, respectively.

There can be only one RAMNEAR area. It can be located on-chip (all

chips) or off-chip (Neuron 3150 Chip and FT 3150 Smart Transceiver
only). The linker automatically determines the location of the

RAMNEAR area. The RAMNEAR area is the default memory area for all
Neuron C variables. This area is limited to a total size of 256 bytes.

However, the maximum allowable size may be smaller under certain

circumstances depending on the amount of memory the user has
allocated for buffers. See

Compiler Directives for Buffer Allocation

on

page 193, and also see

Controlling Non-Default Memory Usage

on page

181.

Note that for Series 5000 chips, the Extended Memory region can be configured

for either extended RAM (for three RAM regions) or for non-volatile memory (for

the three EEPROM areas).

Default Memory Usage

If no special keywords are included in the declarations of variables or functions or

other pieces of a Neuron C program, the pieces of the program are located in

memory by the linker using the following rules.

All executable code objects (functions, when clauses, tasks) as well as string

constants and data declared as const are placed in the ROM or EECODE areas.

The linker places these objects wherever they fit. For the Neuron 3150 Chip or
FT 3150 Smart Transceiver, the linker first tries to put an object in the user area

of

off-chip

ROM. If the object does not fit in ROM, the linker attempts to put it in

the

off-chip

EECODE area of memory. Finally, the linker attempts to put the

object in the

on-chip

EECODE area of memory.

Data objects declared with any of the config, config_prop, cp, or eeprom keywords
are normally placed in the on-chip EENEAR area of memory. The linker

normally places all data objects without these keywords in the RAMNEAR area

of memory.

Data objects declared with the cp_family keyword (configuration property

families) create multiple items stored in memory. Each configuration property

family member instance creates a descriptor entry in the template file, and a
data value entry in either the writeable value file or the read-only value file. The

configuration template file is placed in either the ROM or EECODE area. The
writeable value file is placed in the EEFAR area of memory. The read-only value

file is placed in either the ROM or EECODE area of memory.
The NodeBuilder CodeWizard declares network variables so that they are placed
in RAMNEAR memory by default. However, because of the larger number of

network variables that are available for devices built with the NodeBuilder FX

Development Tool, your device could run out of available RAMNEAR memory. In
this case, declare as many network variables as necessary to use RAMFAR

memory.
You can modify the linker’s placement of variables and functions using the
special keywords described in the next section.

Advertising