PRELIMINARY
Using the Algorithms With C Code to Erase and Reprogram the 'F240
A.6 Using the Algorithms With C Code to Erase and Reprogram the 'F240
Because the algorithm implementations do not follow the
In this example, the algorithms reside in external SRAM. The code can be relo- cated anywhere in program space, with the exceptions described in section A.3, Using the Algorithms With Assembly Code.
Note:
This is not an actual application example since a boot mechanism is required to load the external SRAM on powerup. This example uses the 'C2xx C- source Debugger to download the code to the external SRAM. In addition, no reset or interrupt vectors are initialized.
The system requirements are F240 EVM or target board with external pro- gram space SRAM located at 0x8000 and a minimum of 1K words.
A.6.1 C Code That Calls the Interface to Flash Algorithms for TMS320F240
/***********************************************/ |
| |
/* | Filname: sample24.c | */ |
/* | Description: This is an example of how to | */ |
/* | program the 'F2XX flash from C code. | */ |
/* | The C±callable interface for the standard | */ |
/* | flash algorithms is used. This interface is | */ |
/* | defined in the file <flash.asm>, as two | */ |
/* | C±callable functions: erase(), and program() | */ |
/* | At link time, this example must be combined | */ |
/* | with the code in <flash.asm> as well as with | */ |
/* | the object modules for the standard algos. | */ |
/***************************************************/
/* This example is setup for the TMS320F240, */ /* and uses the B1 DARAM as a buffer for program± */
/* | ±ming data. The code first claers, erases, | */ |
/* | then programs the first three locations. | */ |
/***************************************************/
/* Rev1.003/98 JGC */ /***************************************************/
PRELIMINARY | Assembly Source Listings and Program Examples |