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.

MSPM0L1306: using Flash ECC to detect memory corruption.

Part Number: MSPM0L1306

Hi TI,

I am trying to read and write from flash, and wish to use ECC functionality to detect data corruption.

I am using mspm0_sdk_1_00_01_03, dl_flashctl.h. 

could someone please check the understanding?:

1. to write a 64-bit word with ECC into flash, i shall call

DL_FlashCTL_unprotectSector, and then call

DL_FlashCTL_programMemoryFromRAM64WithECCGenerated, which allow me to write a 64bit data, into a flash address. The function also generate a ECC for me, then write it into the ECC memory.

2. to read a 64-bit word, and ensure there is no memory corruption, i shall

readback the data from flash using pointer,  and then call

DL_FlashCTL_readVerifyFromRAM64WithECCGenerated. The function generate a ECC base on the data input(readback value), and compare the ECC and readback value against what is in flash memory. the function return true if everything matches. and return false if something is wrong.

3. hardware generation of the ECC code is by default enabled. Is there a way to check/configure this?

4. programming of the ECC code is by default disabled, but it is enabled whenever the above 2 functions are called

Thank you very much!

  • Hi xiaofeng,

    You are right for the comprehension. By the way, I suggest you using the SDK version 1.10 and with CCS12.4. it is fewer issue about flash usage in the previous version.

    3. hardware generation of the ECC code is by default enabled. Is there a way to check/configure this?

    If you do not want generate the ECC code, you can use "DL_FlashCTL_programMemoryFromRAM32". If you do not generate the ECC, be careful that you do not read the data with ECC check. All the operation code can be found in driverlib.(dl_flashctl.c).

    4. programming of the ECC code is by default disabled, but it is enabled whenever the above 2 functions are called

    You call the APII function which can generate EEC or not generate ECC.

    B.R.

    Sal