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/TMS570LS0432: Linker stucks when memory area is defined with 'fill'

Part Number: TMS570LS0432

Tool/software: Code Composer Studio

Hello,

I faced with one strange behavior during armlnk.exe usage, hope somebody could help me with it.

I want to fill unused area of the memory with predefined pattern, but as soon as I try to use fill option, linker reports the error or even stucks:

<Linking>

INTERNAL ERROR: C:\ti\ccsv7\tools\compiler\ti-cgt-arm_16.9.4.LTS\bin\armlnk.exe experienced an unhandled exception

This is caused by a defect in the TI Linker.
TI Customer Support may be able to suggest a workaround to avoid this.

Upgrading to the newest version of the compiler may fix this problem.

Contact TI in the E2E support forums at http://e2e.ti.com under
"Development Tools", "TI C/C++ Compiler".  See the link titled
"Submitting an issue".

We need to see this ENTIRE error message and a complete, reproducable
test case including ALL of the command-line options.
Include all of the object files, libraries, and linker command files
used to link the program.


>> Compilation failure

Without fill option everything works pretty nice, but for sure I have some uninitialized area.

Here is content of two linker files:

1. LinkFile.cmd - without filling memory, works nice

/*----------------------------------------------------------------------------*/
/* Linker Settings                                                            */
--retain="*(.intvecs)"


/*----------------------------------------------------------------------------*/
/* Memory Map                                                                 */
MEMORY
{
    VECTORS         (X)     : origin=0x00000000 length=0x00000020
    BOOT_FLASH      (RX)    : origin=0x00000040 length=0x00001FC0
    LOADER_FLASH    (RX)    : origin=0x00002000 length=0x00006000
    APP_LENGTH      (R)     : origin=0x00008000 length=0x00000004
    APP_CRC         (R)     : origin=0x00008004 length=0x00000004
    APP_ID          (R)     : origin=0x00008008 length=0x00000004
    APP_PN0         (R)     : origin=0x0000800C length=0x00000004
    APP_PN1         (R)     : origin=0x00008010 length=0x00000004
    APP_PN2         (R)     : origin=0x00008014 length=0x00000004
    APP_PN3         (R)     : origin=0x00008018 length=0x00000004
    APP_VECTORS     (RX)    : origin=0x0000801C length=0x00000024
    APP_FLASH       (RX)    : origin=0x00008040 length=0x00017FC0
    UNUSED_FLASH    (RX)    : origin=0x00020000 length=0x00040000
    STACKS          (RW)    : origin=0x08000000 length=0x00001500
    RAM             (RW)    : origin=0x08001500 length=0x00006B00

    GIO_REGS        (RW)    : origin=0xFFF7BC00 length=0x00000100
    MIBADC_REGS     (RW)    : origin=0xFFF7C000 length=0x00000200
    DCAN1_REGS      (RW)    : origin=0xFFF7DC00 length=0x00000200
    DCAN2_REGS      (RW)    : origin=0xFFF7DE00 length=0x00000200
    FLASH_REGS      (RW)    : origin=0xFFF87000 length=0x00001000
    SCI_REGS        (RW)    : origin=0xFFF7E400 length=0x00000100
    SPI1_REGS       (RW)    : origin=0xFFF7F400 length=0x00000200
    SPI2_REGS       (RW)    : origin=0xFFF7F600 length=0x00000200
    SPI3_REGS       (RW)    : origin=0xFFF7F800 length=0x00000200
    RTI_REGS        (RW)    : origin=0xFFFFFC00 length=0x00000100
    IOMM_REGS       (RW)    : origin=0xFFFFEA00 length=0x00000200
    VIM_REGS        (RW)    : origin=0xFFFFFE00 length=0x00000100
    VIM_RAM         (RW)    : origin=0xFFF82000 length=0x00000400
    PCR_REGS        (RW)    : origin=0xFFFFE000 length=0x00000100
    SYS1_REGS       (RW)    : origin=0xFFFFFF00 length=0x00000100
    SYS2_REGS       (RW)    : origin=0xFFFFE100 length=0x00000100
    ESM_REGS        (RW)    : origin=0xFFFFF500 length=0x00000100
    TCRAM1_REGS     (RW)    : origin=0xFFFFF800 length=0x00000100
    TCRAM2_REGS     (RW)    : origin=0xFFFFF900 length=0x00000100
}


