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: ECC algorithm discrepancies

Part Number: TMS570LS0332


Hi,

one of our customers needs a detailed understanding of the ECC algorithm on the Hercules TMS570LS0332. They are not able to enable the ECC.

 

The customer 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 https://www.tij.co.jp/jp/lit/an/spna126/spna126.pdf ), 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
  • ECC3 - 6A78D_39E338E3_38E338E3

 

Could you please help understand the ECC algorithm?

The observed results do not match the ones in ECC Handling in TMSx70-Based Microcontrollers  - Section 1.5 Table 3 https://www.tij.co.jp/jp/lit/an/spna126/spna126.pdf 

In summary, the customer understands the ECC algorithm as follows:

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

Please correct where needed.

Thanks!

--Gunter

    • 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
    • ECC3 - 6A78D_39E338E3_38E338E3

    You are correct. The apps note (spna126.pdf) missed the value under the column ADDR_MSW_LSW for ECC bit5, and missed value of parity for ECC[5] and ECC[0] in Parity Column. Several fields of WCC0/ECC2/ECC3 rows that marked with "x" are not matching the the hex data code under the ADDR_MSW_LSW column. I think this is a result of file conversion. 

    I also mentioned in my response yesterday that this table is for RM4x parts rather than TMS570LSx parts. 

    Please use the Table 4-1 in device TRM: https://www.ti.com/lit/ug/spnu517c/spnu517c.pdf 

  • 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