Sample Assembly Code to Erase and Reprogram the TMS320F206

PRELIMINARY

A.3 Sample Assembly Code to Erase and Reprogram the TMS320F206

The algorithm files can be used from assembly in a straightforward manner. In general, the algorithms can reside anywhere in program space. However, the algorithms cannot be executed from the flash module that is being modified, and the algorithms must execute with zero wait states. The assembly code and linker command file in this section provide a working example for the 'F206. In this example, the algorithms reside in SARAM, and flash1 is erased and repro- grammed.

A.3.1 Assembly Code for TMS320F206

*******************************************************

*

Filename: ASMEXAMP.ASM

*

*

Description:

*

* This file contains an example of how to erase

*

* and program the TMS320F206 flash from assembly

*

* code using the standard flash algorithm modules.

*

* The example erases one of the 'F206 flash

*

* modules, then programs the first three words.

*

* Since the standard flash algorithms are actually

*

* used to perform the various flash operations,

*

* they must must be combined with this code at

*

*

link time.

*

*

 

*

*

03/20/98 Updated for inclusion in flash

*

*

technical reference.

*

*******************************************************

.title º**Example of Using 'F2XX Flash Algorithms**º ;**Variables included from flash algorithms.

.include ºsvar20.hº

;Variable declarations

.ref

GCLR

;References clear algo.

.ref

GPGMJ

;References program algo.

.ref

GERS

;References erase algo.

.ref

FLWS

;References Flash±write algo.

;**Parameters used by flash algorithms.

.def

PRG_bufaddr, PRG_paddr

.def

PRG_length, PARMS

.def

SEG_ST,SEG_END,PROTECT

**********************************************************

VARS: .usect ºPRG_dataº,16 ;This is an uninitialized

*

;data section required by

*

;the standard flash algos

*

;for temporary variables.

*

;Pointers to this space

*

;are hardcoded

in SVAR20.H, *

;and variables

are

*

;init'd at run

time.

*

**********************************************************

PARMS: .usect ºPRG_parmº,10 ;This is an uninitialized

*

A-32

PRELIMINARY

Page 84
Image 84
Texas Instruments TMS320F20x/F24x DSP manual Sample Assembly Code to Erase and Reprogram the TMS320F206