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.

TMS570LC4357: Issue adding CRC to the end of a hex file

Part Number: TMS570LC4357

We are using a slightly modified version of the generic bootloader to load application images to a product in the field.  After loading the application image, the bootrom computes a CRC32.  It compares this CRC with a value loaded at the end of flash.  Our method for generating and flashing the CRC value is buggy.  I'd like to append the CRC to the end of the hex file and have something like tera-term load it. I've read the TI docs and Google'd the web for instructions on how to add a CRC to the generated hex image. I wish we had a better example.  From what I've read, this looks right to me.

I compared the hex file generated with this linker script with an older version that doesn't generate the CRC, expecting to find the only difference at the very end of the hex file.  There are differences throughout and there appears to be a lot of zero-fill records.  I don't want the zero-fill records because we use part of the otherwise unused flash for non-volatile parameters.  Below is the linker script, pruned for readability, that I came up with.  VECTORS0  and FLASH0 are for the bootrom to use.  I need the CRC at the end of FLASH, in CRC_SEC.  Any help is appreciated.  All I need there is the 32-bit CRC value.

MEMORY
{
    VECTORS0 (X)    : origin=0x00000000 length=0x00000020
    VECTORS (X)     : origin=0x00200000 length=0x00000020
    FLASH0  (RX)    : origin=0x00000020 length=0x001FFFE0
    FLASH   (RX)    : origin=0x00200020 length=0x001FFEE0
    CRC_SEC (RX)    : origin=0x003FFF00 length=0x00000100
    TRAMPOLINE (RW) : origin=0x08000000 length=0x00000020
    STACKS  (RW)    : origin=0x08000020 length=0x000107E0
    RAM     (RW)    : origin=0x08010800 length=0x0006f800

}
SECTIONS
{
    /* Custom sections declaration for VST application with CRC generation */
    .intvecs : {} > VECTORS
    .bss     : {} > RAM
    .data     : {} > RAM
    .sysmem  : {} > RAM

    GROUP (TEXTMEM)
    {
    .text    align(32) : {}
    .const    align(32) : {}
    .cinit    align(32) : {}
    .pinit    align(32) : {}
    /* FEE_* sections must be 32-bit aligned */
    FEE_TEXT_SECTION  align(32) : {}
    FEE_CONST_SECTION align(32) : {}
    } > FLASH, crc_table(vst_crc_table, algorithm = CRC32_PRIME)

    FEE_DATA_SECTION  align(32) : {} > RAM

    .TI.crctab: > CRC_SEC
}