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.

TMS570LS0332: Unable to generate ECC codes as per 'ECC Handling in TMSx70-Based Microcontrollers - Section 1.5 table 3'

Part Number: TMS570LS0332

I have had a look at the ECC encoding algorithm based on the modified Hamming code (ECC Handling in TMSx70-Based Microcontrollers  - Section 1.5 Table 1), and noticed a few anomalies as specified below:

  • The ADDR_MSW_LSW for ECC bit 5 is missing.
  • The CPU Parity for ECC(5), ECC(0) are missing
  • The bits marked 'X' in the ECC encoding table do not match the ADDR_MSW_LSW for ECC0 - 554EA_B4D1B4D1_4B2E4B2E, ECC2 - 2A9B5_A699A699_A699A699 (Example: ECC(2) - bit 7 should be marked as a 'X' for LSW A699A699) and ECC3 - 6A78D_39E338E3_38E338E3

 I have described my idea of the ECC algorithm (Modified Hamming code) below: (The algorithm described below is as per ECC Handling in TMSx70-Based Microcontrollers  - Section 1.5 - Table 1)

 

ECC(7) = D0 XOR D1 XOR D2 XOR D3 XOR D4 XOR D5 XOR D6 XOR D7 XOR D24 XOR D25 XOR D26 XOR D27 XOR D28 XOR D29 XOR D30 XOR D31 XOR D40 XOR D41 XOR D42 XOR D43 XOR D44 XOR D45 XOR D46 XOR D47 XOR D48 XOR D49 XOR D50 XOR D51 XOR D52 XOR D53 XOR D54 XOR D55

 

ECC(6) = D0 XOR D1 XOR D2 XOR D3 XOR D4 XOR D5 XOR D6 XOR D7 XOR D24 XOR D25 XOR D26 XOR D27 XOR D28 XOR D29 XOR D30 XOR D31 XOR D32 XOR D33 XOR D34 XOR D35 XOR D36 XOR D37 XOR D38 XOR D39 XOR D56 XOR D57 XOR D58 XOR D59 XOR D60 XOR D61 XOR D62 XOR D63

 

ECC(5) = D8 XOR D9 XOR D10 XOR D11 XOR D12 XOR D13 XOR D14 XOR D24 XOR D25 XOR D26 XOR D27 XOR D28 XOR D29 XOR D30 XOR D40 XOR D41 XOR D42 XOR D43 XOR D44 XOR D45 XOR D46 XOR D56 XOR D57 XOR D58 XOR D59 XOR D60 XOR D61 XOR D62 XOR D63

 

ECC(4) = D2 XOR D3 XOR D4 XOR D5 XOR D6 XOR D7 XOR D14 XOR D15 XOR D18 XOR D19 XOR D20 XOR D21 XOR D22 XOR D23 XOR D30 XOR D31 XOR D34 XOR D35 XOR D36 XOR D37 XOR D38 XOR D39 XOR D46 XOR D47 XOR D50 XOR D51 XOR D52 XOR D53 XOR D54 XOR D55 XOR D62 XOR D63

 

ECC(3) = D0 XOR D1 XOR D5 XOR D6 XOR D7 XOR D11 XOR D12 XOR D13 XOR D16 XOR D17 XOR D21 XOR D22 XOR D23 XOR D27 XOR D28 XOR D29 XOR D32 XOR D33 XOR D37 XOR D38 XOR D39 XOR D43 XOR D44 XOR D45 XOR D48 XOR D49 XOR D53 XOR D54 XOR D55 XOR D59 XOR D60 XOR D61

 

ECC(2) = D0 XOR D3 XOR D4 XOR D9 XOR D10 XOR D13 XOR D15 XOR D16 XOR D19 XOR D20 XOR D23 XOR D25 XOR D26 XOR D29 XOR D31 XOR D32 XOR D35 XOR D36 XOR D39 XOR D41 XOR D42 XOR D45 XOR D47 XOR D48 XOR D51 XOR D52 XOR D55 XOR D57 XOR D58 XOR D61 XOR D63

 

