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.

linker error when trying to rebuild UBL with CCS



I am trying to recompile the UBL for the DM368. I am using CSS version 5.2.1.00018 and dvsdk 4_02_00_06.

I loaded the UBL project, configured for the DM368, build, and I got a linker error:

<Linking>
"../DM368.cmd", line 18: error #10264: ARM_IRAM0 memory range overlaps existing
memory range ARM_I_IVT
"../DM368.cmd", line 18: error #10264: ARM_IRAM0 memory range overlaps existing
memory range UBL_I_SELFCOPY
"../DM368.cmd", line 18: error #10264: ARM_IRAM0 memory range overlaps existing
memory range UBL_I_TEXT
"../DM368.cmd", line 19: error #10264: ARM_IRAM1 memory range overlaps existing
memory range UBL_I_TEXT
"../DM368.cmd", line 21: error #10264: ARM_DRAM0 memory range overlaps existing
memory range UBL_D_SELFCOPY
"../DM368.cmd", line 21: error #10264: ARM_DRAM0 memory range overlaps existing
memory range UBL_D_TEXT
"../DM368.cmd", line 22: error #10264: ARM_DRAM1 memory range overlaps existing
memory range UBL_D_TEXT
"../DM368.cmd", line 22: error #10264: ARM_DRAM1 memory range overlaps existing
memory range UBL_D_DATA
"../DM368.cmd", line 22: error #10264: ARM_DRAM1 memory range overlaps existing
memory range UBL_BSS
"../DM368.cmd", line 22: error #10264: ARM_DRAM1 memory range overlaps existing
memory range UBL_STACK
"../DM368.cmd", line 28: error #10264: ARM_DAEMIF memory range overlaps
existing memory range UBL_F_SELFCOPY
"../DM368.cmd", line 28: error #10264: ARM_DAEMIF memory range overlaps
existing memory range UBL_F_TEXT
"../DM368.cmd", line 28: error #10264: ARM_DAEMIF memory range overlaps
existing memory range UBL_F_DATA
"../DM368.cmd", line 32: error #10264: ARM_DDR memory range overlaps existing
memory range UBL_DRAM
error #10010: errors encountered during linking;
"C:/Users/osingla/flash-utils/DM36x/CCS/UBL/UBL/../../../../DM36x/CCS/UBL/NA
ND_ARM432_DDR340_OSC24/UBL_DM36x_NAND_ARM432_DDR340_OSC24.out" not built

Any idea what I am missing ?

