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.

can not include csl.h in code composer studio

Other Parts Discussed in Thread: TMS320F28027, CONTROLSUITE

dear all,

I am working with C2000 Launchpad XL (TMS320F28027) recently. I have downloaded the Biricha CSL library & included the csl.h header file. While compiling a program on Code Composer Studio Version: 6.1.0.00104, I encountered the following problem.
Code:

#include "DSP28x_Project.h"            // Device Headerfile and Examples Include File
#include "csl.h"

#define PERIOD_NS 5000

//---------------------------------------------------
void main(void)
{
SYS_init();

//Setup PWM_MOD_1 for fs = 200kHz. PWM1 Ch A is used for switching  the MOSFET
PWM_config( PWM_MOD_1, PWM_nsToTicks(PERIOD_NS), PWM_COUNT_UP );


PWM_pin( PWM_MOD_1, PWM_CH_A, GPIO_NON_INVERT );

//Set the maximum duty to 100%.
PWM_setDutyA( PWM_MOD_1, PWM_nsToTicks(PERIOD_NS) );
}

Error:
 
"C:\ti\controlSUITE\libs\csl\v200\include\csl_c2802x.h", line 32: fatal error #1965: cannot open source file "DSP2803x_headers/include/DSP2803x_Comp.h"

#1965 cannot open source file "DSP2803x_headers/include/DSP2803x_Comp.h"

unresolved symbols remain buck C/C++ Problem

unresolved symbol _SYS_configClk, first referenced in ./main.obj buck C/C++ Problem

unresolved symbol _SYS_initFunc, first referenced in ./main.obj buck C/C++ Problem

unresolved symbol _SYS_setPerhiperalClk, first referenced in ./main.obj buck C/C++ Problem

 

(Please find the attached files for compile & linker option seleced)

Console_log:

**** Build of configuration Debug for project buck ****

"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building target: buck.out'
'Invoking: C2000 Linker'
"C:/ti/ccsv6/tools/compiler/ti-cgt-c2000_6.4.2/bin/cl2000" -v28 -ml -mt -g --define="_DEBUG" --define="LARGE_MODEL" --define="CSL_C2802X" --diag_warning=225 --display_error_number --diag_wrap=off -z -m"buck.map" --stack_size=0x300 --warn_sections -i"C:/ti/ccsv6/tools/compiler/ti-cgt-c2000_6.4.2/lib" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-c2000_6.4.2/include" --reread_libs --display_error_number --diag_wrap=off --xml_link_info="buck_linkInfo.xml" --rom_model -o "buck.out" "./DSP2802x_Adc.obj" "./DSP2802x_CodeStartBranch.obj" "./DSP2802x_DefaultIsr.obj" "./DSP2802x_EPwm.obj" "./DSP2802x_GlobalVariableDefs.obj" "./DSP2802x_Gpio.obj" "./DSP2802x_PieCtrl.obj" "./DSP2802x_PieVect.obj" "./DSP2802x_SysCtrl.obj" "./DSP2802x_usDelay.obj" "./main.obj" "../28027_RAM_lnk.cmd" "C:/ti/controlSUITE/device_support/f2802x/v129/DSP2802x_headers/cmd/DSP2802x_Headers_nonBIOS.cmd" -l"libc.a"
<Linking>

undefined first referenced
symbol in file
--------- ----------------
_PWM_config ./main.obj
_PWM_pin ./main.obj

error #10234-D: unresolved symbols remain

>> Compilation failure
error #10010: errors encountered during linking; "buck.out" not built
gmake: *** [buck.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

with regards.

Tapas Parua

  • Tapas Parua,

    Thank you for the detailed post! Based on the error you provided, the "csl_c2802x.h" file looks to be referencing the "DSP2803x_Comp.h" header. Shouldn't that be referring to the "DSP2802x_Comp.h" since you are using the F28027? Code composer isn't going to find the "DSP2803x_Comp.h" in your current include search paths since they only reference f2802x locations.

    Let me know if that helps!
    Best Regards,
    Chris
  • hi,

    your first error (which you seem to have fixed yourself) is due to the csl header files being configured for c2803x instead of c2802x.

    The csl headers are configurable with a compiler directive.

    In your case you need to add CSL_C2802X as a predefined symbol.

    Your second error is a linker error since you haven't linked the csl library in to your project. You need to add a link to Ti\controlSUITE\libs\csl\latest\lib\csl2802x_ml.lib

    To add a link right click on your project, Add Files, Ti\controlSUITE\libs\csl\latest\lib\csl2802x_ml.lib, Tick "Link to Files", "OK"

    hope that helps.

    cheers

    Chris

  • dear sir,

    thank you for the reply. i have already added csl.h.

    inside csl.h file i found this:

    #ifndef _CSL_H
    #define _CSL_H

    /********** INCLUDES GLOBAL SECTION *******************************************/
    #if (defined CSL_C280X)
    #include "csl_c280x.h"
    #elif (defined CSL_C2802X)
    #include "csl_c2802x.h"
    #elif (defined CSL_C2833X)
    #include "csl_c2833x.h"
    #elif (defined CSL_C2803X)
    #include "csl_c2803x.h"
    #elif (defined CSL_C2806X)
    #include "csl_c2806x.h"
    #else
    #error Unknown device type
    #endif

    should i add csl_c280x.h again. Please help.

  • As Chris said, make sure to add CSL_C2802X as a predefined symbol in your CCS project. I am not familiar with the CSL library but it seems the "csl_c2802x.h" header would be the one you need and not "csl_c280x.h".

    Best Regards,
    Chris
  • hi,
    the software is designed to remove much of the hassle of supporting multiple platforms, so the idea is that you only need to include "csl.h" with the correct compiler directive (eg CSL_C2802X) and magically everything will work ;-)

    The internals of the library also use CSL_C2802X for internal configuration (see csl_uart_t0_Pub.h), so its best to include "csl.h" with the required platform, eg CSL_C280X, or CSL_C2802X or CSL_C2833X or CSL_C2803X or CSL_C2806X.

    This allows you to develop on one processor and then quickly change to another.

    The problem you have is at the linker stage since you have not linked to csl2802x_ml.lib. This can be found at C:\Ti\controlSUITE\libs\csl\latest\lib\csl2802x_ml.lib

    To add a link right click on your project, Add Files, c:\Ti\controlSUITE\libs\csl\latest\lib\csl2802x_ml.lib, Tick "Link to Files", "OK"

    You can download a document (BAN106.pdf) detailing how to set up a project with csl from Biricha using the following link, but you will need to register (it's free to do)
    www.biricha.com/.../21

    If you are having problems can you please clarify what error you are getting, since in your original post you started off by saying it was a compiler error, but your screen shots showed a linker error.

    cheers

    Chris