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.

RM57L843: Linker command file for ECC generation

Part Number: RM57L843

Hello, 

Considering the linker command file for ECC generation for the RM57x:

What is the correct address_mask of the ECC algorithm? 0xfffffff8 or 0x003ffff8

What is the correct "palign"? 32 or 8

This is the file I am using.

//----------------------------------------------------------------------------
// Linker Settings
//----------------------------------------------------------------------------

--retain="*(.intvecs)"

//----------------------------------------------------------------------------
// ECC algorithm
//----------------------------------------------------------------------------
ECC
{
    algoL2R5F021 : address_mask = 0xfffffff8 /* Address Bits 31:3 */
    hamming_mask = R4         /* Use R4/R5 build in Mask */
    parity_mask  = 0x0c       /* Set which ECC bits are Even and Odd parity */
    mirroring    = F021       /* RM57Lx and TMS570LCx are build in F021 */
}

//----------------------------------------------------------------------------
// Memory Map
//----------------------------------------------------------------------------
MEMORY
{
  //----------------------------------------------------------------------------
  // On-chip FLASH, 0x00000000-0x003FFFFF = 4Mx16bits.
  //----------------------------------------------------------------------------
        //----------------------------------------------------------------------------
        // On-chip FLASH0, 0x00000000-0x00200000 = 2Mx16bits.
        //----------------------------------------------------------------------------
        VECTORS       (X)  : origin=0x00000000  length=0x00000020 vfill = 0xFFFFFFFF
        FLASH0       (RX)  : origin=0x00000020  length=0x001FFFE0 vfill = 0xFFFFFFFF
        //----------------------------------------------------------------------------
        // On-chip FLASH1, 0x00200000-0x003FFFFF = 2Mx16bits.
        //----------------------------------------------------------------------------
        FLASH1       (RX)  : origin=0x00200000  length=0x00200000 vfill = 0xFFFFFFFF

        //----------------------------------------------------------------------------
        // ECCs
        //----------------------------------------------------------------------------
        ECC_VEC      (R)   : origin=(0xf0400000 + (start(VECTORS) >> 3)) length=(size(VECTORS) >> 3) ECC={algorithm=algoL2R5F021, input_range=VECTORS}
        ECC_FLA0     (R)   : origin=(0xf0400000 + (start(FLASH0) >> 3))  length=(size(FLASH0) >> 3)  ECC={algorithm=algoL2R5F021, input_range=FLASH0}
        ECC_FLA1     (R)   : origin=(0xf0400000 + (start(FLASH1) >> 3))  length=(size(FLASH1) >> 3)  ECC={algorithm=algoL2R5F021, input_range=FLASH1}

  //----------------------------------------------------------------------------
  // On-chip RAM, 512Kx16bits (0x08000000-0x0807FFFF)
  //----------------------------------------------------------------------------
        //----------------------------------------------------------------------------
        // (0x0800000-0x080015FF): Stack
        //----------------------------------------------------------------------------
        STACKS       (RW)  : origin=0x08000000  length=0x00001600
        //----------------------------------------------------------------------------
        // (0x08001500-0x0807FFFF): RAM
        //----------------------------------------------------------------------------
        RAM          (RW)  : origin=0x08001600  length=0x0007E200
        ST_ECC_FLASH (RWX) : origin=0x0807f800  length=0x00000800
  //----------------------------------------------------------------------------
  // External SDRAM, 4Mx32bits  (0x80000000 - 0x803FFFFF)
  //----------------------------------------------------------------------------
      SDRAM          (RWX) : origin=0x80000000  length=0x00400000
}
//----------------------------------------------------------------------------

//----------------------------------------------------------------------------
// Section Configuration
//----------------------------------------------------------------------------
SECTIONS
{
    .intvecs          : {} > VECTORS
    
    // Initialized executable code and constants.
    .text        palign(32) : {} > FLASH0 | FLASH1

    // Initialized constant data.
    .const       palign(32) : {} > FLASH0 | FLASH1

    // Initialized global and static variables.
    .cinit       palign(32) : {} > FLASH0 | FLASH1
    .pinit       palign(32) : {} > FLASH0 | FLASH1
    .init_array  palign(32) : {} > FLASH0 | FLASH1
    .bss                    : {} > RAM
    .data                   : {} > RAM
    .sysmem                 : {} > RAM
    .stack                  : {} > STACKS
}
//----------------------------------------------------------------------------

Thanks,

Marcio.