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.

Creating Header Files with CCS



Hello:

I have written large amounts of code and would like to combine it in a library.  I have never created a library or a header file and I have a few questions about doing so in CCS.

How do I debug a header file in CCS?

Aside from adding "#include<myheader.h>" to the top of the file what do I need to do in order to utilize a custom header file?

 

Thanks!

  • The compiler tools included in CCS has a tool called the archiver that can be used to create libraries. Details on the archiver can be found in the Assembly Language Tools Users Guide (for the device family you are using).

    You can get to the User Guides from this page: http://processors.wiki.ti.com/index.php/TI_Compiler_Information#Compiler_Manuals

    Within CCS, you can create a project to build a library similar to building a executable file. When going through the project wizard, just choose the Output Type to be "Static Library" instead of "Executable". Then add the files to the project as you normally would and CCS will invoke the archiver and create a archived library.

    If you need general help on getting started with CCS4, please take a look at http://processors.wiki.ti.com/index.php/CCSv4_Getting_Started_Guide

    Giovanni Montoya said:

    Aside from adding "#include<myheader.h>" to the top of the file what do I need to do in order to utilize a custom header file?

    That should be it. However, the #include <> syntax is more commonly used with system supplied header files and #include " " syntax is used for custom header files. Please see this reference.

  • I'm in the process of migrating to CCSv4 and notice the Static Library has several options (gnu, cygwin, etc.).  Which would be the appropriate one to use in Windows (cygwin?).

    Oops, just tried Cygwin and got an error "java.util.ConcurrentModificationException", guess that wasn't it.

  • Jerry,

    To create a archive library for a TI processor using the TI tools, select the Project Type to be the processor you are working with (ARM, C6000, C2000 etc) and then further in the Project wizard, choose the Output Type to be Static Library (see screenshot).

    Those other options for Static Libraries only appear when you enable "Show All project Types" and are used when building with GCC or other cross-compilation tools in the Eclipse environment.

  • Thanks, I'll try that when my Windows machine is on. 

    Another question, with all the different MSP430 processors and work arounds, is it possible to create a general use library in CCS?  I haven't seen any "generic MSP430" type of processor selection or header files. I'm thinking instead of a library I'll need to pull all the source files that would have been in a library into every project and then manually edit them out when delivering code to clients (they don't get my library files). I guess I could make a new library of my source files for each project, that might be a bit easier.

  • I see what my problem was with the libraries, you can't do that with the free version.  I hadn't tried since I installed the paid-for microcontroller version, this has the Static Library option.

    So, any recommendations on how to set up a library to work on any MSP430?  Nothing fancy in the libraries, but will need to enable/disable interrupts in some routines.

  • Jerry Durand said:
    any recommendations on how to set up a library to work on any MSP430?

    There are 2 parts to this question.  One is just the mechanical steps you take to create a library.  We can help you with that.  The second part is what should be in the library and why.  That's the more interesting part.  And we in this forum can't help you with that.  That requires specific knowledge of the MSP430 family we do not have.  I recommend you pursue that first in this forum.  If you don't have the mechanical steps worked out by that point, you are welcome to come ask us about that.

    Thanks and regards,

    -George