Creating a Linker Command File
2 - 14 C2000 Microcontroller Workshop - Programming Development Environment
in volatile memory, such as RAM. These memories can be modified and updated, supporting the
way variables are used in math formulas, high-level languages, etc. Each variable must be
declared with a directive to reserve memory to contain its value. By their nature, no value is
assigned, instead they are loaded at runtime by the program.
Next, we need to place the sections that were created by the compiler into the appropriate
memory spaces. The uninitialized sections, .ebss and .stack, need to be placed into RAM; while
the initialized sections, .cinit, and .txt, need to be placed into flash.
Placing Sections in Memory
.ebss
.cinit
.text
Memory
M0SARAM
(0x400)
0x00 0000
0x3E 8000
0x00 0400
M1SARAM
(0x400)
FLASH
(0x10000)
Sections
.stack
Linking code is a three step process:
1. Defining the various regions of memory (on-chip SARAM vs. FLASH vs. External Memory).
2. Describing what sections go into which memory regions
3. Running the linker with “build” or “rebuild”