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.
F021的库是:F021_API_CortexR4_BE_L2FMC_V3D16.lib
在对Fapi_FlashBank7 写时,如果数据长度不是8,就会写错误,Fapi_issueProgrammingCommand()报 Fapi_Error_AsyncIncorrectDataBufferLength。
如:
void Internal_FLASH_write(uint32 addr, uint8* buff, uint8 len)
{
Fapi_StatusType oReturnCheck = Fapi_Status_Success;
oReturnCheck = Fapi_initializeFlashBanks(150);
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_DataOnly);
/* Place specific example code here */
/* Wait for FSM to finish */
while(FLASH_CONTROL_REGISTER->FmStat.FMSTAT_BITS.BUSY == Fapi_Status_FsmBusy);
}
}
uint8 write_buff[16]={0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35,0x35};
Internal_FLASH_write(0xF0200000, write_buff, 16);
就会写错误,Fapi_issueProgrammingCommand()报 Fapi_Error_AsyncIncorrectDataBufferLength。
Fapi_Error_AsyncIncorrectDataBufferLength (failure: Data buffer size specified exceeds Data bank width)