ECC(1) = D0 XOR D1 XOR D2 XOR D4 XOR D6 XOR D8 XOR D10 XOR D12 XOR D16 XOR D17 XOR D18 XOR D20 XOR D22 XOR D24 XOR D26 XOR D28 XOR D32 XOR D33 XOR D34 XOR D36 XOR D38 XOR D40 XOR D42 XOR D44 XOR D48 XOR D49 XOR D50 XOR D52 XOR D54 XOR D56 XOR D58 XOR D60

 

ECC(0) = D1 XOR D2 XOR D8 XOR D17 XOR D18 XOR D24 XOR D38 XOR D44 XOR D47 XOR D54 XOR D60

1.1                 For data = 954F6D2F2992A9B6

I calculated the ECC (Without Parity considered) as 73.

If ECC bits 0,1,4,5,6,7 have an Even parity, and bits 2,3 have an odd parity, the actual ECC calculated is A6 (not AA as per ECC Handling in TMSx70-Based Microcontrollers  - Section 1.5 table 3).

 

1.2                 For data = 8F8342C3 E7DE1D53

I calculated the ECC (Without Parity considered) as C8.

If ECC bits 0,1,4,5,6,7 have an Even parity, and bits 2,3 have an odd parity, the actual ECC calculated is 1D.(Not 14 as per ECC Handling in TMSx70-Based Microcontrollers  - Section 1.5 table 3)

 

1.3                  For data = 554B0A86 A8F07BDB

I calculated the ECC (Without Parity considered) as 98.

If ECC bits 0,1,4,5,6,7 have an Even parity, and bits 2,3 have an odd parity, the actual ECC calculated is 4D (not 41 as per ECC Handling in TMSx70-Based Microcontrollers  - Section 1.5 table 3).

Could you please help me understand how the results in ECC Handling in TMSx70-Based Microcontrollers  - Section 1.5 table 3 have been derived?

Thank you.

  • Hi, our expert is out of office until 4/7. Please expect a delayed response.

    Also, please see this FAQ: software-dl.ti.com/.../index.html

  • For ECC bit 0/1/4/5/6/7, each ECC bit is the XOR of all the address and data bits marked with x in the same row

    For ECC bit 2 and 3, each ECC bit is the XOR of  1 and the row’s XOR result

    Just read your formula for ECC[0], I think it is not correct:

    The correct one should be:

    MSW-LSW: B4D1B4D1_4B2E4B2E

    ECC(0) <= DATA(1) xor DATA(2) xor DATA(3) xor DATA(5) xor DATA(8) xor DATA(9) xor DATA(11) xor DATA(14) xor

                DATA(17) xor DATA(18) xor DATA(19) xor DATA(21) xor DATA(24) xor DATA(25) xor DATA(27) xor DATA(30) xor

                DATA(32) xor DATA(36) xor DATA(38) xor DATA(39) xor DATA(42) xor DATA(44) xor DATA(45) xor DATA(47) xor

                DATA(48) xor DATA(52) xor DATA(54) xor DATA(55) xor DATA(58) xor DATA(60) xor DATA(61) xor DATA(63);

  • Noticed that the table1 in application note is for RM part rather than TMS570LSx part.

  • Hi QJ Wang, Thank you for your reply.

    If data (in hex) '03000503 00000000 0000C261 3C000000' is written at flash address 0x10000. What would be the ECC value calculated for this data?

    For the TMS570LS0332 microcontroller, I believe ECC data for address 0x10000 will be generated at address 0xF0402000. Is that correct? 

  • The address: 0x10000

    The ECC of data 0x3c000000 (at 0x10000), and 0x0000c261 (at 0x10004) is 0x76

    The ECC of data 0x00000000 (at 0x10008), and 0x03000503 (at 0x1000c) is 0x0A

    The ECC is written to flash starting at 0xF0400000 + 0x10000/8 = 0xF0402000

    0x76 is at 0xF0402000

    0x0A is at 0xF0402001

  • If 0x03000503 is located at 0x10000, and 0x3C000000 is at 0x1000C

    0x10000  --> 0x03000503

    0x10004  --> 0x00000000

    0x10008  --> 0x0000C261

    0x1000C  --> 0x3C000000

    The ECC is 0x92, and 0xE8