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.

RM57L843: Writing to flash bank 7 using Fapi_AutoEccGeneration is not working.

Part Number: RM57L843

Tool/software:

Hi,

I have a program where I want to write a 32-byte buffer to flash bank 7 starting at 0xF0200000. I am initializing and erasing the bank, then writing 4 consecutive 8-byte buffers with no errors from Fapi commands:

  1. Fapi_setActiveFlashBank(Fapi_FlashBank7) = Fapi_Status_Success
  2. Fapi_enableEepromBankSectors(0xFFFF, 0x0000) = Fapi_Status_Success
  3. Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, 0xF0200000) = Fapi_Status_Success
  4. Fapi_issueProgrammingCommand((uint32_t *)0xF0200000, srcAddr, 8, 0, 0, Fapi_AutoEccGeneration) returns Fapi_Status_Success. I increment the dst and srcAddr addresses 8 bytes and repeat another 3 times to flash the entire 32-byte buffer.

But then when my application tries to read what was written to flash memory using memcpy, random bytes are sticky. Here is an example of trying to write 32 consecutive 0s to bank 7, starting at 0xF0200000, then reading them back using memcpy:

Everything should be 0, but addresses 0xF0200000 + 4, 8, 11, & 16 are not 0. Rerunning the erase and write and/or rebooting the board and rerunning show the same addresses as sticky. The only solution I have found using Fapi_DataOnly instead of Fapi_AutoEccGeneration in the Fapi_issueProgrammingCommand() calls, but I still want to use ECC in these writes/reads.

How can I fix this? I want a seamless way to write configuration data to bank 7, then read it as a data struct on future startups.