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.

How to specify an exact address for c_int00 for C6748

Hello,

I've added to DaVinci Forum this question but it actually belongs here. 

I've tried the suggestions in there for C6748 using the below linker file (not using SYS or DSP BIOS) but I receive a warning on line 23:

"../linker_dsp.cmd", line 23: warning #10068-D: no matching section

Any idea why? The map file doesn't show any changes to the _c_int00 address. Also tried using rtd6740.lib or  .sysinit instead of .text in the boot section.

Thank you in advance,

David.

linker_dsp.cmd:

-stack 0x00008000
-heap 0x00008000

MEMORY
{
dsp_l2_ram: ORIGIN = 0x11800000 LENGTH = 0x00040000
shared_ram: ORIGIN = 0x80000000 LENGTH = 0x00020000
external_ram: ORIGIN = 0xC0000000 LENGTH = 0x08000000
arm_local_ram: ORIGIN = 0xFFFF0000 LENGTH = 0x00002000
}

SECTIONS
{
.text > dsp_l2_ram
boot > 0x11800000
{
-l rts6740_elf_eh.lib<boot.obj>(.text) //line 23
}
.const > dsp_l2_ram
.bss > dsp_l2_ram
.far > dsp_l2_ram
.switch > dsp_l2_ram
.stack > dsp_l2_ram
.data > dsp_l2_ram
.cinit > dsp_l2_ram
.sysmem > dsp_l2_ram
.cio > dsp_l2_ram
.pinit > dsp_l2_ram
.init_array > dsp_l2_ram
.fardata > shared_ram
.c6xabi.exidx: load > shared_ram
.c6xabi.extab: load > shared_ram
.neardata > dsp_l2_ram
.rodata > dsp_l2_ram
}
  • Greetings,

    I take it you have your own c_int00() so this should work for you

    /*

    * Put c_int00 in the .xxxx section pointing to your address.

    */

    #pragma CODE_SECTION(c_int00,".xxxx")
    extern void interrupt c_int00()
    {
    .

    Good Luck,

    Sam

  • Hi Sam,

    I'm not declaring my own but using the standard function provided in rtsd6740_elf_eh.lib, but it cannot be placed at a different address as the http://processors.wiki.ti.com/index.php/Accessing_c_int00 suggests, but I'll keep in mind your reply in case I'll need to add my own.

    Best regards,

    David.

  • Greetings,

    Then extract the one you are using from the library and force it as shown to you.  It will take precedence over the existing one.

    Good Luck,

    Sam 

  • Hi Remi,

    I've looked in the link you posted, I was using option #1:

    1) Add rts430.lib to the --library option (C/C++ Build->Linker->File Search Path) and make sure it’s the first library in the list (so rts430.lib appears before libc.a in the command line)

    So the linker .cmd file looks like below, the warning is gone but the _c_int00 is not moved, it's positioned at 0x11814ca0. 

    -stack           0x00008000
    -heap 0x00008000

    MEMORY
    {
    dsp_l2_ram: ORIGIN = 0x11800000 LENGTH = 0x00040000
    shared_ram: ORIGIN = 0x80000000 LENGTH = 0x00020000
    external_ram: ORIGIN = 0xC0000000 LENGTH = 0x08000000
    arm_local_ram: ORIGIN = 0xFFFF0000 LENGTH = 0x00002000
    }

    SECTIONS
    {
    .boot > 0x11800000
    {
    -l rts6740_elf_eh.lib(.text)
    }
    .text > dsp_l2_ram
    .const > dsp_l2_ram
    .bss > dsp_l2_ram
    .far > dsp_l2_ram
    .switch > dsp_l2_ram
    .stack > dsp_l2_ram
    .data > dsp_l2_ram
    .cinit > dsp_l2_ram
    .sysmem > dsp_l2_ram
    .cio > dsp_l2_ram
    .pinit > dsp_l2_ram
    .init_array > dsp_l2_ram
    .fardata > shared_ram
    .c6xabi.exidx: load > shared_ram
    .c6xabi.extab: load > shared_ram
    .neardata > dsp_l2_ram
    .rodata > dsp_l2_ram
    .clean > dsp_l2_ram
    }
    
    

    I'm new to CCSv5 so I don't know how to "extract" a function from a library. The #pragma mentioned

    by Sam Kuzbary in previous post also doesn't work. I've tried adding to main.cpp the following declaration:

    #pragma CODE_SECTION(_c_int00, ".boot");

    extern void _c_int00();

    But the compiler now complains with the following error:

    "../main.cpp", line 26: error #821: badly formed pragma

    Did anyone actually successfully done it for the C6000 series? The other posts seem to work for C2000 microcontrollers.

    Best regards,

    David.

  • David,

    You should be able to control placement of c_int00 with the linker command file as you have tried. Can you attach the link map file(.map) generated with this latest linker command file for us to look at? Also could you please copy and paste the complete output of the CCS build console into a text file and attach that as well?

  • Hello AartiG,

    This is the compiler output:

    **** Clean-only build of configuration Debug for project HwTest ****

    C:\GnuWin32\bin\make -j 4 -k clean
    DEL /F "HwTest.out"
    DEL /F "MenuDDR.pp" "MenuSPI.pp" "MenuWDT.pp" "Test_DDR.pp" "main.pp"
    DEL /F "MenuDDR.obj" "MenuSPI.obj" "MenuWDT.obj" "Test_DDR.obj" "main.obj"
    'Finished clean'
    ' '

    **** Build Finished ****
    **** Build of configuration Debug for project HwTest ****

    C:\GnuWin32\bin\make -j 4 -k all
    'Building file: ../MenuDDR.cpp'
    'Building file: ../MenuSPI.cpp'
    'Building file: ../MenuWDT.cpp'
    'Building file: ../Test_DDR.cpp'
    'Invoking: C6000 Compiler'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6740 -g --exceptions --gcc --include_path="C:/ti/ccsv5/tools/compiler/c6000/include" --include_path="Software/myLib" --display_error_number --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="MenuDDR.pp" "../MenuDDR.cpp"
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6740 -g --exceptions --gcc --include_path="C:/ti/ccsv5/tools/compiler/c6000/include" --include_path="Software/myLib" --display_error_number --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="MenuSPI.pp" "../MenuSPI.cpp"
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6740 -g --exceptions --gcc --include_path="C:/ti/ccsv5/tools/compiler/c6000/include" --include_path="Software/myLib" --display_error_number --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="MenuWDT.pp" "../MenuWDT.cpp"
    "C:/ti/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6740 -g --exceptions --gcc --include_path="C:/ti/ccsv5/tools/compiler/c6000/include" --include_path="Software/myLib" --display_error_number --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="Test_DDR.pp" "../Test_DDR.cpp"
    'Finished building: ../Test_DDR.cpp'
    ' '
    'Building file: ../main.cpp'
    'Invoking: C6000 Compiler'
    "C:/ti/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6740 -g --exceptions --gcc --include_path="C:/ti/ccsv5/tools/compiler/c6000/include" --include_path="Software/myLib" --display_error_number --diag_warning=225 --abi=eabi --preproc_with_compile --preproc_dependency="main.pp" "../main.cpp"
    'Finished building: ../MenuSPI.cpp'
    ' '
    'Finished building: ../MenuDDR.cpp'
    ' '
    'Finished building: ../MenuWDT.cpp'
    ' '
    'Finished building: ../main.cpp'
    ' '
    'Building target: HwTest.out'
    'Invoking: C6000 Linker'
    "C:/ti/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6740 -g --exceptions --gcc --display_error_number --diag_warning=225 --abi=eabi -z -m"HwTest.map" --warn_sections -i"C:/ti/ccsv5/tools/compiler/c6000/lib" -i"C:/ti/ccsv5/tools/compiler/c6000/include" -i"Software/myLib/Debug" --reread_libs --rom_model -o "HwTest.out" "./main.obj" "./Test_DDR.obj" "./MenuWDT.obj" "./MenuSPI.obj" "./MenuDDR.obj" -l"rts6740_elf_eh.lib" -l"myLib.lib" -l"C:\ti\C6748_StarterWare_1_20_02_02\build\c674x\cgt_ccs\utils\Debug\utils.lib" -l"C:\ti\C6748_StarterWare_1_20_02_02\build\c674x\cgt_ccs\c6748\drivers\Debug\drivers.lib" -l"C:\ti\C6748_StarterWare_1_20_02_02\build\c674x\cgt_ccs\c6748\system_config\Debug\system_config.lib" -l"C:\ti\C6748_StarterWare_1_20_02_02\build\c674x\cgt_ccs\c6748\evmC6748\platform\Debug\platform.lib" "../linker_dsp.cmd"
    <Linking>
    'Finished building target: HwTest.out'
    ' '

    **** Build Finished ****
    
    
    I've also attached the HwTest.map file:6165.HwTest.zip
    Best regards,
    David.
  • Hi David,

    As we can see on your map file, the .boot section was created, and the library is inside, it is a good point.

    you wrote :

    	.boot > 0x11800000
    {
    -l rts6740_elf_eh.lib(.text)
    }
    this create a .boot section at address 0x11800000 and put the full library inside.

    try :
    	.boot > 0x11800000
    {
    -l rts6740_elf_eh.lib<boot.obj>(.text)
    }
    to specifie that only the boot.obj from lib should be placed at the specified address.

    hope it will help .

    Remi



  • Hi Remi,

    It works now, this was previously giving me the warning problem mentioned above, but only if I manually specify the rts6740_elf_eh.lib into Project Properties->CCS General->Runtime support library field instead of <automatic> (or set it to <none> and add it to CCS Build>C6000 Linker->File Search Path as the first library before libc.a).

    Thank you very much for your support,

    David.

  • David Luca said:
    ...but only if I manually specify the rts6740_elf_eh.lib...

    You may have been specifying a different library in the linker command file than the automatic library selector was choosing.  You could try using the syntax "-lrts*.lib<boot.obj>(.text)" with automatic library selection, if you want to use that feature.