Other Parts Discussed in Thread: RM57L843
Hi team,
Issue: when reading or writing an internal flash using the RM57L843 development board, an error occurs with the data written. For example, write all 35, but the data on some of the address are wrong , as shown in the following figure:

The code to write the internal flash is as follows:
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);
}
}
And the engineering is as follows:
Could you help check this case? Thanks.
Best Regards,
Cherry
