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 file question

Hello,

I'm using a C6748 LCDK board.  I copied the C6748.cmd file from the CCS folder and renamed it C6748_optimus.cmd in my project root.

The file seems to add just fine, but when I browse to it and select it as the linker file, it gets grayed and slashed, like so

I'm not even sure what that means...

  • Chris Roed said:
    but when I browse to it and select it as the linker file, it gets grayed and slashed,

    That means the file is excluded from the build. Please see this wiki section:
    http://processors.wiki.ti.com/index.php/Projects_and_Build_Handbook_for_CCS#Exclude_files_from_build

    If you wish to include the file back in the build, right-click on it, go to Resource Configurations->Exclude from Build, and uncheck the build configurations for which you want to include it.

  • Well, that's odd that when I add the file to project, it's not excluded, but as soon as I select that as the linker file, CCS will exclude it from the build... Either way, I followed your instructions to include the linker back into the build, but there's still a bug.

    The debug compiles and links correctly.  I went into the project properties for release mode, and I selected the same linker file.  For some reason, CCS decided to exclude it from the build again.  This is an annoying bug.   I included the file in the build again and built release mode.  It compiled fine, but it did not link correctly.  

    In the map file for the DEBUG mode, I see 

    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    DSPL2ROM 00700000 00100000 00000000 00100000 RWIX
    DSPL2RAM 00800000 00040000 00000000 00040000 RWIX
    DSPL1PRAM 00e00000 00008000 00000000 00008000 RWIX

    etc etc etc etc

    but using the same link file for release mode I see

    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    NEARRAM 00000001 00007fff 00000070 00007f8f RWIX
    RAM 00008000 fffffffe 0004be30 fffb41ce RWIX

    and that's all I get.  It's as though the release build is still not using the linker file even though I've selected that specific file and made sure to include it in the build.

    For reference, the error is happening with CCS 5.4 on a 64 bit Win7 machine.    I've used a different  PC running CCS 5.2  on a 32 bit Win7 machine and both release and debug will build just fine.

  • Chris,

    There are a couple of ways the linker command file can be "included" in the project build. If the file physically resides in the project folder it will be picked up for both "Debug" and "Release" build configurations, unless it is explicitly set as Exclude from build. If it is added via the Project Properties->General->Linker command file field, it will have to be set for each build configurations (or all configurations) as those settings can be controlled per configuration.  If the same linker command file is going to be used for both Debug and Release, I would suggest just adding it to the project folder and letting CCS automatically do the rest.

    I'm surprised that the map file for the Release build looks incorrect. Can you do a Rebuild of the project and copy and paste the output in the CCS build console and attach it here? Is there perhaps another linker command file being picked up, or maybe none being picked up at all thereby causing the memory configurations to revert to some defaults? If so, the build output should give some clues.

  • Aarti,

    I went into the ccs/include folder and removed the C6748_optimus linker file.  I modified the release and debug build properties to have "none" for linker script, then I removed the linker file from the project directory, and built the release.

    I ran the release build and got this:

    -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --reread_libs --warn_sections --rom_model -o "Optimus Dev.out" "./usr_uart.obj" "./usr_timer.obj" "./usr_gpio.obj" "./usr_edma.obj" "./usr_bitstream.obj" "./pinmux.obj" "./mcbsp.obj" "./main.obj" "./bitstream.obj" "./algo.obj" -ldrivers.lib -lutils.lib -lplatform.lib -lsystem_config.lib -l"libc.a"
    <Linking>
    warning: creating output section ".bitstream" without a SECTIONS specification
    'Finished building target: Optimus Dev.out'

    Which looks correct, because I declared a custom .bitstream section which the linker can't find.

    Then, I re added the C6748_optimus.cmd to project, and made sure to include it in the release and debug builds.  The following is the console output of the release build.

    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6740 --abi=eabi -O2 --include_path="C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --include_path="C:/ti/C6748_StarterWare_1_20_03_03/include" --include_path="C:/ti/C6748_StarterWare_1_20_03_03/include/c674x/c6748" --include_path="C:/ti/C6748_StarterWare_1_20_03_03/include/c674x" --include_path="C:/ti/C6748_StarterWare_1_20_03_03/include/hw" --define=c6748 --preproc_with_compile --preproc_dependency="usr_uart.pp" "../usr_uart.c"
    'Finished building: ../usr_uart.c'
    ' '
    'Building target: Optimus Dev.out'
    'Invoking: C6000 Linker'
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6740 --abi=eabi -O2 --define=c6748 -z --stack_size=0x800 --heap_size=0x800 -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/lib" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/c6748/drivers/Release" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/c6748/lcdkC6748/platform/Release" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/c6748/system_config/Release" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/c6748/ipclib/Release" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/c6748/usblib/Release" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/utils/Release" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/grlib/Release" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/nandlib/Release" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --reread_libs --warn_sections --rom_model -o "Optimus Dev.out" "./usr_uart.obj" "./usr_timer.obj" "./usr_gpio.obj" "./usr_edma.obj" "./usr_bitstream.obj" "./pinmux.obj" "./mcbsp.obj" "./main.obj" "./bitstream.obj" "./algo.obj" -ldrivers.lib -lutils.lib -lplatform.lib -lsystem_config.lib -l"libc.a" "../C6748_optimus.cmd"
    <Linking>
    'Finished building target: Optimus Dev.out'

    So, it looks like it found the correct cmd file, but it's still not linking correctly.

    >> Linked Tue May 28 13:24:38 2013

    OUTPUT FILE NAME: <Optimus Dev.out>
    ENTRY POINT SYMBOL: "_c_int00" address: 000518e0


    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    NEARRAM 00000001 00007fff 00000070 00007f8f RWIX
    RAM 00008000 fffffffe 0004be30 fffb41ce RWIX

    The debug build is still linking correctly, below is the output from building the debug

    'Invoking: C6000 Linker'
    "C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" -mv6740 --abi=eabi -g --define=c6748 --display_error_number --diag_warning=225 -z --stack_size=0x800 -m"Optimus Dev.map" --heap_size=0x800 -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/lib" -i"C:/Users/a0b20zz/workspace_v5_4/Optimus Dev" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/c6748/drivers/Debug" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/c6748/lcdkC6748/platform/Debug" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/c6748/system_config/Debug" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/c6748/ipclib/Debug" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/c6748/usblib/Debug" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/utils/Debug" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/grlib/Debug" -i"C:/ti/C6748_StarterWare_1_20_03_03/binary/c674x/cgt_ccs/nandlib/Debug" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --reread_libs --warn_sections --display_error_number --rom_model -o "Optimus Dev.out" "./usr_uart.obj" "./usr_timer.obj" "./usr_gpio.obj" "./usr_edma.obj" "./usr_bitstream.obj" "./pinmux.obj" "./mcbsp.obj" "./main.obj" "./bitstream.obj" "./algo.obj" -ldrivers.lib -lutils.lib -lplatform.lib -lsystem_config.lib -l"libc.a" "../C6748_optimus.cmd"
    <Linking>
    'Finished building target: Optimus Dev.out'
    ' '

    DEBUG MEMORY MAP:

    >> Linked Fri May 31 14:43:42 2013

    OUTPUT FILE NAME: <Optimus Dev.out>
    ENTRY POINT SYMBOL: "_c_int00" address: c006c160


    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    DSPL2ROM 00700000 00100000 00000000 00100000 RWIX
    DSPL2RAM 00800000 00040000 00000000 00040000 RWIX
    DSPL1PRAM 00e00000 00008000 00000000 00008000 RWIX
    DSPL1DRAM 00f00000 00008000 00000000 00008000 RWIX
    SHDSPL2ROM 11700000 00100000 00000000 00100000 RWIX
    SHDSPL2RAM 11800000 00040000 00000000 00040000 RWIX
    SHDSPL1PRAM 11e00000 00008000 00000000 00008000 RWIX
    SHDSPL1DRAM 11f00000 00008000 00000000 00008000 RWIX
    EMIFACS0 40000000 20000000 00000000 20000000 RWIX
    EMIFACS2 60000000 02000000 00000000 02000000 RWIX
    EMIFACS3 62000000 02000000 00000000 02000000 RWIX
    EMIFACS4 64000000 02000000 00000000 02000000 RWIX
    EMIFACS5 66000000 02000000 00000000 02000000 RWIX
    SHRAM 80000000 00020000 00001024 0001efdc RWIX
    DDR2 c0000000 20000000 0006d708 1ff928f8 RWIX

  • Chris Roed said:

    >> Linked Tue May 28 13:24:38 2013

    OUTPUT FILE NAME: <Optimus Dev.out>
    ENTRY POINT SYMBOL: "_c_int00" address: 000518e0


    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    NEARRAM 00000001 00007fff 00000070 00007f8f RWIX
    RAM 00008000 fffffffe 0004be30 fffb41ce RWIX

    Are you sure the map file is getting rebuilt for the Release configuration? The date on it says May 28 while the one for the Debug build is much more recent at May 31. Also the Release build does not have a -m"Optimus Dev.map" option, so it looks like it is not generating a map file at all. What you are looking at may be an old map file that has not been updated with the recent build. Could you double-check the project properties for the Release build, and make sure the linker option for --map_file (-m) specifies a file name?

  • I'll be darned... In order to get that working, I had to erase the old .map file first, but it seems to be working correctly.  Thanks for all the help!