在主函数中添加 代码:MemCopy(&RamfuncsLoadStart,&RamfuncsLoadEnd,&RamfuncsRunStart); 三个入口参数定义如下:
SECTIONS
{
/* Allocate program areas: */
.cinit : > FLASHA PAGE = 0
.pinit : > FLASHA,PAGE = 0
.text : > FLASHA PAGE = 0
codestart : > BEGIN PAGE = 0
/*三个变量在这个位置申明*/
ramfuncs : LOAD = FLASHD,RUN = RAML0,LOAD_START(_RamfuncsLoadStart),LOAD_END(_RamfuncsLoadEnd),RUN_START(_RamfuncsRunStart),PAGE = 0
csmpasswds : > CSM_PWL PAGE = 0
csm_rsvd : > CSM_RSVD PAGE = 0
/* Allocate uninitalized data sections: */
.stack : > RAMM1 PAGE = 1
.ebss : > RAML4 PAGE = 1
.esysmem : > RAMM1 PAGE = 1
/* Initalized sections go in Flash */
/* For SDFlash to program these,they must be allocated to page 0 */
.econst : > FLASHA PAGE = 0
.switch : > FLASHA PAGE = 0
/* Allocate IQ math areas: */
IQmath : > FLASHC PAGE = 0 /* Math Code */
IQmathTables : > IQTABLES,PAGE = 0,TYPE = NOLOAD
/* Uncomment the section below if calling the IQNexp() or IQexp()
functions from the IQMath.lib library in order to utilize the
relevant IQ Math table in Boot ROM (This saves space and Boot ROM
is 1 wait-state). If this section is not uncommented,IQmathTables2
will be loaded into other memory (SARAM,Flash,etc.) and will take
up space,but 0 wait-state is possible.
*/
/*
IQmathTables2 : > IQTABLES2,PAGE = 0,TYPE = NOLOAD
{
IQmath.lib<IQNexpTable.obj> (IQmathTablesRam)
}
*/
FPUmathTables : > FPUTABLES,TYPE = NOLOAD
/* Allocate DMA-accessible RAM sections: */
DMARAML4 : > RAML4,PAGE = 1
DMARAML5 : > RAML5,PAGE = 1
DMARAML6 : > RAML6,PAGE = 1
DMARAML7 : > RAML7,PAGE = 1
/* Allocate 0x400 of XINTF Zone 7 to storing data */
ZONE7DATA : > ZONE7B,PAGE = 1
/* .reset is a standard section used by the compiler. It contains the */
/* the address of the start of _c_int00 for C Code. /*
/* When using the boot ROM this section and the CPU vector */
/* table is not needed. Thus the default type is set here to */
/* DSECT */
.reset : > RESET,TYPE = DSECT
vectors : > VECTORS PAGE = 0,TYPE = DSECT
/* Allocate ADC_cal function (pre-programmed by factory into TI reserved memory) */
.adc_cal : load = ADC_CAL,TYPE = NOLOAD
}
调用falsh初始化函数,使flash工作在等待状态:?InitFlash(); 。应为Flash在写的时候才需要解锁,读的时候不用解锁。所以可以吧初始化放在拷贝的后面。