Lab 12: Programming the Flash
C2000 Microcontroller Workshop - System Design 12 - 15
F2806x_Headers_nonBIOS.cmd
F2806x_GlobalVariableDefs.c
Note: The Flash.c and Passwords.asm files will be added during the lab exercise.
Link Initialized Sections to Flash
Initialized sections, such as code and constants, must contain valid values at device power-up.
Stand-alone operation of an F28069 embedded system means that no emulator is available to
initialize the device RAM. Therefore, all initialized sections must be linked to the on-chip flash
memory.
Each initialized section actually has two addresses associated with it. First, it has a LOAD
address which is the address to which it gets loaded at load time (or at flash programming time).
Second, it has a RUN address which is the address from which the section is accessed at runtime.
The linker assigns both addresses to the section. Most initialized sections can have the same
LOAD and RUN address in the flash. However, some initialized sections need to be loaded to
flash, but then run from RAM. This is required, for example, if the contents of the section needs
to be modified at runtime by the code.
2. Open and inspect the linker command file Lab_12.cmd. Notice that a memory block
named FLASH_ABCDEFGH has been been created at origin = 0x3D8000, length =
0x01FF80 on Page 0. This flash memory block length has been selected to avoid
conflicts with other required flash memory spaces. See the reference slide at the end of
this lab exercise for further details showing the address origins and lengths of the various
memory blocks used.
3. Edit Lab_12.cmd to link the following compiler sections to on-chip flash memory
block FLASH_ABCDEFGH:
Compiler Sections:
.text .cinit .const .econst .pinit .switch
4. In Lab_12.cmd notice that the section named “IQmath” is an initialized section that
needs to load to and run from flash. Previously the “IQmath” section was linked to
L4SARAM. Edit Lab_12.cmd so that this section is now linked to
FLASH_ABCDEFGH. Save your work and close the file.