Lab 10: Programming the Flash
the linker has been asked to generate symbols for the load start, load end, and run start
addresses.
While not a requirement from a DSP hardware perspective (since the C28x DSP has a
unified memory architecture). Code Composer Studio generally prefers code to be linked
to program space (and data to be linked to data space). Therefore, notice that for the
L1SARAM memory we are linking
“secureRamFuncs”
to, we are specifiying
“PAGE = 0”(which is program space). The L1SARAM memory is currently defined in
data space in the
Lab.cdb
, but in the next step we will redefine it to exist in the
program space.
10. Using the DSP/BIOS configuration tool (
Lab.cdb
) modify the entry for L1SARAM so
that it is defined in the program space (code).
11. Open and inspect
Main_10.c
. Notice that the memory copy function memcpy() is
being used to copy the section
“secureRamFuncs
, which contains the initialization
function for the flash control registers.
12. Add a line of code to
main()
to call the
InitFlash()
function. There are no passed
parameters or return values. You just type
InitFlash();
at the desired spot in
main()
.
Code Security Module and Passwords
The CSM module provides protection against unwanted copying (i.e. pirating!) of your code from
flash, OTP memory, and the L0 and L1 RAM blocks. The CSM uses a 128-bit password made
up of 8 individual 16-bit words. They are located in flash at addresses 0x3F7FF8 to 0x3F7FFF.
During this lab, dummy passwords of 0xFFFF will be used – therefore only dummy reads of the
password locations are needed to unsecure the CSM.
DO NOT PROGRAM ANY REAL
PASSWORDS INTO THE DEVICE
. After development, real passwords are typically placed in
the password locations to protect your code. We will not be using real passwords in the
workshop.
The CSM module also requires programming values of 0x0000 into flash addresses 0x3F7F80
through 0x3F7FF5 in order to properly secure the CSM. Both tasks will be accomplished using a
simple assembly language program
Passwords.asm
.
13. Add
Passwords.asm
to your CCS project.
14. Open and inspect
Passwords.asm
. This file specifies the desired password values
(DO NOT CHANGE THE VALUES FROM 0xFFFF)
and places them in an initialized
section named
“passwords”
. It also creates an initialized section named
“csm_rsvd”
which contains all 0x0000 values for locations 0x3F7F80 to 0x3F7FF5
(length of 0x76).
10 - 22
C28x - System Design
Содержание C28 Series
Страница 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Страница 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Страница 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Страница 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Страница 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Страница 275: ...Appendix eZdsp F2812 eZdsp F2812 Connector Header and Pin Diagram C28x Appendix A eZdsp F2812 A 3 ...
Страница 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Страница 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Страница 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Страница 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Страница 281: ...Appendix JP7 JP8 JP11 JP12 Boot Mode Select JP9 PLL Disable DS1 DS2 LEDs C28x Appendix A eZdsp F2812 A 9 ...
Страница 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...