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.

TMS570LC4357: Fapi_issueProgrammingCommand and ECC encoding

Part Number: TMS570LC4357

Tool/software:

a)in Fapi_issueProgrammingCommand(), if Fapi_AutoEccGeneration is specified in oMode, do we need to specify the pu8EccBuffer [in] pointer to the ECC buffer address or should be 0?

For example for the below code, do we need to specify the ECC address 
(uint8_t *)0xF047C000?

uint8_t u8_dummy_buff[8] = { 0xA2, 0xB4, 0x63, 0xD8, 0x9A, 0xBC, 0xDE, 0xEF};

u32_fapi_res = Fapi_issueProgrammingCommand((uint32_t *)0x003E0000,
&u8_dummy_buff[0],
8,
(uint8_t *)0xF047C000,
0,
Fapi_AutoEccGeneration);

b) I am unable to understand the ECC encoding specified in Table 7-1 in SPN563A where it mentions ADDR_MSW_LSW? Do these addresses ADDR_MSW_LSW represent flash as the memory map for Flash  ranges from 0x00000000 to 0x3FFFFF but the address in ADDR_MSW_LSW seem to be something different?

c) In the example in a), I am not clear how the ECC is computed for data in u8_dummy_buff using Table 7-1 in SPN563A? Please can you explain for this example how it would calculate ECC bits using address and data bits?

  • Hi Veena,

    My apologies for the delayed response.

    a)in Fapi_issueProgrammingCommand(), if Fapi_AutoEccGeneration is specified in oMode, do we need to specify the pu8EccBuffer [in] pointer to the ECC buffer address or should be 0?

    For Fapi_AutoEccGeneration the ECC values are calculated automatically for the input data and will be programmed into the corresponding ECC section. So, we no need to give the ECC buffer in this case.

    Yes, it should be zero.

    Here is the example code:

    b) I am unable to understand the ECC encoding specified in Table 7-1 in SPN563A where it mentions ADDR_MSW_LSW? Do these addresses ADDR_MSW_LSW represent flash as the memory map for Flash  ranges from 0x00000000 to 0x3FFFFF but the address in ADDR_MSW_LSW seem to be something different?

    It is generic encoding algorithm to determine the ECC bits.

    For example, the below highlighted ADDR_MSW_LSW value represents the which Address and data bits are needed to be XOR for to calculate ECC 7th bit.

    A bit-1 in the ADDR_MSW_LSW represents the corresponding bit value should need to be XOR for ECC generation.

    This entire algorithm is internal so no need to spend much time on it.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagdish,

    Thanks for the reply. I need to understand the details for verification purposes to check that the correct ECC is being written at the correct location.

    Regarding my question in b), I am trying to figure which row would I need to use in the example in a) - please can you clarify that for the example and how you arrive at that?  

    For ADDR_MSW_LSW , which address should we use i.e is it the programming address or ECC address?

  • Hi Veena,

    You need to use all the rows for every write, i mean if you verify clearly each row calculates one bit of the ECC only. So, to get 8-bit ECC for your 64-bit data, you need to use all the rows. The ECC will always calculate for multiples of 64-bit data only.

    I created one excel for ECC verification, please refer it once:

    ECC_calculation_Big_Endian_Devices(LC4357).xlsx

    What i did in above excel is that, i implemented entire encoding algorithm. For example as you can see to calculate ECC[0] bit i did xor of all the mentioned bits in TRM encoding table.

    So, all you just need to do here is that, enter your inputs in the orange cells and you will get the output ECC in the green cell.

    For example, as you can see in above picture, if i write data 0xEEFF0011AABBCCDD at 0x21FFF0 means then i will get the ECC value as 0x2E in corresponding ECC location.

    I tested this in practical also:

    You can see above picture 0xEEFF0011AABBCCDD at 0x21FFF0 and in a result controller wrote the 0x2E into corresponding ECC memory location.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagdish,

    a)Thanks for the spreadsheet. I implemented and tested a few scenarios and verified using the spreadsheet you sent. It worked in most scenarios but  I found that in one case so far that the ECC reported in flash did not match the one computed in the spreadsheet. The flash address that was programmed is 0x0003E0000 and the data was :

    AABBCCDD EEFF0016

    The spreadsheet that you sent gives ECC as 93, but the ECC in 0xF047C000 is 12. Please can you try this scenario at your end and check if you are seeing the same issue?

  • Hi Veena,

    I was OFF for few days and didn't get a chance to go through this issue.

    Are you still stuck with this issue? If yes, then i will create an example to verify it from my end.

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagdish,

    Yes I am still waiting for an answer on this issue. Please can you verify at your end what ECC you see in the memory browser. Thanks.

  • Hi Veena,

    I tested this condition, and i got correct result only.

    I am suspecting maybe interpretation of data is wrong, the way we are understanding data stored in memory creates this problem.

    So, i am suggesting you keep the data in 32-bit TI style and see the data:

    If we keep like this then as highlighted in above the LSW will be stored at address 0x3E0000 and MSW will be at the address 0x3E0004. And the corresponding ECC value is 0x93.

    And i entered above MSW and LSW into the excel and i got the same ECC of 0x93:

    Can you try to verify in the same way at your end once?

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagdish,

    Thanks for checking for me. I had the bytes for MSW and LSW swapped. It works for me with MSW/LSW corrected.