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.

Fapi_HardwareCalculateECC

Hello,

I'm building code that will load the operational program into the internal flash for the TMS570LS20126 processor and I need also to program the ECC. The Fapi_HardwareCalculateECC() function from the Flash API is marked as unreliable in spnz185 Errata document. However in spnu493c document, table 5, this function is said to be corrected in API version 1.05.

1. Was the problem discussed in spnz185 corrected in API version 1.05?

2. As far as I understand from spnu493c for  Fapi_HardwareCalculateECC() function description, the 16 bit RAM buffer passed to it to get the ECC codes, can be passed to Flash_Prog_B() function as a 32 bit array. Is that correct?  In the post I found on E2E, the engineer said that those 16 bit values need to be copied 4 times into another buffer, which will be used for programming. If so, this is not clear to me  why and how. The spnu493c quotes: "The user must provide a data buffer in which the newly calculated ECC bits will be stored. This data can then be programmed in Flash using the usual programming method." Am I not understanding the API manual? Here is the link for the post:   http://e2e.ti.com/support/microcontrollers/hercules/f/312/t/139086.aspx?pi24527=1

Thanks,

 

Alex

  • Alex

    Thanks for using forum. I will respond to you as soon as I find the info

  • Hello Alex,

    The issue referred to in spnz185 was corrected in v1.06 of the API.

    The calculate ECC function is calculating the ECC for 128bits of data, returning 16bits of ECC data.

    The Platform F035 Flash ECC uses a mirroring scheme for ECC where the 16bit ECC value is repeated 3 additional times in the memory map.  Therefore for the programming function to work correctly, you need to pass to it the same 16bit value 4 times.

    So for memory locations:

    0x000 --> ECC address is 0x400000, 0x400002, 0x400004, 0x400006

    0x008 --> ECC address is 0x400001, 0x400003, 0x400005, 0x400007

  • John,

    It looks like the pu16EccData buffer returned by Fapi_HardwareCalculateEcc() is filled with four exact values in every four consecutive locations and it is filled up all the way to the end (u32Length size as provided). The length (u32Length) provided as an input to the function is the number of 32 bit words in the Flash for which the ECC is calculated. Quote from the API manual:

    "Number of 32-bit words for which ECC will be calculated. The "pu16EccData" buffer size needs to be "u32Length number of 16-bit words. The value of length is required to be multiples of 4."

    Therefore, it looks to me as this buffer can be used to program the ECC Flash as is, after it is returned by the function. If you disagree, please explain.

    Thanks,

    Alex