Creating a Linker Command File
C2000 Microcontroller Workshop - Programming Development Environment 2 - 15
Linker Command Files (.cmd)
The linker concatenates each section from all input files, allocating memory to each section based
on its length and location as specified by the MEMORY and SECTIONS commands in the linker
command file. The linker command file describes the physical hardware memory and specifies
where the sections are placed in the memory. The file created during the link process is a .out
file. This is the file that will be loaded into the microcontroller. As an option, we can generate a
map file. This map file will provide a summary of the link process, such as the absolute address
and size of each section.
Linking
Linker
Link.cmd
.map
.obj
.out
Memory description
How to place s/w into h/w
Memory-Map Description
The MEMORY section describes the memory configuration of the target system to the linker.
The format is: Name: origin = 0x????, length = 0x????
For example, if you placed a 64Kw FLASH starting at memory location 0x3E8000, it would read:
MEMORY
{
FLASH: origin = 0x3E8000 , length = 0x010000
}
Each memory segment is defined using the above format. If you added M0SARAM and
M1SARAM, it would look like: