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: Data error when chip writes internal flash

Part Number: LAUNCHXL2-RM57L
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:

https://e2echina.ti.com/cfs-file/__key/communityserver-discussions-components-files/96/Internal-flash.zip

Could you help check this case? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    If the ECC is calculated and programmed when you writing data to flash, the memory window should display the data correctly. If the ECC is not programmed, you will see the wrong data in the memory browser window. 

    The screenshot is too small for me to read the content.

    I noticed that the ECC is generated when you program the flash. The RM57 supports CPU frequency up to 330MHz, and system clock is 165MHz. Why do you use 180MHz in your code:

    oReturnCheck = Fapi_initializeFlashBanks(180);

  • Hi,

    Sorry for the bad screenshot.

    Is the image above clear?

    Thanks and Best Regards,

    Cherry

  • It looks like the ECC value is not correct. The flash and SRAM are protected by ECC. The ECC can be programmed into the flash array along with the actual application code using flash API.