/*----------------------------------------------------------------------------*/
/* Section Configuration                                                      */
SECTIONS
{
    .intvecs   : ALIGN(16) {} > VECTORS
    .text      : ALIGN(16) {} > APP_FLASH
    .const     : ALIGN(16) {} > APP_FLASH
    .cinit     : ALIGN(16) {} > APP_FLASH
    .pinit     : ALIGN(16) {} > APP_FLASH
    .bss       : {} > RAM
    .data      : {} > RAM
    .sysmem    : {} > RAM

    BootCode   : {} > BOOT_FLASH
    CANLoader  : {} > LOADER_FLASH

    /* ID "A_MC" of Application hard coded from Linker File to executable */
    appid_to_rom: > APP_ID fill = 0x415F4D43 { . += (0x4); }

    GioRegsFile       : {} > GIO_REGS,        type = NOINIT
    MibAdcRegsFile    : {} > MIBADC_REGS,     type = NOINIT
    DCan1RegsFile     : {} > DCAN1_REGS,      type = NOINIT
    DCan2RegsFile     : {} > DCAN2_REGS,      type = NOINIT
    FlashRegsFile     : {} > FLASH_REGS,      type = NOINIT
    SciRegsFile       : {} > SCI_REGS,        type = NOINIT
    Spi1RegsFile      : {} > SPI1_REGS,       type = NOINIT
    Spi2RegsFile      : {} > SPI2_REGS,       type = NOINIT
    Spi3RegsFile      : {} > SPI3_REGS,       type = NOINIT
    RtiRegsFile       : {} > RTI_REGS,        type = NOINIT
    IommRegsFile      : {} > IOMM_REGS,       type = NOINIT
    VimRegsFile       : {} > VIM_REGS,        type = NOINIT
    VimRamFile        : {} > VIM_RAM,         type = NOINIT
    PcrRegsFile       : {} > PCR_REGS,        type = NOINIT
    Sys1RegsFile      : {} > SYS1_REGS,       type = NOINIT
    Sys2RegsFile      : {} > SYS2_REGS,       type = NOINIT
    EsmRegsFile       : {} > ESM_REGS,        type = NOINIT
    TcRam1RegsFile    : {} > TCRAM1_REGS,     type = NOINIT
    TcRam2RegsFile    : {} > TCRAM2_REGS,     type = NOINIT
}

2 LinkFile_with_fill.cmd - with filling in memory, doesn't work

/*----------------------------------------------------------------------------*/
/* Linker Settings                                                            */
--retain="*(.intvecs)"


/*----------------------------------------------------------------------------*/
/* Memory Map                                                                 */
MEMORY
{
    VECTORS         (X)     : origin=0x00000000 length=0x00000020
    BOOT_FLASH      (RX)    : origin=0x00000040 length=0x00001FC0
    LOADER_FLASH    (RX)    : origin=0x00002000 length=0x00006000
    APP_LENGTH      (R)     : origin=0x00008000 length=0x00000004
    APP_CRC         (R)     : origin=0x00008004 length=0x00000004
    APP_ID          (R)     : origin=0x00008008 length=0x00000004
    APP_PN0         (R)     : origin=0x0000800C length=0x00000004
    APP_PN1         (R)     : origin=0x00008010 length=0x00000004
    APP_PN2         (R)     : origin=0x00008014 length=0x00000004
    APP_PN3         (R)     : origin=0x00008018 length=0x00000004
    APP_VECTORS     (RX)    : origin=0x0000801C length=0x00000024
    APP_FLASH       (RX)    : origin=0x00008040 length=0x00017FC0 fill=0xFFFFFFFF
    UNUSED_FLASH    (RX)    : origin=0x00020000 length=0x00040000
    STACKS          (RW)    : origin=0x08000000 length=0x00001500
    RAM             (RW)    : origin=0x08001500 length=0x00006B00

    GIO_REGS        (RW)    : origin=0xFFF7BC00 length=0x00000100
    MIBADC_REGS     (RW)    : origin=0xFFF7C000 length=0x00000200
    DCAN1_REGS      (RW)    : origin=0xFFF7DC00 length=0x00000200
    DCAN2_REGS      (RW)    : origin=0xFFF7DE00 length=0x00000200
    FLASH_REGS      (RW)    : origin=0xFFF87000 length=0x00001000
    SCI_REGS        (RW)    : origin=0xFFF7E400 length=0x00000100
    SPI1_REGS       (RW)    : origin=0xFFF7F400 length=0x00000200
    SPI2_REGS       (RW)    : origin=0xFFF7F600 length=0x00000200
    SPI3_REGS       (RW)    : origin=0xFFF7F800 length=0x00000200
    RTI_REGS        (RW)    : origin=0xFFFFFC00 length=0x00000100
    IOMM_REGS       (RW)    : origin=0xFFFFEA00 length=0x00000200
    VIM_REGS        (RW)    : origin=0xFFFFFE00 length=0x00000100
    VIM_RAM         (RW)    : origin=0xFFF82000 length=0x00000400
    PCR_REGS        (RW)    : origin=0xFFFFE000 length=0x00000100
    SYS1_REGS       (RW)    : origin=0xFFFFFF00 length=0x00000100
    SYS2_REGS       (RW)    : origin=0xFFFFE100 length=0x00000100
    ESM_REGS        (RW)    : origin=0xFFFFF500 length=0x00000100
    TCRAM1_REGS     (RW)    : origin=0xFFFFF800 length=0x00000100
    TCRAM2_REGS     (RW)    : origin=0xFFFFF900 length=0x00000100
}


