User guide

6.5 Loading the ROM image at address 0
Scatter loading provides a flexible mechanism for mapping code and data onto your memory map. These options are
described in detail in the Linker and Utilities Guide.
The scatter-load description file, scat_b.scf, for this example is in
install_directory\Examples\Embedded\embed.
6.5.1 Memory map
Figure 6-4 shows:
ROM is fixed at 0x0 and is not remapped
RAM is at 0x28000000 to hold the data, stack and heap
memory-mapped I/O for a UART is at 0x16000000.
Figure 6-4 Memory map for simple scatter loading
6.5.2 Scatter-load description file
The scatter-load description file shown in Example 6-2 defines:
one load region, ROM_LOAD, at 0x0
five execution regions:
ROM_EXEC (at 0x0) contains all the read-only code, including the library code. The exception vector table
in vectors.o is placed first in this region. All other read-only code (*) is placed after vectors.o.
RAM (at 0x28000000) contains the RW and ZI data regions for the application.
HEAP immediately above the ZI data. The object heap.o contains a symbol that is used to set up the
heap base. The heap grows up from this address.
STACKS at 0x28080000. The object stack.o contains a symbol that is used to set up the stack top.
Stacks grow downward from this address.
UART0 at 0x16000000. The object uart.o contains symbols that are used to reserve the
memory-mapped I/O.
Note
The UNINIT entry means that the marked regions are not zero-initialized by the C library initialization code.
Example 6-2 scat_b.scf
ROM_LOAD 0x0
{
ROM_EXEC 0x0
{
Writing Code for ROM
Copyright ?1999 2001 ARM Limited 6-8