EasyManuals Logo

Texas Instruments C2000 Workshop Guide And Lab Manual

Texas Instruments C2000
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 #287 background imageLoading...
Page #287 background image
Lab 12: Programming the Flash
C2000 Microcontroller Workshop - System Design 12 - 17
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 file Passwords.asm.
11. Add Passwords.asm to the project.
12. 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).
13. Open Lab_12.cmd and notice that the initialized sections for passwordsand
csm_rsvdare linked to memories named PASSWORDS and CSM_RSVD,
respectively.
Executing from Flash after Reset
The F28069 device contains a ROM bootloader that will transfer code execution to the flash after
reset. When the boot mode selection is set for “Jump to Flash” mode, the bootloader will branch
to the instruction located at address 0x3F7FF6 in the flash. An instruction that branches to the
beginning of your program needs to be placed at this address. Note that the CSM passwords
begin at address 0x3F7FF8. There are exactly two words available to hold this branch
instruction, and not coincidentally, a long branch instruction “LB” in assembly code occupies
exactly two words. Generally, the branch instruction will branch to the start of the C-
environment initialization routine located in the C-compiler runtime support library. The entry
symbol for this routine is _c_int00. Recall that C code cannot be executed until this setup routine
is run. Therefore, assembly code must be used for the branch. We are using the assembly code
file named CodeStartBranch.asm.
14. Open and inspect CodeStartBranch.asm. This file creates an initialized section
named “codestart” that contains a long branch to the C-environment setup routine.
This section needs to be linked to a block of memory named BEGIN_FLASH.
15. In the earlier lab exercises, the section codestartwas directed to the memory
named BEGIN_M0. Edit Lab_12.cmd so that the section codestartwill be
directed to BEGIN_FLASH. Save your work and close the opened files.
On power up the reset vector will be fetched and the ROM bootloader will begin execution. If
the emulator is connected, the device will be in emulator boot mode and will use the EMU_KEY
and EMU_BMODE values in the PIE RAM to determine the boot mode. This mode was utilized
in an earlier lab. In this lab, we will be disconnecting the emulator and running in stand-alone
boot mode (but do not disconnect the emulator yet!). The bootloader will read the OTP_KEY
and OTP_BMODE values from their locations in the OTP. The behavior when these values have
not been programmed (i.e., both 0xFFFF) or have been set to invalid values is boot to flash boot
mode.

Table of Contents

Other manuals for Texas Instruments C2000

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments C2000 Specifications

General IconGeneral
BrandTexas Instruments
ModelC2000
CategoryMicrocontrollers
LanguageEnglish

Related product manuals