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.

TMS570LS2124: F021 API for blank check

Part Number: TMS570LS2124

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.

  • Hello Suman,

    I am forwarding your question to our software team so that the Flash API expert can provide direct support.
  • Hi Suman,

    - Yes Blankcheck must be performed for bothe Flash and FlashECC region to confirm the Erase operation is successful.

    - When Flash Banks are erased all ar F's including the ECC regions. But FOr All F's , F's are not the corresponding ECC. Hence after erase of Flash and its corresponding ECC, if you try to read the Flash location with ECC enabled it will throw error, the bit EE_ALL1_OK bit in EE_CTRL1 is used to avoid this error. Hence if you clear this bit and read ECC error will occur.

    - When data of 0xFFFF is written, the corresponding ECC ( which are not all F's) will be programmed to the corresponding location. Now Flash region is All F's but the ECC region has valid ECC values. No matter you have EE_ALL1_OK bit in EE_CTRL1 as 1 or 0 there should be no difference.