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.

CCS/MSP430F6736: how to Include header file in Linker command file: MSP430F6736, CCSv700, CCSv612, CCS Cloud

Part Number: MSP430F6736

Tool/software: Code Composer Studio

Hello,

Could you please advise how to make my header file work ?  A header file, not for C source, but for CMD file.

This question is a simplification of my customer's, therefore a kind response would be highly appreciated.

First, please try the attached project with CCSv700.

/cfs-file/__key/communityserver-discussions-components-files/81/0537.hello_5F00_edit.zip

Please find:

- At the beginning a build will fail. Because the symbol "ADDR" is commented out in the file "headerfile4cmd.h".

- Please UNcomment the "#define ADDR 0". Then the project builds successfully.

- Please put any error in the file "headerfile4cmd.h".

    - If "Build project", The error will not be detected.

    - If "REBuild project", The error will be detected.

So, is it possible to detect errors in the "headerfile4cmd.h" whichever the build is the normal build or re-build ?

p.s. We are aware of the another thread [how to Include header file in Linker command file] , but it doesn't work.

  • Hideaki Nambu said:

    - Please put any error in the file "headerfile4cmd.h".

        - If "Build project", The error will not be detected.

    I am unable to reproduce that result.  When I intentionally write wrong code in headerfile4cmd.h, I get a failure when I build or rebuild.  What error do you put in headerfile4cmd.h to cause this result?

    Thanks and regards,

    -George

  • George,
    Thank you for your response.

    >> What error do you put in headerfile4cmd.h to cause this result?

    [1]
    * Comment out the Line 2: "#define ADDR 0".
    * Right-click the project [_hello]
    * In the context menu, press [Build project].

    [2]
    * Type "foo" in the line 4.
    * Right-click the project [_hello]
    * In the context menu, press [Build project].


    I appreciate your trials.
  • Hello!

    Please forgive me hijacking the thread, I believe I have related observation.

    I would generalize the problem as "linker command file dependencies are not populated properly". In our projects we observed misses of modified files detection, when they were included with '-l' option.

    In attachment please see files we are using in out projects. dsp.cmd includes its dependency file eth_lnk.cmd with '-l' option. Then the sequence to reproduce is:

    1. Build the project, make sure it succeeded.

    2. Modify included file whatever way and save.

    3. Build the project again. I mean regular build command

    Expected result: dependency modification detected and project gets relinked.

    Actual result:

    "D:\\TI\\ccsv7\\utils\\bin\\gmake" -k -j 8 all -O
    gmake[1]: 'myproject.out' is up to date.

    As you see, in reality dependency modification was not detected and project considered up to date.

    4. Rebuild the project, i.e. clean&build.

    At this time build process is forced to run, and at its end it will run linker and eventually process included file.

    I included my files just to show real case. You may get exactly same issue if split your working cmd file in two and then include one portion into another with '-l' option.

    Original topic starter describes the problem with C header inclusion though C preprocessor. It looks like dependency is not detected properly for linker command files, and we presented two testcases for that. Would be happy if both get fixed.

    lkf.zip

  • Welcome rrlagic,
    I hope both the case would be resolved.
    As your case, it is necessary to do a successful build first. Then an error injection.
  • Even though I follow these steps, everything works as expected ...

    Hideaki Nambu said:
    [1]
    * Comment out the Line 2: "#define ADDR 0".
    * Right-click the project [_hello]
    * In the context menu, press [Build project].

    [2]
    * Type "foo" in the line 4.
    * Right-click the project [_hello]
    * In the context menu, press [Build project].

    Though I should point out one detail.  Every time I modify headerfile4cmd.h, I make sure to save the changes by entering ctrl-S.  Perhaps you are not saving those changes?

    Thanks and regards,

    -George

  • I can reproduce this problem ...

    rrlagic said:

    1. Build the project, make sure it succeeded.

    2. Modify included file whatever way and save.

    3. Build the project again. I mean regular build command

    Expected result: dependency modification detected and project gets relinked.

    Actual result:

    "D:\\TI\\ccsv7\\utils\\bin\\gmake" -k -j 8 all -O
    gmake[1]: 'myproject.out' is up to date.

    I filed CCSIDE-3125 in the SDOWP system to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • rrlagic said:
    It looks like dependency is not detected properly for linker command files, and we presented two testcases for that.

    Looking at some automatically generated Makefiles in CCS 7.1 I would say that the problem is not that dependency is not detected properly for linker command files, but rather that CCS hasn't (yet) implemented a mechanism to generate dependency information for linker command files.

    Also, when looking at for example MSP430 CGT v16.9.0.LTS I can't see an option for the linker to generate dependency information for linker command files (e.g. the linker doesn't recognize the -ppd option that the compiler does).

  • George,

    Let's back to the original point. It is not addressed yet.


    g> Though I should point out one detail. Every time I modify headerfile4cmd.h, I make sure to save the changes by entering ctrl-S. Perhaps you are not saving those changes?

    I'm sorry but it is not true.
    I redo the whole way to make sure that I have not forgotten to save files.

    Let me explain my problem again. Please duplicate.:

    - Once a [build project] succeeds, a newly injected error in the [headerfile4cmd.h] is not detected and a following [build project] passes again.

    - I have experienced this with ccs700, ccs612, and ccs-cloud.

  • Hello!

    Similar to you I have created a test case and checked in my environment with C-style inclusion of header file. I do confirm, that upon successful build any subsequent changes to included file are not detected, the project reported up to date. Thus I believe Chester's observation is just right: CCS does not produce and thus does not check dependency information for linker command files.

  • Hideaki Nambu said:

    Let me explain my problem again. Please duplicate.:

    - Once a [build project] succeeds, a newly injected error in the [headerfile4cmd.h] is not detected and a following [build project] passes again.

    I think I see what you are saying.  Others on the thread say that introducing any change in the file included from the linker command file fails to cause gmake to re-link.  I can reproduce that, and filed CCSIDE-3125 to have that addressed.  The difference in your case is that the change in the included file is an error, written incorrectly on purpose.  Is that an accurate summary?

    That being the case, CCSIDE-3125 addresses your situation as well.  Once it is fixed, gmake will recognize that a change in the included file means the link must occur again, and when that happens, the error is seen.

    Thanks and regards,

    -George

  • George, rrlagic,
    Thank you for better explanations.