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.

TMS470MF03107: The Flash ECC algorithm source code in C language for TMS470MF03107

Part Number: TMS470MF03107
Other Parts Discussed in Thread: NOWECC

Hi,

    I want to do a loader to write(burn) flash ecc memory of  TMS470MF03107,but I do not know the ECC generate algorithm for  TMS470MF03107.

   Woud you give the  Flash ECC algorithm source code in C language for TMS470MF03107?

  As while,I hear that there is an ECC generate tool which is named with nowECC for  TMS470MF03107.

  But i can not download it(NowECC).

  Would you help me?

  Thank you very much.

Best regards~

Xin Chen

  • Hi Xin,

    Do you mean you want to develop a bootloader to program the application to flash and calculate and program the ECC to the ECC memory space?

    TMS470M use F035 flash API which doesn't have the feature of generating the ECC automatically. But you can use flash registers (FEMU_ECC, FEMU_DMSW, FEMU_DLSW, FEMU_ADDR) to calculate the ECC based on the code and its address.
  • Hi,QJ Wang,

    Yes,I do.

    Yes,I have found F035 flash API does not have the feature of generating the ECC automatically.

    If I use flash registers to generate,something is not clearly,would you help me check it?
    Q1:What is the procedure of ECC generating using these registers?

    Q2:What is the logic memory map between flash and associated ECC memory?
    Could I refer to "Figure 7-3. ECC Word Memory Mapping in CPU Address Space" in "SPNU495C" document?

    Thank you very much.
    Best regards~
    Xin Chen
  • Hello Xin,

    I wrote a function to calculate the ECC using F035:

    static uint8 Flash_ECC_Calc(uint32* Flash_Address, uint32* pdata)

    {

    uint8 ECC;

    uint32 femuAddr, femuDataLSW, femuDataMSW;

    //Disable the Diagnostic mode

    flashWREG->F035_FDIAGCTRL = 0x0;

       do{

    flashWREG->F035_FEMUADDR = (uint32)Flash_Address;

    femuAddr = flashWREG->F035_FEMUADDR;

       }while(femuAddr != (uint32)Flash_Address);

    //write known data into Emulation data registers

       do{

    flashWREG->F035_FEMUDLSW = (uint32)( *pdata);

    femuDataLSW = flashWREG->F035_FEMUDLSW;

       }while(femuDataLSW != *pdata);

       pdata++;

    do{

    flashWREG->F035_FEMUDMSW = (uint32)( *pdata);

    femuDataMSW = flashWREG->F035_FEMUDMSW;

    }while(femuDataMSW != *pdata);

    ECC = flashWREG->F035_FEMUECC & 0xFF;

    return ECC;

    }

  • Hi,QJ Wang,

    Thanks for your sample code.
    There is another question.

    If the value of two continuous flash words which is 8-byte alignment are blank value(0xFFFFFFFF,0xFFFFFFFF),
    can I keep the associated ECC byte as blank value(0xFF)?

    Thank you very much.
    Best regards~
    Xin Chen
  • Hi,QJ Wang,
    I have implemented the F035 ECC algorithm,and write the flash memory and associated ECC memory.
    But I am not sure that the result is right.
    I have capture two memory storage view.One is flash storage view which starts from 0x0000.The other is its ecc data storage view which starts from 0x400000. See below figure.
    Would you kindly help check it?
    Thank you very much.

    Best regards~
    Xin Chen