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.

Compiler/LAUNCHXL-F280049C: How to include Driverlib files in order to proper use the SCI functions

Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: C2000WARE

Tool/software: TI C/C++ Compiler

Hi, my name is Iulian Popa.

I´m a student from Univerity of Zaragoza in Spain. Im using one of your development board 'LAUNCHXL-F280049C' and I have some questions and problems when I´m trying to use some example projects from driverlib.

First of all, Im using:

-  CodeComposer version 9.3

-  C2000Ware version 3.1.0.00

I started my own project (based on the C:\ti\c2000\C2000Ware_3_01_00_00\device_support\f28004x\examples\cla) using the version:

- cla_ex1_background_task.c

- cla_ex1_background_task_cla.cla

- cla_ex1_background_task_shared.h

I have not had any problems using this example.

My problem starts when im trying to combine these example with this other (C:\ti\c2000\C2000Ware_3_01_00_00\driverlib\f28004x\examples\sci) :

- sci_ex2_interrupts.c

I have used this example in an empty project and the example works perfectly. The problem I have is that the compiler does not recognize the include paths of all the headers of this library when 
I combine my project with some functions of the "sci_ex2_interrupts.c" example.

I think im not properly including the path of the driverlib library or something related.
I will attach the my project folder (my project and the sci example i want to use, including some of the functions that in the example appears). I also tried to include the path of the driverlib into the compiler options.
I tried to include the folder path os these headers/source codes in the project properties (Right click on the project in the project explorer > Properties > Resource > Linked Resource & Right click on the project in the project explorer > Properties > Build > C2000 Compiler > Include options) but it doesnt fix the problems.

So I need some help to understant what I have to do or how is the proper way to combine the examples that depends on "driverlib or device" with the others examples.

Can you help me? Thank you.

  • Hi,

    What is the error you are encountering ? Is this compilation error or linking error?

    Driverlib.lib should already be there in path from from first project.

  • Hi again, ty for the fast response.

    C:\ti\c2000\C2000Ware_3_01_00_00\device_support\f28004x\examples\cla this project is taken using the Resource explorer Offline tool and importing it to IDE. I'm not using - cla_ex2_background_task.c, I'm using - cla_ex1_background_task.c from the "Bitfield" (View > Resource Explorer Oflline > Software > Devices > F28004X > F280049C > Examples > Bitfield > cla_ex1_background_task).

    When I open this example (or my project that is done over this example) and I copy one or more functions from View > Resource Explorer Oflline > Software > Devices > F28004X > F280049C > Driverlib > sci_ex2_interrupts, the compiler says me that the defines that the defines that are used in sci_ex2_interrupts functions are undefined. So I tried to add manually the inlcude path of the device.h, driverlib.h ... but It doesnt solve the problem.

    Im attaching a folder with 6 images that describe what happens when I try to combine the projects. Im sure im understanding something wrong but im not sure what the issue is.

    Ty for all, Iulian.

    4452.TI forum question.zip

  • You might have chosen file specific options to override the default paths set by the top-level project.

    Always look at the log on the console which indicates the parameters including the paths that are referenced while compiling each file. To reset the filespecific options, right click on the specific file "cla_ex1_background_task_cpu.c", choose properties and then go to C2000 compiler.

    On the Compiler options click on Restore Defaults which should take this to the top level settings (include paths and other compiler settings).

  • I've tried your point. 

    On the cla_ex1_background_task_cpu.c I copied the GPIO setup of the SCI-A from sci_ex2_interrupts project example. Then I follow the steps that you indicated me and I restored defaults. Then when I built the program appears " #20 identifier "DEVICE_GPIO_CFG_SCIRXDA" is undefined cla_ex1_background_task_cpu.c /cla_ex1_background_task line 119 C/C++ Problem"

    I also tried to include in the top of the program "#"include device.h" and #include "driverlib.h" but It doesnt work and appears more errors related wih the driverlib folder (see picture above).

    Ty for your answer. Iulian

  • Hi Lulian,

    You are two projects - cla_ex1_background_task and sci_ex2_interrupts.

    cla_ex1_background_task is bitfield based project and sci_ex2_interrupts is driver lib based.

    You need to follow following steps with merge two build setup.

    1) Create a folder called "device" in the project

    2) Copy following files to the "device" folder 

       C2000ware_xxxxx>/device_support/f28004x/common/include/driverlib.h

       C2000ware_xxxxx>/device_support/f28004x/common/include/device.h

       C2000ware_xxxxx>/device_support/f28004x/common/source/device.c

       C2000ware_xxxxx>/device_support/f28004x/common/source/F28004x_CodeStartBranch.asm

    3) Right-click project, open "Show Build Settings..."

       On Left side pane, select "General", and on the right side pane, go to "Products" tab, and select C2000ware install

       On Left side pane, select "Build", and on the right side pane, go to "Variables" tab, and press "Add" button

           C2000WARE_DLIB_ROOT  -> ${COM_TI_C2000WARE_SOFTWARE_PACKAGE_INSTALL_DIR}/driverlib/f28004x/driverlib

       On Left side pane, select "Build -> C2000 Compiler -> Include Options", press "+" icon to add, and then add "${C2000WARE_DLIB_ROOT}", then press "Apply and Close"

     

    4) Right-click project, New -> File, and add filename as driverlib.lib, press "Advanced", check Linked File and browse to "C:\ti\C2000\C2000Ware_XXXX\driverlib\f28004x\driverlib\ccs\Debug\driverlib.lib"

     

    5) Rebuild the project.

    I have created these steps in attached for you.

    cla_ex1_background_task.zip 

    Now you can add sci_ex2_interrupts.c to the project. You may need to update the linker command file to accommodate the memory need for different section.