/*----------------------------------------------------------------------------*/
/* Section Configuration                                                      */
SECTIONS
{
    .intvecs   : ALIGN(16) {} > VECTORS
    .text      : ALIGN(16) {} > APP_FLASH
    .const     : ALIGN(16) {} > APP_FLASH
    .cinit     : ALIGN(16) {} > APP_FLASH
    .pinit     : ALIGN(16) {} > APP_FLASH
    .bss       : {} > RAM
    .data      : {} > RAM
    .sysmem    : {} > RAM

    BootCode   : {} > BOOT_FLASH
    CANLoader  : {} > LOADER_FLASH

    /* ID "A_MC" of Application hard coded from Linker File to executable */
    appid_to_rom: > APP_ID fill = 0x415F4D43 { . += (0x4); }

    GioRegsFile       : {} > GIO_REGS,        type = NOINIT
    MibAdcRegsFile    : {} > MIBADC_REGS,     type = NOINIT
    DCan1RegsFile     : {} > DCAN1_REGS,      type = NOINIT
    DCan2RegsFile     : {} > DCAN2_REGS,      type = NOINIT
    FlashRegsFile     : {} > FLASH_REGS,      type = NOINIT
    SciRegsFile       : {} > SCI_REGS,        type = NOINIT
    Spi1RegsFile      : {} > SPI1_REGS,       type = NOINIT
    Spi2RegsFile      : {} > SPI2_REGS,       type = NOINIT
    Spi3RegsFile      : {} > SPI3_REGS,       type = NOINIT
    RtiRegsFile       : {} > RTI_REGS,        type = NOINIT
    IommRegsFile      : {} > IOMM_REGS,       type = NOINIT
    VimRegsFile       : {} > VIM_REGS,        type = NOINIT
    VimRamFile        : {} > VIM_RAM,         type = NOINIT
    PcrRegsFile       : {} > PCR_REGS,        type = NOINIT
    Sys1RegsFile      : {} > SYS1_REGS,       type = NOINIT
    Sys2RegsFile      : {} > SYS2_REGS,       type = NOINIT
    EsmRegsFile       : {} > ESM_REGS,        type = NOINIT
    TcRam1RegsFile    : {} > TCRAM1_REGS,     type = NOINIT
    TcRam2RegsFile    : {} > TCRAM2_REGS,     type = NOINIT
}

Let me know please if some additional information is necessary and thanks in advance.

  • Short update... Issue is observable only if .pinit or ..cinit are located within area where 'fill' is applying.
  • I used your problem linker command file to build a simple program.  When I use version 16.9.4.LTS (the version you use), I don't see the same diagnostic.  But the linker does hang.  So, while I am not certain I am experiencing the same problem, I think it is likely.  When I use version 16.9.11.LTS, everything works normally.

    I recommend you upgrade to a later version of the compiler.  It would be ideal if you upgrade to the latest release, version 18.12.1.LTS.  If that is not practical, then consider upgrading to version 16.9.11.LTS.  This version is the same as 16.9.4.LTS, except for bug fixes.

    Thanks and regards,

    -George

  • Hello George,

    thank you for you prompt response.

    I will try another compiler version, could you give me a hint where I can get 16.9.11.LTS (which CCS version)?

    But to be honest for me and for our company in common changing the compiler is not so trivial, it means a new tool qualification (DO178).

    Maybe some workaround is available? All what a need - fill unused by sections flash space with some pattern to prevent ECC triggering during read access (necessary for integrity check).

  • Dmitry Tuykov said:
    could you give me a hint where I can get 16.9.11.LTS

    Please see the article Compiler Installation and Selection.

    Dmitry Tuykov said:
    Maybe some workaround is available?

    Unfortunately, I cannot think of one.  I submitted the entry CODEGEN-5940 in the SDOWP system.  The test case I use is the one I discuss earlier.  While unlikely, it is possible I am not experiencing the same bug.  It is often the case that characterizing a bug also shows a workaround.  You are welcome to follow this entry with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • I tried 16.9.11.LTS and it works as expected.
    Of course it is pity to hear that there is no workaround, but I think that we will be able to change linker version somehow.

    Thanks a lot, I think topic can be closed.