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.

CODECOMPOSER: C2000ware local and linked copies of the same file?

Part Number: CODECOMPOSER
Other Parts Discussed in Thread: C2000WARE

Hi all,

I recently started a new project using the empty_bitfield_project example from c2000ware. I notice that in this project, there are local copies of several files from c2000ware. This includes f28004x_sysctrl.c, f28004x_gpio.c, f28004x_pievect.c, f28004x_piectrl.c, f28004x_defaultisr.c, f28004x_codestartbranch.asm, etc. I'm guessing these local copies are for users to tailor to their application without modifying the originals in the c2000ware installation.

But under the "includes" list in the project explorer, it also lists copies of these files linked from the c2000ware install directories. I'm concerned that CCS may decide to build the linked versions of the files instead, which would be very problematic once I edit the local versions. I'm an amateur when it comes to the linking/compiling process, so I'm assuming this is avoided somehow, but I was hoping someone could explain it to me.

Regards,

Mike

  • Mike, 

    It depends on how the source files are included in the project. 

    CCS supports two methods of adding source files and/or folders to projects. You can either add files or link files. When you add a file/folder to a project, it is physically copied to the root location of the project directory in your workspace.

    When you link a file/folder to a project, the project will create a reference to the file/folder in the file system instead of copying it into the project directory.

    If you want to ensure that it uses the local versions, you will have to update the include paths of your project. You can right click on the Project -> Properties->Build->Include Options

    Please refer the following link for details.

    https://software-dl.ti.com/ccs/esd/documents/users_guide/ccs_project-management.html#configuring-projects

    Best Regards

    Siddharth

  • Hi Siddarth

    These local copies of the source files already existed in the example project I imported, I did not add them manually. But my compiler search paths also listed "C:\ti\c2000\C2000Ware_4_00_00_00\device_support\f28004x\common\source" which contains other copies of the same files. So my project saw multiple copies of the same source files.

    I tried importing a fresh empty_bitfield_project, and I see that it does not refer to ...\f28004x\common\source in the search paths. I'm unsure of how that ended up in my project. Removing that path does not seem to affect the build results at all, so as far as I can tell it was not relying on anything in there.

    I guess that resolves my immediate problem, but I'm confused as to why the compiler/linker didn't complain about multiple source files with the same name being found. If I copy one of my own source files (into another source directory) and try to build I get build errors referring to redefined symbols, as expected. Why didn't this happen before with the files in \device_support\f28004x\common\source?

  • Mike

    Glad you were able to resolve it.  Ideally compiler should have thrown an error. Will check with the compiler team regarding this.

    Best Regards

    Siddharth

  • Hi Siddharth,

    I tried adding the c2000ware source path to the new empty_bitfield_project and do not get any build errors. See below, various source files appear both in the project directory and the included search paths:

    I've zipped the project, curious if you observe the same behavior:

    empty_bitfield_project_test.zip

  • Hi Mike, 

    The include path is mainly intended for specifying the header file paths. 

    I tried to compile the project that you shared and I see the same behavior. 

    However if I remove the "source" path from the include path, then also I am able to build the project.

    Best Regards

    Siddharth

  • If I have the source directory included, but exclude one of the local source files, then the compiler throws errors regarding unresolved symbols in that file. So are source (.asm and .c) files in the included paths always ignored? That would explain things, I think.

  • Mike,

    Yes, source files in the included paths are ignored. 

    Best Regards

    Siddharth