TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320F28377D: Flash api

Part Number:TMS320F28377DOther Parts Discussed in Thread:C2000WARE

程序为Bootloader+应用层程序,单核。Bootloader区域为FLASH A-D,应用层区域为Flash E-K, 应用层中掉电数据保存区域为Flash L-N(通过CAN/SCI通信及Flash API完成在线数据更新)。

目前问题如下:当通过调试器下载并直接运行,观测Flash L-N区域和通信反馈数据,可以完成正常的Erase、Write等功能。拔掉调试器重新上电或通过通信及wdg配合完成复位后,flash相关的Erase\Write命令均执行不成功。

是否与Bootloader到App的跳转有关,是否可能是编译器优化了部分代码,如while(Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}语句等为进行判断,是否还有其他可能原因。

目前已经做过的测试如下:

1.bootloader程序中删除Flash驱动包的初始化,直接通过asm(" LB 0x088000")跳转进App程序,由App重新完成系统初始化等,问题依然存在。

2.取消Bootloaer程序,更改CMD问题,仅存在应用层程序,问题依然存在。

3.通过变量取值如res=Fapi_checkFsmForReady(),通过变量判断,排除编译器优化干扰等,问题依然存在。

Green Deng:

你好,看了一下你的问题,有个点不知道你注意到没有,就是FlashAPI函数必须在ram中运行。

由此有可能导致你的程序在线调试的时候能正常运行,但烧写到flash之后就会无法正常运行了。

,

Bo XU:

在线调试时候也是通过FlashAPI函数的,观察RAMD1和FLASHG区域应该是重定位到RAM成功的,难道复位后有问题?

初始化:

memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize); memcpy(&RamfuncsFapiRunStart, &RamfuncsFapiLoadStart, (size_t)&RamfuncsFapiLoadSize);

CMD文件: .TI.ramfuncFapi : { –library=../F2837xD_flashapi/lib/F021_API_F2837xD_FPU32.lib } LOAD = FLASHG, RUN = RAMD1, RUN_START(_RamfuncsFapiRunStart), LOAD_START(_RamfuncsFapiLoadStart), LOAD_SIZE(_RamfuncsFapiLoadSize), PAGE = 0, ALIGN(4)

,

Bo XU:

连着调试器也是整个程序烧写到FLASH里运行的,不是在RAM中运行的

,

Green Deng:

这个问题我会咨询一下其他工程师之后回复你,还请耐心等待。

,

Bo XU:

一些补充信息:

1.CCS版本Version: 11.0.0.00012、包版本C2000Ware_4_00_00_00

2.将Bootloader程序删除,只保留应用层程序,并更改CMD文件,问题依然存在,应该与Bootloader跳转等没有关系

3.无论是连接下载器还是未连接下载器,RAM的重映射区域用通信读取出来,应该是均映射成功的

4.RAM重映射代码如下:

#ifdef _FLASH//// Copy time critical code and flash setup code to RAM. This includes the// following functions: InitFlash();//// The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart symbols// are created by the linker. Refer to the device .cmd file.//memcpy(&RamfuncsRunStart,&RamfuncsLoadStart,(size_t)&RamfuncsLoadSize);memcpy(&RamfuncsFapiRunStart,&RamfuncsFapiLoadStart, (size_t)&RamfuncsFapiLoadSize);memcpy(&RamfuncsFpuRunStart,&RamfuncsFpuLoadStart,(size_t)&RamfuncsFpuLoadSize);memcpy(&RamfuncsUserRunStart,&RamfuncsUserLoadStart, (size_t)&RamfuncsUserLoadSize);//// Call Flash Initialization to setup flash waitstates. This function must// reside in RAM.//Flash_initModule(FLASH0CTRL_BASE, FLASH0ECC_BASE, DEVICE_FLASH_WAITSTATES);
#endif

5.Flash初始化及Erase\Write调用函数如附件文件所示BswEep.c

/** BswEep.c**Created on: 2022��4��5��*Author: Thinkpad-T14*/
#include "Includes.h"#pragma CODE_SECTION(BswEep_init, ".User.ramfunc");
uint16_t BswEep_init(void)
{uint16_t ReturnValue=0;Fapi_StatusType oFapi_Status1,oFapi_Status2;Flash_claimPumpSemaphore(FLASHPUMPSEMAPHORE_BASE, FLASH_CPU1_WRAPPER);EALLOW;oFapi_Status1 = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, DEVICE_SYSCLK_FREQ/1000000);Flash_disableECC(FLASH0ECC_BASE);oFapi_Status2 = Fapi_setActiveFlashBank(Fapi_FlashBank0);Flash_enableECC(FLASH0ECC_BASE);EDIS;if( (oFapi_Status1 != Fapi_Status_Success) || (oFapi_Status2 != Fapi_Status_Success) ){ReturnValue=0;}else{ReturnValue=BswEep_ReadFLSL();ReturnValue=ReturnValue & BswEep_ReadFLSM();ReturnValue=ReturnValue & BswEep_ReadFLSN();}GeBswEep_Flag_InitReady=ReturnValue;return ReturnValue;
}#pragma CODE_SECTION(BswEep_ReadFLSL, ".User.ramfunc");
uint16_t BswEep_ReadFLSL(void)
{uint16_t ReturnValue=0;Fapi_StatusType oFapi_Status;DINT;EALLOW;oFapi_Status = Fapi_doMarginRead((uint32 *)(0x0BA000),(uint32 *)&CeAswNvm_U_EcuInformation,sizeof(GeAswNvm_Type_EcuInformationUnion)/2,Fapi_NormalRead);EDIS;EINT;if(oFapi_Status == Fapi_Status_Success)ReturnValue=1;elseReturnValue=0;return ReturnValue;
}#pragma CODE_SECTION(BswEep_ReadFLSM, ".User.ramfunc");
uint16_t BswEep_ReadFLSM(void)
{uint16_t ReturnValue=0;Fapi_StatusType oFapi_Status1,oFapi_Status2;DINT;EALLOW;oFapi_Status1 = Fapi_doMarginRead((uint32 *)(0x0BC000),(uint32 *)&CeAswNvm_U_BoardInformation,sizeof(GeAswNvm_Type_BoardInformationUnion)/2,Fapi_NormalRead);oFapi_Status2 = Fapi_doMarginRead((uint32 *)(0x0BC100),(uint32 *)&CeAswNvm_U_CalibInformation,sizeof(GeAswNvm_Type_CalibInformationUnion)/2,Fapi_NormalRead);EDIS;EINT;if( (oFapi_Status1 == Fapi_Status_Success) && (oFapi_Status2 == Fapi_Status_Success))ReturnValue=1;elseReturnValue=0;if(CeAswNvm_U_BoardInformation.NvmData.BoardID<1)CeAswNvm_U_BoardInformation.NvmData.BoardID=1;else if(CeAswNvm_U_BoardInformation.NvmData.BoardID>100)CeAswNvm_U_BoardInformation.NvmData.BoardID=100;if( (CeAswNvm_U_BoardInformation.NvmData.SciBaudRate == 9600) ||(CeAswNvm_U_BoardInformation.NvmData.SciBaudRate == 19200) ||(CeAswNvm_U_BoardInformation.NvmData.SciBaudRate == 38400) ||(CeAswNvm_U_BoardInformation.NvmData.SciBaudRate == 57600) ||(CeAswNvm_U_BoardInformation.NvmData.SciBaudRate == 115200)){}else{CeAswNvm_U_BoardInformation.NvmData.SciBaudRate=115200;}if( (CeAswNvm_U_BoardInformation.NvmData.CanBaudRate == 125000) ||(CeAswNvm_U_BoardInformation.NvmData.CanBaudRate == 250000) ||(CeAswNvm_U_BoardInformation.NvmData.CanBaudRate == 500000) ||(CeAswNvm_U_BoardInformation.NvmData.CanBaudRate == 1000000)){}else{CeAswNvm_U_BoardInformation.NvmData.CanBaudRate=250000;}return ReturnValue;
}#pragma CODE_SECTION(BswEep_ReadFLSN, ".User.ramfunc");
uint16_t BswEep_ReadFLSN(void)
{uint16_t ReturnValue=0;Fapi_StatusTypeoFapi_Status;Fapi_FlashStatusWordType oFapi_FlashStatusWord;uint16_t tempIndex=0;uint16_t LeBswEep_U16_UnionSize=0;//used to save size of Unions in 16-bitsuint32_t LeBswEep_U32_TgtAddr=0;//Command Target Address;DINT;LeBswEep_U16_UnionSize=sizeof(GeAswNvm_Type_AppInformationUnion);for(tempIndex=0;tempIndex<(0x2000/LeBswEep_U16_UnionSize);tempIndex++){LeBswEep_U32_TgtAddr=0x0BE000+tempIndex*LeBswEep_U16_UnionSize;EALLOW;oFapi_Status = Fapi_doBlankCheck((uint32 *)LeBswEep_U32_TgtAddr,LeBswEep_U16_UnionSize/2,&oFapi_FlashStatusWord);EDIS;if(oFapi_Status == Fapi_Status_Success){break;}}if ( (tempIndex>=0x2000/LeBswEep_U16_UnionSize) || (tempIndex==0) ){GeAswNvm_U_AppInformationLocationIndex[1]=0x0BE000;GeAswNvm_U_AppInformationLocationIndex[0]=GeAswNvm_U_AppInformationLocationIndex[1]+0x2000-LeBswEep_U16_UnionSize-(0x2000%LeBswEep_U16_UnionSize);EALLOW;oFapi_Status = Fapi_doMarginRead((uint32 *)GeAswNvm_U_AppInformationLocationIndex[0],(uint32 *)&CeAswNvm_U_AppInformation,LeBswEep_U16_UnionSize/2,Fapi_NormalRead);EDIS;}else{GeAswNvm_U_AppInformationLocationIndex[1]=0x0BE000+tempIndex*LeBswEep_U16_UnionSize;GeAswNvm_U_AppInformationLocationIndex[0]=GeAswNvm_U_AppInformationLocationIndex[1]-LeBswEep_U16_UnionSize;EALLOW;oFapi_Status = Fapi_doMarginRead((uint32 *) GeAswNvm_U_AppInformationLocationIndex[0],(uint32 *)&CeAswNvm_U_AppInformation,LeBswEep_U16_UnionSize/2,Fapi_NormalRead);EDIS;}EINT;if(oFapi_Status == Fapi_Status_Success)ReturnValue=1;elseReturnValue=0;CeAswNvm_U_AppInformation.NvmData.Reserved1=0;return ReturnValue;
}#pragma CODE_SECTION(BswEep_EraseFLSL, ".User.ramfunc");
uint16_t BswEep_EraseFLSL(void)
{uint16_t ReturnValue=0;Fapi_StatusTypeoFapi_Status,oFapi_Status1,oFapi_Status2;Fapi_FlashStatusTypeoFapi_FlashStatus;Fapi_FlashStatusWordType oFapi_FlashStatusWord;DINT;SysCtl_disableWatchdog();EALLOW;oFapi_Status = Fapi_doBlankCheck((uint32 *)(0x0BA000),0x1000,&oFapi_FlashStatusWord);EDIS;if(oFapi_Status !=Fapi_Status_Success){EALLOW;oFapi_Status1 = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,(uint32 *)(0x0BA000));while(Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}oFapi_FlashStatus = Fapi_getFsmStatus();oFapi_Status2 = Fapi_doBlankCheck((uint32 *)(0x0BA000),0x1000,&oFapi_FlashStatusWord);EDIS;if( (oFapi_Status1 != Fapi_Status_Success) || (oFapi_Status2 != Fapi_Status_Success) || (oFapi_FlashStatus!=0) )ReturnValue=0;elseReturnValue=1;}else{ReturnValue=1;}SysCtl_enableWatchdog();DEVICE_DELAY_US(60000);EINT;return ReturnValue;
}#pragma CODE_SECTION(BswEep_EraseFLSM, ".User.ramfunc");
uint16_t BswEep_EraseFLSM(void)
{uint16_t ReturnValue=0;Fapi_StatusTypeoFapi_Status,oFapi_Status1,oFapi_Status2;Fapi_FlashStatusTypeoFapi_FlashStatus;Fapi_FlashStatusWordType oFapi_FlashStatusWord;DINT;SysCtl_disableWatchdog();EALLOW;oFapi_Status = Fapi_doBlankCheck((uint32 *)(0x0BC000),0x1000,&oFapi_FlashStatusWord);EDIS;if(oFapi_Status !=Fapi_Status_Success){EALLOW;oFapi_Status1 = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,(uint32 *)(0x0BC000));while(Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}oFapi_FlashStatus = Fapi_getFsmStatus();oFapi_Status2 = Fapi_doBlankCheck((uint32 *)(0x0BC000),0x1000,&oFapi_FlashStatusWord);EDIS;if( (oFapi_Status1 != Fapi_Status_Success) || (oFapi_Status2 != Fapi_Status_Success) || (oFapi_FlashStatus!=0) )ReturnValue=0;elseReturnValue=1;}else{ReturnValue=1;}SysCtl_enableWatchdog();DEVICE_DELAY_US(60000);EINT;return ReturnValue;
}#pragma CODE_SECTION(BswEep_EraseFLSN, ".User.ramfunc");
uint16_t BswEep_EraseFLSN(void)
{uint16_t ReturnValue=0;Fapi_StatusTypeoFapi_Status,oFapi_Status1,oFapi_Status2;Fapi_FlashStatusTypeoFapi_FlashStatus;Fapi_FlashStatusWordType oFapi_FlashStatusWord;DINT;SysCtl_disableWatchdog();EALLOW;oFapi_Status = Fapi_doBlankCheck((uint32 *)(0x0BE000),0x1000,&oFapi_FlashStatusWord);EDIS;if(oFapi_Status !=Fapi_Status_Success){EALLOW;oFapi_Status1 = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,(uint32 *)(0x0BE000));while(Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}oFapi_FlashStatus = Fapi_getFsmStatus();oFapi_Status2 = Fapi_doBlankCheck((uint32 *)(0x0BE000),0x1000,&oFapi_FlashStatusWord);EDIS;if( (oFapi_Status1 != Fapi_Status_Success) || (oFapi_Status2 != Fapi_Status_Success) || (oFapi_FlashStatus!=0) )ReturnValue=0;else{ReturnValue=1;GeAswNvm_U_AppInformationLocationIndex[1]=0x0BE000;GeAswNvm_U_AppInformationLocationIndex[0]=GeAswNvm_U_AppInformationLocationIndex[1]+0x2000-sizeof(GeAswNvm_Type_AppInformationUnion)-(0x2000%sizeof(GeAswNvm_Type_AppInformationUnion));}}else{ReturnValue=1;GeAswNvm_U_AppInformationLocationIndex[1]=0x0BE000;GeAswNvm_U_AppInformationLocationIndex[0]=GeAswNvm_U_AppInformationLocationIndex[1]+0x2000-sizeof(GeAswNvm_Type_AppInformationUnion)-(0x2000%sizeof(GeAswNvm_Type_AppInformationUnion));}SysCtl_enableWatchdog();DEVICE_DELAY_US(60000);EINT;return ReturnValue;
}#pragma CODE_SECTION(BswEep_WriteFLSL, ".User.ramfunc");
uint16_t BswEep_WriteFLSL(void)
{uint16_t ReturnValue=0;Fapi_StatusTypeoFapi_Status;Fapi_FlashStatusTypeoFapi_FlashStatus;Fapi_FlashStatusWordType oFapi_FlashStatusWord;uint16_t tempIndex=0;uint16_t LeBswEep_U16_UnionSize=0;//used to save size of Unions in 16-bitsDINT;SysCtl_disableWatchdog();LeBswEep_U16_UnionSize=sizeof(GeAswNvm_Type_EcuInformationUnion);EALLOW;oFapi_Status = Fapi_doBlankCheck((uint32 *)(0x0BA000),LeBswEep_U16_UnionSize/2,&oFapi_FlashStatusWord);EDIS;if(oFapi_Status != Fapi_Status_Success){ReturnValue=0;}else{oFapi_Status=Fapi_Status_Success;oFapi_FlashStatus=0;for(tempIndex=0; tempIndex<(LeBswEep_U16_UnionSize/4) && (oFapi_Status==Fapi_Status_Success) && (oFapi_FlashStatus==0) ;tempIndex++){EALLOW;oFapi_Status = Fapi_issueProgrammingCommand((uint32 *)(0x0BA000+tempIndex*4),(uint16 *)(&CeAswNvm_U_EcuInformation.FlsBuffer[0]+tempIndex*4),4,0,0,Fapi_AutoEccGeneration);while(Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}oFapi_FlashStatus = Fapi_getFsmStatus();EDIS;}EALLOW;oFapi_Status = Fapi_doVerify((uint32 *)(0x0BA000),LeBswEep_U16_UnionSize/2,(uint32 *)(&CeAswNvm_U_EcuInformation.FlsBuffer[0]),&oFapi_FlashStatusWord);EDIS;if( (oFapi_Status != Fapi_Status_Success) ){ReturnValue=0;}elseReturnValue=1;}SysCtl_enableWatchdog();DEVICE_DELAY_US(60000);EINT;return ReturnValue;
}#pragma CODE_SECTION(BswEep_WriteFLSM, ".User.ramfunc");
uint16_t BswEep_WriteFLSM(void)
{uint16_t ReturnValue=0;Fapi_StatusTypeoFapi_Status,oFapi_Status1,oFapi_Status2;Fapi_FlashStatusTypeoFapi_FlashStatus;Fapi_FlashStatusWordType oFapi_FlashStatusWord;uint16_t tempIndex=0;uint16_t LeBswEep_U16_UnionSize=0;//used to save size of Unions in 16-bitsDINT;SysCtl_disableWatchdog();LeBswEep_U16_UnionSize=sizeof(GeAswNvm_Type_BoardInformationUnion)+sizeof(GeAswNvm_Type_CalibInformationUnion);EALLOW;oFapi_Status = Fapi_doBlankCheck((uint32 *)(0x0BC000),LeBswEep_U16_UnionSize/2,&oFapi_FlashStatusWord);EDIS;if(oFapi_Status != Fapi_Status_Success){ReturnValue=0;}else{oFapi_Status=Fapi_Status_Success;oFapi_FlashStatus=0;for(tempIndex=0;tempIndex<(sizeof(GeAswNvm_Type_BoardInformationUnion)/4) && (oFapi_Status==Fapi_Status_Success) && (oFapi_FlashStatus==0) ;tempIndex++){EALLOW;oFapi_Status = Fapi_issueProgrammingCommand((uint32 *)(0x0BC000+tempIndex*4),(uint16 *)(&CeAswNvm_U_BoardInformation.FlsBuffer[0]+tempIndex*4),4,0,0,Fapi_AutoEccGeneration);while(Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}oFapi_FlashStatus = Fapi_getFsmStatus();EDIS;}oFapi_Status=Fapi_Status_Success;oFapi_FlashStatus=0;for(tempIndex=0;tempIndex<(sizeof(GeAswNvm_Type_CalibInformationUnion)/4) && (oFapi_Status==Fapi_Status_Success) && (oFapi_FlashStatus==0);tempIndex++){EALLOW;oFapi_Status = Fapi_issueProgrammingCommand((uint32 *)(0x0BC100+tempIndex*4),(uint16 *)(&CeAswNvm_U_CalibInformation.FlsBuffer[0]+tempIndex*4),4,0,0,Fapi_AutoEccGeneration);while(Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}oFapi_FlashStatus = Fapi_getFsmStatus();EDIS;}EALLOW;oFapi_Status1 = Fapi_doVerify((uint32 *)(0x0BC000),sizeof(GeAswNvm_Type_BoardInformationUnion)/2,(uint32 *)(&CeAswNvm_U_BoardInformation.FlsBuffer[0]),&oFapi_FlashStatusWord);oFapi_Status2 = Fapi_doVerify((uint32 *)(0x0BC100),sizeof(GeAswNvm_Type_CalibInformationUnion)/2,(uint32 *)(&CeAswNvm_U_CalibInformation.FlsBuffer[0]),&oFapi_FlashStatusWord);EDIS;if( (oFapi_Status1 != Fapi_Status_Success)|| (oFapi_Status2 != Fapi_Status_Success) )ReturnValue=0;elseReturnValue=1;}SysCtl_enableWatchdog();DEVICE_DELAY_US(60000);EINT;return ReturnValue;
}#pragma CODE_SECTION(BswEep_WriteFLSN, ".User.ramfunc");
uint16_t BswEep_WriteFLSN(void)
{uint16_t ReturnValue=0;uint16_t WriteFlag=0;Fapi_StatusTypeoFapi_Status;Fapi_FlashStatusTypeoFapi_FlashStatus;Fapi_FlashStatusWordType oFapi_FlashStatusWord;uint16_t tempIndex=0;uint16_t LeBswEep_U16_UnionSize=0;//used to save size of Unions in 16-bitsDINT;SysCtl_disableWatchdog();LeBswEep_U16_UnionSize=sizeof(GeAswNvm_Type_AppInformationUnion);EALLOW;oFapi_Status=Fapi_doVerify( (uint32 *)GeAswNvm_U_AppInformationLocationIndex[0],LeBswEep_U16_UnionSize/2,(uint32 *)(&CeAswNvm_U_AppInformation.FlsBuffer[0]),&oFapi_FlashStatusWord);EDIS;if(oFapi_Status == Fapi_Status_Success){WriteFlag=0;}else if( (GeAswNvm_U_AppInformationLocationIndex[1]-0x0BE000+LeBswEep_U16_UnionSize)>0x2000){WriteFlag=BswEep_EraseFLSN();}else{WriteFlag=1;}if(WriteFlag){oFapi_Status=Fapi_Status_Success;oFapi_FlashStatus=0;for(tempIndex=0;tempIndex<(LeBswEep_U16_UnionSize/4) && (oFapi_Status==Fapi_Status_Success) && (oFapi_FlashStatus==0) ;tempIndex++){EALLOW;oFapi_Status = Fapi_issueProgrammingCommand((uint32 *)(GeAswNvm_U_AppInformationLocationIndex[1]+tempIndex*4),(uint16 *)(&CeAswNvm_U_AppInformation.FlsBuffer[0]+tempIndex*4),4,0,0,Fapi_AutoEccGeneration);while(Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}oFapi_FlashStatus = Fapi_getFsmStatus();EDIS;}EALLOW;oFapi_Status=Fapi_doVerify( (uint32 *)GeAswNvm_U_AppInformationLocationIndex[1],LeBswEep_U16_UnionSize/2,(uint32 *)(&CeAswNvm_U_AppInformation.FlsBuffer[0]),&oFapi_FlashStatusWord);EDIS;if(oFapi_Status == Fapi_Status_Success){ReturnValue=1;GeAswNvm_U_AppInformationLocationIndex[0]=GeAswNvm_U_AppInformationLocationIndex[1];GeAswNvm_U_AppInformationLocationIndex[1]+=LeBswEep_U16_UnionSize;}else{ReturnValue=0;}}else{}SysCtl_enableWatchdog();DEVICE_DELAY_US(60000);EINT;return ReturnValue;
}

