You can use the
FIXED attribute in an execution
region scatter file to create root regions that load and execute
at fixed addresses.
FIXED is used to create multiple root regions
within a single load region and therefore typically a single ROM
device. For example, you can use this to place a function or a block
of data, such as a constant table or a checksum, at a fixed address
in ROM so that it can be accessed easily through pointers.
If you specify, for example, that some initialization code
is to be placed at start of ROM and a checksum at the end of ROM,
some of the memory contents might be unused. Use the
selector to flood fill the region between the end of the initialization
block and the start of the data block.
To make your code easier to maintain and debug, it is suggested that you use the minimum amount of placement specifications in scatter files and leave the detailed placement of functions and data to the linker.
You cannot specify component objects that have been partially
linked. For example, if you partially link the objects
obj3.o together to produce
the component object names are discarded in the resulting object.
Therefore, you cannot refer to one of the objects by name, for example,
You can refer only to the combined object
There are some situations where using
a single load region are not appropriate. Other techniques for specifying
fixed locations are:
If your loader can handle multiple load regions, place the RO code or data in its own load region.
If you do not require the function or data to be at a fixed location in ROM, use
FIXED. The loader then copies the data from the load region to the specified address in RAM.
ABSOLUTEis the default attribute.
To place a data structure at the location of memory-mapped I/O, use two load regions and specify
UNINITensures that the memory locations are not initialized to zero.