This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28P650DK: Existing projects (including sysconfig) have called the FLASH_API function to perform write, read and calibration operations on the internal FLASH area of the F28P65.

Part Number: TMS320F28P650DK
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Tool/software:

sysconfig configuration

Hello, expert. I made the modifications to flashapi_ex2_programming based on this process.

The specific operation of the FLASHZ-API function

memcpy(&RamfuncsLoadStart,&RamfuncsLoadEnd,RamfuncsRunStart);//将初始化Flash代码复制到RAM
volatile Fapi_FlashStatusType oFlashStatus;
Fapi_StatusType oReturnCheck;
Fapi_StatusType oReturnCheckA;
Fapi_FlashStatusWordType oFlashStatusWord;
flag_write =1;
uint32 u32CurrentAddress = 0;
if(flag_write == 1)

{
flag_write =0;
Buffer[0] = 0x1122;
Buffer[1] = 0x3344;
Buffer[2] = 0x5566;
Buffer[3] = 0x7788;
Buffer[4] = 0x99AA;
Buffer[5] = 0xAABB;
Buffer[6] = 0xBBCC;
Buffer[7] = 0xDDEE;

EALLOW;
oReturnCheck = Fapi_initializeAPI(FlashTech_CPU0_BASE_ADDRESS,
DEVICE_SYSCLK_FREQ/1000000U);//Flash初始化
if(oReturnCheck != Fapi_Status_Success)
{
//
// Check Flash API documentation for possible errors
//
Example_Error(oReturnCheck);
}
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);// 检测flash的扇区是否为初始化状态
if(oReturnCheck != Fapi_Status_Success)
{
//
// Check Flash API documentation for possible errors
//
Example_Error(oReturnCheck);
}
EDIS;
EALLOW;
ClearFSMStatus();
Fapi_setupBankSectorEnable(FLASH_WRAPPER_PROGRAM_BASE+FLASH_O_CMDWEPROTA, 0xFFFFFF00);
Fapi_setupBankSectorEnable(FLASH_WRAPPER_PROGRAM_BASE+FLASH_O_CMDWEPROTB, 0x00000003);
oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,(uint32*)Bzero_Sector1_start);
// Wait until FSM is done with erase sector operation
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}

if(oReturnCheck != Fapi_Status_Success)
{
// Check Flash API documentation for possible errors
Example_Error(oReturnCheck);
}

// Read FMSTAT register contents to know the status of FSM after
// erase command to see if there are any erase operation related errors
oFlashStatus = Fapi_getFsmStatus();
if(oFlashStatus != 3)
{
// Check Flash API documentation for FMSTAT and debug accordingly
// Fapi_getFsmStatus() function gives the FMSTAT register contents.
// Check to see if any of the EV bit, ESUSP bit, CSTAT bit or
// VOLTSTAT bit is set (Refer to API documentation for more details).

}
// Verify that Sector0 is erased
//
oReturnCheck = Fapi_doBlankCheck((uint32 *)Bzero_Sector1_start,
Sector2KB_u32length,
&oFlashStatusWord);
if(oReturnCheck != Fapi_Status_Success)
{
//
// Check Flash API documentation for error info
//
Example_Error(oReturnCheck);//FMSTAT_Fail
}
EDIS;
EALLOW;
ClearFSMStatus();
Fapi_setupBankSectorEnable(FLASH_WRAPPER_PROGRAM_BASE+FLASH_O_CMDWEPROTA, 0xFFFFFF00);
Fapi_setupBankSectorEnable(FLASH_WRAPPER_PROGRAM_BASE+FLASH_O_CMDWEPROTB, 0x00000003);
oReturnCheck = Fapi_issueProgrammingCommand((uint32*)Bzero_Sector1_start,Buffer,8,0,0,Fapi_AutoEccGeneration);//flash烧写(在给定的地址烧写内同)
while (Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
oFlashStatus = Fapi_getFsmStatus();
oReturnCheck = Fapi_doVerify((uint32*)Bzero_Sector1_start,4,Buffer,&oFlashStatusWord);//这个长度单位是字节,所以除以2
}
EDIS;

Hello, expert;

flashapi_ex2_programming - This project does not have sysconfig;

<<I would like to know what configuration needs to be added to the current project (which has sysconfig) in order to be able to operate the FLASH_API functions of the F28P65; Where can I find the missing header file?

 flashapi_ex2_programming--CMD file

my sysconfig_CMD

<<How should I modify my sysconfig_CMD so that it can be compatible with the flashapi_ex2_programming--CMD file?