PRELIMINARY

C-Callable Interface to Flash Algorithms

A.2 C-Callable Interface to Flash Algorithms

The two functions erase() and program() are intended for in-application pro- gramming of the 'F20x/F24x flash module. These functions were written to be C callable, but they can also be called from assembly as long as the C stack calling convention is used.

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

 

* This file contains two C±callable functions:

*

*

program(), and erase()

*

* These functions are used for programming and

*

* erasing the on±chip flash EEPROM of the 'F2XX

*

*

product family.

*

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

 

* The functions provide a C±callable, interface to

*

* the standard 'F2XX flash algorithms. They can

*

* also be used from assembly code, as long as the

*

* C stack calling convention is used. 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.

*

*

 

*

* The erase function includes all the operations

*

* (clear+erase+flw) required to prepare the flash

*

* for programming. In addition to providing the

*

* C±callable interface, this function is very

*

* useful since it provides a single call to erase

*

*

the flash memory.

*

* Since programming the device requires a single

*

* algorithm, the only purpose for the program()

*

* function is to provide a C±callable interface.

*

* The program() function transfers a specified

*

* block of data memory into a specified, erased

*

*

flash array.

*

*

 

*

* The parameters for each function are described

*

* in detail below. Note these functions cannot

*

* reside in the same flash module that they are

*

*

meant to modify.

*

*

 

*

*

10/29/97 Ruben D. Perez

*

*

DSP Applications Team

*

*

Texas Instruments, Inc.

*

*

03/20/98 Updated for inclusion in flash

*

*

technical reference.

*

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

.title ºC±callable Interface to 'F2XX Flash Algorithms**º ;**C±callable functions defined in this file.

.global _erase, _program

PRELIMINARY

Assembly Source Listings and Program Examples

A-27

Page 79
Image 79
Texas Instruments TMS320F20x/F24x DSP manual Callable Interface to Flash Algorithms