Part Number:TMS320F28335
使用CCS12.5,参照库里的程序f28335_flash_kernel,写了一个写Flash的函数:
#pragma CODE_SECTION(FlashLsrData, ".TI.ramfunc");
Uint16 FlashLsrData(){
// Make sure code security is disabled
Uint32 DestAddr = (Uint32)FLASH_SectorH_start;
lsrData.mLen = 1374;
lsrData.mData[0].wlength = 100;
lsrData.mData[0].lsDrv.PSA.val.LPram = 100;
lsrData.mData[0].lsDrv.PSA.val.RPram = 101;
lsrData.mData[0].lsDrv.WLR.val.LPram = 200;
lsrData.mData[0].lsDrv.WLR.val.RPram = 201;
lsrData.mData[1373].wlength = 16300;
lsrData.mData[1373].lsDrv.PSA.val.LPram = 16300;
lsrData.mData[1373].lsDrv.PSA.val.RPram = 16301;
lsrData.mData[1373].lsDrv.WLR.val.LPram = 16380;
lsrData.mData[1373].lsDrv.WLR.val.RPram = 16381;
CsmUnlock();
DINT;
EALLOW;
Flash_CPUScaleFactor = SCALE_FACTOR;
Flash_CallbackPtr = 0;
EDIS;
Uint16 status = Flash_Erase(SECTORH, &FlashStatus);
if(status == STATUS_SUCCESS){
status = Flash_Program((Uint16 *)DestAddr, (Uint16 *)&lsrData, sizeof(lsrData), &FlashStatus);
}
EINT;
return status;
}
如果程序在RAM中运行,可以正常执行 Flash_Erase函数,返回0,但是如果在Flash中执行,程序会一直卡在 Flash_Erase函数中,不往下执行。
请问该如何处理?
Xie Chengyan:
没有把Flash28335_API_V210.lib加到内存