Hi,
Page 21/52 in SPNU501h states "The read functions do not combine main and ECC ranges. Because this, if you need a read operation
performed on the data and corresponding ECC, you must call the function for both. For example, if you
have erased Bank 0, Sector 0, you would need to perform a blank check on Sector 0 main address range
and ECC address range."
Does that mean if I have to check if part of flash is erased, I have to do the following:
1. Fapi_doBlankCheck(FlashData_StartAddress, length in words of flash to do blank check, FlashStatusWord)
2. Fapi_doBlankCheck(FlashECC Address for corresponding FlashData, length in words of ECC data, FlashStatusWord)
I did some testing for this operation:
1. Test a sample data to check if it is blank in Flash Bank7 Sector 0. I am only using Fapi_doBlankCheck for checking flash data and not its corresponding ECC data.
Case a: EE_ALL1_OK bit in EE_CTRL1 register is set to "not treat ALL 1s as ECC failure". Fapi_doBlankCheck returns success
Case b: EE_ALL1_OK bit in EE_CTRL1 register is cleared. Fapi_doBlankCheck returns failure and some of the bits are flipped to 1. I think it is because ECC tried to correct them.
2. Write 0xFFFF into flash and use Fapi_doBlankCheck to check if it is in erased state. I am only using Fapi_doBlankCheck for checking flash data and not its corresponding ECC data.
Case a: EE_ALL1_OK bit in EE_CTRL1 register is set to "not treat ALL 1s as ECC failure". Fapi_doBlankCheck returns success
Case b: EE_ALL1_OK bit in EE_CTRL1 register is cleared. Fapi_doBlankCheck returns success.
Why does it return success in Case b of test 2. Is writing 0xFFFF same as leaving the flash in erased state with ECC enabled? If No, why does blank check return success.
If the corresponding ECC also has to be verified to determine difference between erased state and the state where 0xFFFF is written into flash, why does this seem to work in Test 1.