10.8.2. Scatter load description file

The scatter load description file shown in Example 10.10 defines one load region (FLASH) and three execution regions:

On reset, an aliased copy of FLASH is re-mapped (by hardware) to address zero. Following reset, SRAM is mapped to address zero, by the first few instructions in boot.o.

The SSRAM area might be fast on-chip (internal) 32-bit RAM, and is typically used for the stack, and code that must be executed quickly. The exception vectors (in vectors.o) and interrupt handler (in C_int_handler.o) are relocated (copied) from FLASH to (fast) SSRAM at address 0x0000 for speed.

SRAM might be slower off-chip (external) 16-bit DRAM or SRAM, and is typically used for less frequently accessed RW variables and ZI data. Here, the RW variables and ZI data of the main program code (in C_main.c) get copied/initialized in SRAM at address 0x2000.

All other read-only code, (* (+RO)), for example region initialization and library code, is executed from FLASH, by using a wildcard in the description file.

Example 10.10.  scat.txt

FLASH 0x04000000 0x04000000
{
	FLASH 0x04000000
    {
		boot.o (Boot,+First)
		* (+RO)
	}
	SSRAM 0x0000
	{
		vectors.o (Vect,+FIRST)
		C_int_handler.o (+RO)
	}
	SRAM 0x2000
	{
		C_main.o (+RW,+ZI)
	}
}
Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D
Non-Confidential