EasyManuals Logo

Texas Instruments C28 Series Student Guide

Texas Instruments C28 Series
342 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #239 background imageLoading...
Page #239 background image
Lab 10: Programming the Flash
Copying .hwi_vec Section from Flash to RAM
The DSP/BIOS .hwi_vec section contains the interrupt vectors. This section must be loaded to
flash (load address) but run from RAM (run address). The code that performs this copy is located
in InitPieCtrl(). The DSP/BIOS configuration tool generates global symbols that can be accessed
by code in order to determine the load address, run address, and length of the .hwi_vec section.
The C-compiler runtime support library contains a memory copy function called memcpy() which
will be used to perform the copy.
4. Open and inspect InitPieCtrl() (in PieCtrl_10.c file). Notice the memcpy() function
and the symbols used to initialize (copy) the .hwi_vec section.
Copying the .trcdata Section from Flash to RAM
The DSP/BIOS .trcdata section is used by CCS and DSP/BIOS for certain real-time debugging
features. This section must be loaded to flash (load address) but run from RAM (run address).
The DSP/BIOS configuration tool generates global symbols that can be accessed by code in order
to determine the load address, run address, and length of the .trcdata section. The memory copy
function memcpy() will again be used to perform the copy.
The copying of .trcdata must be performed prior to main(). This is because DSP/BIOS modifies
the contents of .trcdata during DSP/BIOS initialization, which also occurs prior to main(). The
DSP/BIOS configuration tool provides a user initialization function which will be used to
perform the .trcdata section copy prior to both main() and DSP/BIOS initialization.
5. Open and inspect the file Main_10.c. Notice that the function UserInit() is used
to copy the .trcdata section from its load address to its run address before
main().
6. Open the DSP/BIOS configuration file (Lab.cdb) and select the Properties for the
Global Settings. Check the box “Call User Init Function” and enter
the UserInit() function name with a leading underscore: _UserInit.
Initializing the Flash Control Registers
The initialization code for the flash control registers cannot execute from the flash memory (since
it is changing the flash configuration!). Therefore, the initialization function for the flash control
registers must be copied from flash (load address) to RAM (run address) at runtime. The memory
copy function memcpy() will again be used to perform the copy. The initialization code for the
flash control registers InitFlash() is located in the Flash.c file.
7. Add Flash.c to the project.
8. Open and inspect Flash.c. The C compiler CODE_SECTION pragma is used to place
the InitFlash() function into a linkable section named “secureRamFuncs”.
9. Since the DSP/BIOS configuration tool does not know about user defined sections, the
“secureRamFuncs” section will be linked using the user linker command file
User_10.cmd. Open and inspect User_10.cmd. The “secureRamFuncs” will
load to flash (load address) but will run from L1SARAM (run address). Also notice that
C28x - System Design 10 - 21

Table of Contents

Other manuals for Texas Instruments C28 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments C28 Series and is the answer not in the manual?

Texas Instruments C28 Series Specifications

General IconGeneral
BrandTexas Instruments
ModelC28 Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals