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.

LAUNCHXL2-RM57L: 芯片写内部flash时数据出现乱码?

Part Number: LAUNCHXL2-RM57L
Other Parts Discussed in Thread: RM57L843

使用RM57L843开发板读写内部flash时,发现写入的数据会出现错误

比如我全写35,但有些地址上的数据会出现错误

写内部flash的代码如下:

void Internal_FLASH_write(uint32 addr, uint8* buff, uint8 len)
{
Fapi_StatusType oReturnCheck = Fapi_Status_Success;
oReturnCheck = Fapi_initializeFlashBanks(180);
if((oReturnCheck == Fapi_Status_Success) && (FLASH_CONTROL_REGISTER->FmStat.FMSTAT_BITS.BUSY != Fapi_Status_FsmBusy))
{

if( (addr >= 0x00000000) &&(addr <= 0x003FFFFF) )
{
if(addr <= 0x003FFFFF)
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank0);
else
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank1);
oReturnCheck = Fapi_enableMainBankSectors(0xffff);
}
else if( (addr >= 0xF0200000 ) && (addr<= 0xF021FFFF))
{
oReturnCheck = Fapi_setActiveFlashBank(Fapi_FlashBank7);
oReturnCheck = Fapi_enableEepromBankSectors(0xffffffff ,0xffffffff);
}
while(FLASH_CONTROL_REGISTER->FmStat.FMSTAT_BITS.BUSY == Fapi_Status_FsmBusy);
oReturnCheck = Fapi_issueProgrammingCommand((uint32_t*)(addr), buff, len, 0, 0, Fapi_AutoEccGeneration);
/* Place specific example code here */
/* Wait for FSM to finish */
while(FLASH_CONTROL_REGISTER->FmStat.FMSTAT_BITS.BUSY == Fapi_Status_FsmBusy);
}
}

我的工程如下Internal flash.zip