Texas Instruments TMS320F20x/F24x DSP Computer Drive User Manual


 
Sample C Code to Erase and Reprogram the TMS320F206
PRELIMINARY
A-38
PRELIMINARY
{ /*Flash fails programming, EXIT*/
while(1){} /*Spin here forever*/
}
}
else
{ /*Flash fails erase, EXIT*/
while(1){} /*Spin here forever*/
}
}
A.4.2 Linker Command File for TMS320F206 Sample C Code
/*************************************************************************/
/* Filename: F206_SA.CMD */
/* Description: Linker command file for ’F206 example of on–chip flash */
/* programming from C code. This command file links the */
/* example to addr 0x8000 of the on–chip SARAM so that */
/* the debugger can be used to set breakpoints. Another */
/* benefit of linking the example to SARAM is that the */
/* C code can be modified to operate on either flash */
/* module0, or module1, or both. */
/* Notes: */
/* 1. This example expects the ’F206 SARAM to be */
/* mapped in both data space and program space */
/* (DON=PON=1). */
/* 2. The object modules for the standard flash algos */
/* are expected to be in a subdirectory (ALGOS) of */
/* the path of this file. */
/**********************************************************************/
/* Rev1.0 10/97 RDP */
/**********************************************************************/
/************************Command Line Options**************************/
–cr /*Use Ram init model. */
–heap 0x0 /*No heap needed for this example. */
–stack 0x96 /*150–word stack is enough for this example. */
–x /*Force rereading of libraries. */
–l c:\dsptools\rts2xx.lib
–o sample_S.out
–m sample_S.map
/*****************************Input Files******************************/
sample.obj /*User C code with calls to erase() and program() */
flash.obj /*C–callable interface to standard algorithms. */
algos\spgm20.obj /*Standard Programming algorithms. */
algos\sclr20.obj /*Standard Clear algorithm. */
algos\sera20.obj /*Standard Erase algorithm. */
algos\sflw20.obj /*Standard Flash–write algorithm. */
algos\sutils20.obj /*Subroutines used by standard algorithms. */
/*****************************Memory Map*******************************/
MEMORY
{
PAGE 0: /* PM – Program memory */