,通信接收数据后,直接调用相关函数完成Erase\Write操作,然后通过通信回复返回值。

6.TIC2000调用API函数Flash擦除片上FLASH失败_量子力学和生命科学的博客-CSDN博客,这个帖子中的问题与我遇到的及其相似,但根本原因好像不同。

7.连接调试器时可正常工作,在未连接调试器时,如手动发动Write命令多次,会造成单片机Wdg复位,复位源已确认,Wdg工作在window窗口模式。

,

Green Deng:

收到,我会一起反馈过去,但目前还没回复,还请耐心等待

,

Green Deng:

你好,能否提供一下有关“将程序加载到闪存并运行后,它无法正常运行”的详细说明?比如是否有任何特定的错误或者状态?

,

Bo XU:

其余程序运行均正常,执行Fapi相关函数会返回错误值,如执行 oFapi_Status = Fapi_issueProgrammingCommand(x,x,4,0,0,Fapi_AutoEccGeneration),返回值状态为Fapi_Error_Fail=500。

typedef enum
{Fapi_Status_Success=0,/* Function completed successfully */Fapi_Status_FsmBusy,/* FSM is Busy */Fapi_Status_FsmReady,/* FSM is Ready */Fapi_Status_AsyncBusy,/* Async function operation is Busy */Fapi_Status_AsyncComplete,/* Async function operation is Complete */Fapi_Error_Fail=500,/* Generic Function Fail code */Fapi_Error_StateMachineTimeout,/* State machine polling never returned ready and timed out */Fapi_Error_OtpChecksumMismatch,/* Returned if OTP checksum does not match expected value */Fapi_Error_InvalidDelayValue,/* Returned if the Calculated RWAIT value exceeds 15- Legacy Error */Fapi_Error_InvalidHclkValue,/* Returned if FClk is above max FClk value - FClk is a calculated from HClk and RWAIT/EWAIT */Fapi_Error_InvalidCpu,/* Returned if the specified Cpu does not exist */Fapi_Error_InvalidBank,/* Returned if the specified bank does not exist */Fapi_Error_InvalidAddress,/* Returned if the specified Address does not exist in Flash or OTP */Fapi_Error_InvalidReadMode,/* Returned if the specified read mode does not exist */Fapi_Error_AsyncIncorrectDataBufferLength,Fapi_Error_AsyncIncorrectEccBufferLength,Fapi_Error_AsyncDataEccBufferLengthMismatch,Fapi_Error_FeatureNotAvailable/* FMC feature is not available on this device */
}ATTRIBUTE_PACKED Fapi_StatusType;

,

Green Deng:

收到,已经反馈给对方了

,

Green Deng:

C2000ware中的flashAPI例程能否执行呢?

目前看对方回复,好像他对这个问题也没什么方向。建议先从例程测试看看能否在flash中运行,然后对比例程来排除问题。

,

Bo XU:

您好,不好意思好像没有看到28377D的Flash API例程,可能是我没有找到,是否可以提供下路径。

,

Green Deng:

额,不好意思,不是Flash API的例程,是调用了FlashAPI的例程,flash programming example:

C:\ti\c2000\C2000Ware_4_01_00_00\device_support\f2837xd\examples\cpu1\flash_programming_dcsm\cpu01

赞(0)
未经允许不得转载:TI中文支持网 » TMS320F28377D: Flash api
分享到: 更多 (0)

© 2024 TI中文支持网   网站地图 鲁ICP备2022002796号-1