Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed the week of November 23.

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.

CCS: TMS570LC4357 Pre-crc(crc_table in linker script) with Safe Ti library

Other Parts Discussed in Thread: TMS570LC4357

Tool/software: Code Composer Studio

I use TMS570LC4357 chip and Safe Ti Library.

I want to crc_table which is generated in Linker script to confirm the binary safety(the binary has no problem)

I make the linker script  as follows. I check the crc_table made well. But self-diagnosis test is fail. I want to know how I can generate the pre-crc table by linker without Self-Diagnosis test fail.

- Linker script Code -

/*----------------------------------------------------------------------------*/
/* sys_link.cmd                                                               */
/*                                                                            */
/* (c) Texas Instruments 2009-2013, All rights reserved.                      */
/*                                                                            */


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

--retain="*(.intvecs)"
--entry_point=_c_int00

/*----------------------------------------------------------------------------*/
/* Memory Map                                                                 */

MEMORY
{

    VECTORS (X)    : origin=0x00000000 length=0x00000020
    FLASH0  (RX)   : origin=0x00000020 length=0x001FFFE0
    FLASH1  (RX)   : origin=0x00200000 length=0x00200000

    STACKS  (RW)   : origin=0x08000000 length=0x00021700/*0x00021800->0x00021700*/
    RAM (RW)   : origin=0x8021800 length=0x19000
    HIGH_HANDLER     (RWX)  : origin=0x803A800 length=0x000800
    PROFILE(RW)    : origin=0x803B000 length=0x00008000 /* Added for profiling purposes */
    LOG (RW)    : origin=0x8043000 length=0x00003000 fill=0xDEADBEEF/* Added for logging purposes */
    FEE (R)    : origin=0xF0200000 length=0x00000064 fill=0xDEADBEEF /* For FEE testing, Valid only for sample application */

}


/*----------------------------------------------------------------------------*/
/* Section Configuration                                                      */

SECTIONS
{
    .intvecs : {} palign=32, fill=0xff , crc_table(_my_crc_table, algorithm=TMS570_CRC64_ISO) > VECTORS
 .excpt_vecs  : START( ulFlashStartAddr ) {} > VECTORS
    .sl_stflash_SRAM    : RUN = HIGH_HANDLER, LOAD = FLASH0|FLASH1, LOAD_START(ulHighHandlerLoadStart), LOAD_END(ulHighHandlerLoadEnd),
          LOAD_SIZE(ulHighHandlerSize), RUN_START( ulHighHandlerStartAddr ), RUN_END( ulHighHandlerEndAddr )
    .text   align(32)   : {} palign=8, crc_table(_my_crc_table, algorithm=TMS570_CRC64_ISO) >  FLASH0|FLASH1
    .const  align(32)   : {} palign=8, crc_table(_my_crc_table, algorithm=TMS570_CRC64_ISO) > FLASH0|FLASH1 END( ulFlashEndAddr )
    .cinit  align(32)    : {} palign=8, crc_table(_my_crc_table, algorithm=TMS570_CRC64_ISO) > FLASH0|FLASH1
    .pinit  align(32)    : {} palign=8, crc_table(_my_crc_table, algorithm=TMS570_CRC64_ISO) > FLASH0|FLASH1

    .TI.crctab  : {} palign=8 > FLASH0 | FLASH1 /* The CRC tables generated by the linker are created in the special section .TI.crctab */

    .STACK_DATA_svc     : {. += 1024;} > STACKS, RUN_START(StackModeSVC)
    .STACK_DATA_fiq     : {. += 500;} > STACKS, RUN_START(StackModeFIQ)/* 1024-> 500*/
    .STACK_DATA_irq     : {. += 1024;} > STACKS, RUN_START(StackModeIRQ)
    .STACK_DATA_abt     : {. += 1024;} > STACKS, RUN_START(StackModeABT)
    .STACK_DATA_und     : {. += 1024;} > STACKS, RUN_START(StackModeUND)
    .STACK_DATA_sys     : {. += 132096;} > STACKS, RUN_START(StackModeSYS)
    .bss      : {} > RAM
    .data      : {} > RAM
    .sysmem  : {} > RAM

    LOG_DATA   : START( ulLOGStartAddr ), END( ulLOGEndAddr ) > LOG
    PROFILE_DATA        : START( ulPROFILEStartAddr ), END( ulPROFILEEndAddr ) > PROFILE
}

/*----------------------------------------------------------------------------*/
/* Misc                                                                       */
/*----------------------------------------------------------------------------*/

Regards,

Minwoo

  • Hello Minwo,

    You can use the crc_value in the crc_table as the pre-determined crc value. This crc_value is calculated by the script in your linker cmd file. Your c/c++ code calculate the CRC value using CRC HW module, then compare the CRC value in PSA signature registers to the CRC value in crc table.

    /*********************************************************/

    /* CRC Record Data Structure */

    /* NOTE: The list of fields and the size of each field */

    /* varies by target and memory model. */

    /*********************************************************/

    typedef struct crc_record

    {

    uint64_t crc_value;

    uint32_t crc_alg_ID; /* CRC algorithm ID */

    uint32_t addr; /* Starting address */

    uint32_t size; /* size of data in bytes */

    uint32_t padding; /* explicit padding so layout is the same */

    /* for COFF and ELF */

    } CRC_RECORD;

    /*********************************************************/

    /* CRC Table Data Structure */

    /*********************************************************/

    typedef struct crc_table

    {

    uint32_t rec_size;

    uint32_t num_recs;

    CRC_RECORD recs[1];

    } CRC_TABLE;