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.

TMS320F28377D: C Sample codes for Fapi_calculateEcc() and __addr32_read_uint16()

Part Number: TMS320F28377D


Hello,

Could you please tell me sample codes for the titled functions ?

My best finding was an another thread. I will try that tomorrow, but I needed to ask a TI generated code.

https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/432319/1547330

  • Hideaki,

    1. __addr32_read_uint16(): This is an intrinsic provided to read the higher address memory (address width more than 22 bits). As you may know, Flash ECC space is mapped at higher address in F2837xD. Hence, we suggested to use this intrinsic (syntax is in TRM) for CPU reads of higher address memory. However, this is not required anymore if you use the latest C28x compiler and you can code for this ECC memory reads like you code for the lower address range.

    2. Fapi_CalculateEcc() takes a uint32 (unsigned long) address and uint64 (unsigned long long) data. You have to provide a 64-bit aligned address and the corresponding 64-bit data to this function. Note that the address has to be left shifted by 1 position before passing to this function. This function gives 8-bit ECC (upper 8-bits of the return variable will be 0x00) for the address and data that you provide.

    For example,
    uint16 ECC_data = 0;
    uint32 64_bit_aligned_address = 0x82000;
    uint64 64bit_data_at_0x82000 = 0x0123456789ABCDEF;

    ECC_data = Fapi_CalculateEcc (64_bit_aligned_address << 1, 64bit_data_at_0x82000);

    Thanks and regards,
    Vamsi