Thanks!

  • Olivier,

    Can you attach your DM368.cmd file?

  • Sure, here it is. Note that this the one provided with the dvsdk, I did not changed anything in it...

    Thanks!

    /****************************************************************************/
    /* DM368.cmd */
    /* Copyright (c) 2012 Texas Instruments Incorporated */
    /* Author: Rafael de Souza */
    /* */
    /* Description: This file is a sample linker command file that can be */
    /* used for linking programs built with the C compiler and */
    /* running the resulting .out file on an DM368 EVM. */
    /* Use it as a guideline. You will want to */
    /* change the memory layout to match your specific */
    /* target system. You may want to change the allocation */
    /* scheme according to the size of your program. */
    /* */
    /****************************************************************************/

    MEMORY
    {
    ARM_IRAM0 o = 0x00000000 l = 0x00004000 /* ARM Instruction RAM0 - 16kB */
    ARM_IRAM1 o = 0x00004000 l = 0x00004000 /* ARM Instruction RAM1 - 16kB */
    ARM_IROM o = 0x00008000 l = 0x00004000 /* ARM Instruction ROM - 16kB */
    ARM_DRAM0 o = 0x00010000 l = 0x00004000 /* ARM Data RAM0 - 16kB */
    ARM_DRAM1 o = 0x00014000 l = 0x00004000 /* ARM Data RAM1 - 16kB */
    ARM_DROM o = 0x00018000 l = 0x00004000 /* ARM Data ROM - 16kB */
    ARM_METB o = 0x01BC0000 l = 0x00001000 /* ARM ETB Memory - 4kB */
    ARM_RETB o = 0x01BC1000 l = 0x00000800 /* ARM ETB Registers - 2kB */
    ARM_ICECRSH o = 0x01BC1800 l = 0x00000100 /* ARM IceCrusher - 256B */
    ARM_CFGBUS o = 0x01C00000 l = 0x00400000 /* CFG Bus Peripherals - 4MB */
    ARM_DAEMIF o = 0x02000000 l = 0x08000000 /* ASYNC EMIF Data - 128MB */
    ARM_MJCPD o = 0x11F00000 l = 0x00020000 /* MJCP DMA Port - 128kB */
    ARM_HDVICPD o = 0x12000000 l = 0x00080000 /* HDVICP DMA Port - 512kB */
    ARM_RDDR o = 0x20000000 l = 0x00008000 /* DDR EMIF Control Registers - 32kB */
    ARM_DDR o = 0x80000000 l = 0x10000000 /* DDR EMIF - 256MB */

    }

    SECTIONS
    {
    .text > ARM_DDR
    .stack > ARM_DDR
    .bss > ARM_DDR
    .cio > ARM_DDR
    .const > ARM_DDR
    .data > ARM_DDR
    .switch > ARM_DDR
    .sysmem > ARM_DDR
    .far > ARM_DDR
    .args > ARM_DDR
    .ppinfo > ARM_DDR
    .ppdata > ARM_DDR

    /* TI-ABI sections */
    .pinit > ARM_DDR
    .cinit > ARM_DDR

    /* EABI sections */
    .binit > ARM_DDR
    .init_array > ARM_DDR
    .neardata > ARM_DDR
    .fardata > ARM_DDR
    .rodata > ARM_DDR
    .c6xabi.exidx > ARM_DDR
    .c6xabi.extab > ARM_DDR
    }

  • Olivier,

    Can you check whether any other linker script is used in your code base?

    In the dm368.cmd file I can't find the sections, ARM_I_IVT, UBL_I_SELFCOPY, UBL_D_SELFCOPY etc.. Can you search for these strings in your code and see which .cmd file has that mentioned?

  • Renjith,

    I think that would be the file UBL.cmd, see below.

    Thanks!

    Olivier

    -l rtsv4_A_le_eabi_eh.lib
    -e boot

    EMIFStart = 0x02000000;
    EMIFSize = 0x02000000;
    IRAMStart = 0x00000000;
    IRAMSize = 0x00008000;

    DRAMStart = 0x00010000;
    DRAMSize = 0x00008000;
    DDRStart = 0x80000000;
    DDRSize = 0x10000000;

    STACKStart = DRAMStart + DRAMSize;

    __selfcopysrc = EMIFStart;
    __selfcopydest = DRAMStart + 0x00000020;

    MEMORY
    {
    ARM_I_IVT (RX) : origin = 0x00000000 length = 0x00000020

    UBL_I_SELFCOPY (RX) : origin = 0x00000020 length = 0x000000E0
    UBL_I_TEXT (RX) : origin = 0x00000100 length = 0x00004300

    UBL_D_SELFCOPY (RW) : origin = 0x00010020 length = 0x000000E0
    UBL_D_TEXT (RW) : origin = 0x00010100 length = 0x00004300
    UBL_D_DATA (RW) : origin = 0x00014400 length = 0x00000400

    UBL_F_SELFCOPY (RX) : origin = 0x02000000 length = 0x000000E0
    UBL_F_TEXT (R) : origin = 0x020000E0 length = 0x00004300
    UBL_F_DATA (R) : origin = 0x020043E0 length = 0x00000400

    UBL_BSS (RW) : origin = 0x00014800 length = 0x00000400
    UBL_STACK (RW) : origin = 0x00014C00 length = 0x00000400
    UBL_DRAM (RWX) : origin = 0x80000000 length = 0x10000000
    }

    SECTIONS
    {

    .selfcopy : load=UBL_F_SELFCOPY
    {
    *(.selfcopy)
    . = align(4);
    }

    .text : load = UBL_F_TEXT, run = UBL_I_TEXT, LOAD_START(FLASHTEXTStart), LOAD_SIZE(FLASHTEXTSize)
    {
    *(.boot)
    . = align(4);
    *(.text)
    . = align(4);
    }

    .data : load = UBL_F_DATA, run = UBL_D_DATA, LOAD_START(FLASHDATAStart), LOAD_SIZE(FLASHDATASize), LOAD_END(__selfcopysrcend), FILL=0xFF
    {
    *(.const)
    . += 4; /* dummy hole creation so load_start and load_size resolve correctly */
    . = align(4);
    }

    .bss :
    {
    *(.bss)
    . = align(4);
    } > UBL_BSS

    .ddr_mem :
    {
    . += 0x10000000;
    } run = UBL_DRAM, type=DSECT, RUN_START(EXTERNAL_RAM_START), RUN_END(EXTERNAL_RAM_END)

    }

  • Can you try removing dm368.cmd file from your project and try?

  • Renjith,

    On a side note, I can compile the UBL (nand) with gcc (linux host). I think the only I need is to add the 2K header that the RBL needs, I have used this script:

    https://linuxlink.timesys.com/docs/gsg/dm365_evm#SECTION00042000000000000000

    Than I flash the 1st sectors of the NAND flash using u-boot:

    mmc rescan 0 ; fatload mmc 0:2 0x80700000 ubl-nand-arm432-ddr340-osc24.ubl
    nand erase 0x20000 0x20000
    nand write.ubl 80700000 20000 20000

    This procedure works just fine with u-boot (of course address in NAND is different) but so far, with the UBL i built from Linux, no luck...

    I was able to build the UBL for MMC support, but obviously this version is intended to boot only from SD card, not NAND...

    If you have any idea, that would be very much appreciated!

    Thanks, Olivier

  • Olivier,

    Even if you try to compile using CCS the UBL header is not generated. It is generated by the nandwriter.out program while flashing using CCS. Have you tried creating the UBL header using the script that is mentioned in the link that you've posted? If so, can you verify the ECC algorithm and ecc layout used? 

    If you have a setup that is able to successful NAND boot, then you can check following by running a "nand dump 0xoffset" command for a location where UBL is stored and for a location that is written by u-boot. 

  • Renjith,

    So I removed the call to the dm368.cmd, and the there wan not anymore a linker error.

    The last step of the building process seems to involve a program named hex470.exe (.out -> .bin) which was not installed with css v5 (I installed everything BTW).

    Any idea where I could download this missing program ?

    Thanks for your help, this is very much appreciated!

    Olivier

  • Olivier,

    If you have CCS 3.3, it has hex470.exe.