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.

DSPLIB Linking on CCS5

Other Parts Discussed in Thread: MATHLIB

Hello, everyone.

I'm developing a FIR filter and after doing my best to reach a high frequency performance (I got 50 MHz of signal input for a 52 coefficients filter), I decided to test the DSPLIB since I see I could reach frequencies above 140 MHz.

In order to create the project I tried different methods:

1) Whit RTSC

  • I created a simple "Hello word" CCS5 project and after I added a .cfg file to convert the project to a RTSC.
  • In Properties>General>RTSC I checked the DSPLIB and the MATHLIB options.
  • In my source file I added the ".../inc/dsplib.h" and "../inc/mathlib.h" headers.

2) Trying to manually linking the libraries.

  • I created a simple "Hello word" CCS5 project.
  • In Properties>c6000 Compiler>Include options I added the paths to the DSPLIB installation folder and the DSPLIB packages folder.
  • Link the DSPLIB library with one of those two methods:
  • In Properties>c6000 Linker>File Search Path I added the library file dsplib.a66.
  • In my .cmd I added at the beggining the line -l "C:/ti/dsplib_c66x_3_0_0_8/lib/dsplib.a66"
  • In my source file I added the ".../inc/dsplib.h" and "../inc/mathlib.h" headers.

In both cases, when I build the program an error saying "unresolved symbol xx" for any function xx of the library I use. Besides, when I'm writing the code the autocompletion doesn't show any help about the fuctions of the library but it does for example, for the mathlib.

I add an example of the console log of my error.

**** Build of configuration Debug for project testdsplibka ****

C:\ti\ccsv5\utils\bin\gmake -k all
'Building target: testdsplibka.out'
'Invoking: C6000 Linker'
"C:/ti/ccsv5/tools/compiler/c6000/bin/cl6x" -mv6600 -g --display_error_number --diag_warning=225 --abi=eabi -z -m"testdsplibka.map" --warn_sections -i"C:/ti/ccsv5/tools/compiler/c6000/lib" -i"C:/ti/ccsv5/tools/compiler/c6000/include" --reread_libs --rom_model -o "testdsplibka.out"  "./main.obj" -l"libc.a" -l"C:\ti\dsplib_c66x_3_1_0_0\lib\dsplib.a66" "../lnk.cmd"
<Linking>
warning #10349-D: creating output section ".init_array" without a SECTIONS
   specification.  For additional information on this section, please see the
   'C6000 EABI Migration' guide at
   http://processors.wiki.ti.com/index.php/C6000_EABI:C6000_EABI_Migration#C6x_
   EABI_Sections

 undefined  first referenced
  symbol        in file     
 ---------  ----------------
 DSP_fir_r8 ./main.obj      

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "testdsplibka.out" not built

>> Compilation failure
gmake: *** [testdsplibka.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

How can I correctly linking the DSPLIB into my project? Is there any step missing?

Thank you.

  • Hi,

    Since you have a ".init_array" section I suppose you are using C++. The DSPLIB library functions have extern "C" linkage but the headers miss the declaration.

    Try with:

    extern "C"

    {

    #include "dsplib.h"

    }

    Also add the ".init_array" to your linker file. It is a const so can be mapped in the memory reserved for the text or the read-only data.

  • Hi, Alberto.

    I'm actually coding in C, not C++. Nevertheless, I added the .init_array to my .cmd file so that warning does't appear any more. I couldn't add the "extern "C"" include but I tried to apply it to the fuction I was trying to use, like this:

    extern DSP_fir_r8 (const short *restrict x, const short *restrict h, short *restrict r, int nh, int nr);

    I know it actually makes no much sense, but I thought it could work because of the assembly benchmarks of the library.

    The problem remains the same, I cannot use any function of the library.

  • Sorry, I haven't notice you are linking with dsplib.a66. This is the COFF version, but you are building EABI. Try to link with dsplib.ae66 (and mathlib.ae66).

    I'm not sure this is the case, since when mixing CGT 7.3.3 give message:

    warning: library "dsplib.a66"  contains TI-COFF object files which are incompatible with the ELF output

  • Well, I changed the library as you said and now it partially works. To avoid a "function declared implicitly" warning I kept the "extern" definition of the fucntion I was using, but I still think this is not the better way. Besides, I repeated the process with the "mathlib" library and some functions work but others do not, so something must be missing.

    ---

    I have anothed doubt, maybe you can solve it. The option "Graph" of the "Tools" menu in the Debug mode dissapered from my CCS5. I was using it last week and now it's vanished with other options, so it could be complex for me to test the DSPLIB in real time. Do you know how to set it or what do I have to reinstall?

  • Alberto Chessa said:

    Sorry, I haven't notice you are linking with dsplib.a66. This is the COFF version, but you are building EABI. Try to link with dsplib.ae66 (and mathlib.ae66).

    I'm not sure this is the case, since when mixing CGT 7.3.3 give message:

    warning: library "dsplib.a66"  contains TI-COFF object files which are incompatible with the ELF output

    Alberto, you mention the difference between the dsplib.a66 & dsplib.ae66 libraries.

    How are they different, and how can I determine which one I should be using?

  • Chris Jagielski said:

    Alberto, you mention the difference between the dsplib.a66 & dsplib.ae66 libraries.

    How are they different, and how can I determine which one I should be using?

    See compiler manual sru187 §2.16, §6.11 and then http://processors.wiki.ti.com/index.php/EABI_Support_in_C6000_Compiler.

    I think it is better to use EABI since it fully support zero initialization of varaibles and "EABI will eventually completely displace COFF and COFF ABI; however, COFF will continue to be supported for some time. COFF ABI support will be phased out slowly" (from http://processors.wiki.ti.com/index.php/C6000_EABI_Migration).

    For a list of diference look for EABI and COFF in the compiler manual.

    The ABI is selected in the CCS when You create a project. For an existing project, you can select the abi from the project properties->CCS General->advanced Settings->output format.

  • Thank you very much Alberto