
Lab 12: Programming the Flash
C2000 Microcontroller Workshop - System Design
12 - 15
Adc.c
F2806x_Headers_nonBIOS.cmd
Cla_12.c
Filter.c
ClaTasks.asm
Flash.c
ClaTasks_C.cla
Gpio.c
CodeStartBranch.asm
Lab.h
DefaultIsr_10_12.c
Lab_12.cmd
DelayUs.asm
Main_12.c
Dma.c
Passwords.asm
ECap_7_8_9_10_12.c
PieCtrl.c
EPwm_7_8_9_10_12.c
PieVect.c
F2806x_Cla_typedefs.h
SysCtrl.c
F2806x_DefaultIsr.h
Watchdog.c
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.
Summary of Contents for C2000 Piccolo LaunchPad
Page 74: ...Interrupts 4 18 C2000 Microcontroller Workshop Reset and Interrupts ...
Page 100: ...Lab 5 System Initialization 5 26 C2000 Microcontroller Workshop System Initialization ...
Page 218: ...Lab 8 IQmath FIR Filter 8 42 C2000 Microcontroller Workshop Numerical Concepts ...
Page 334: ...F28069 controlCARD A 4 C2000 Microcontroller Workshop Appendix A Experimenter s Kit SW2 ...
Page 336: ...F28035 controlCARD A 6 C2000 Microcontroller Workshop Appendix A Experimenter s Kit SW2 SW3 ...