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.

Program mode optimization in CCS 3.3 gives "file not found"

Other Parts Discussed in Thread: SPRC141, CCSTUDIO

I have a project in CCS 3.3 for TMS320F2407 where code space is critical and for my "Release" target I therefore need to enable program-mode optimization (option -pm). Everything works as it should until I add at least one out of a group of assembly source files from the sprc141 flash programming API. As soon as I do that, the compiler throws an error message that makes no sense:

>> Cannot open source file '"_first_file_in_list.c"'

The source file is clearly there even though I understand that everything is copied together into a temporary file for program mode compilation. As soon as I do as much as excluding the assembly file from compilation, everything runs through fine. In my debug configuration with optimization turned off everything builds fine as well. There are other assembly files in the project that don't cause this effect. Here is what I have tried so far among other things, all to no avail:

- disabling optimization for the assembly file in question, thereby forcing it to be excluded from the program mode (I think)

- moving the assembly file into the same directory as the project file, or the directory of the other sources

- moving its include files into the same directory as the project file, or the directory of the other sources

I am at my wits end and would appreciate any hints on what else I could try. Here is the link to the flash API. I have changed nothing in the sources:

http://focus.ti.com/docs/toolsw/folders/print/sprc141.html

Chris

  • In program mode all the source files are passed to the parser with a -p switch.   It may be that for some reason the path information is getting removed as they get added to the -p switch.  Could you include the text in the output window from the compile?  If there is a tmp file, or a @ file, that might help as well.  Are you using the -px <file name> switch?

  • Thanks for your answer. When I select the program-mode optimization, the output is short:

    ---------------------------  cobt_e.pjt - Release  ---------------------------
    "D:\CCStudio_v3.3\C2400\cgtools\bin\dspcl" -q -pm -al -as -o3 -fr"E:/COBt_TMS320/prj/Release" -i"../inc" -i"../inc/tms320_flash" -mn -ms -ai..\..\inc\tms320_flash -pw2 -v2xx -@"../prj/Release.lkf"
    >> Cannot open source file '"e:\cobt_tms320\src\_first_c_file_.c"'

    Build Complete,
      1 Errors, 0 Warnings, 0 Remarks.

    The _first_c_file_.c is the name of the first file in the source file list. The Release.lkf file contains all options from the above command line (up until -@...) in the first line, followed by all source files with their complete (and accurate) paths in the following lines, one line for each file. So actually it seems that all options appear twice, once in the CCS-generated command file and once in the .lkf file. I just tried it directly from a command line window, omitting all options in the command line that are in the .lkf file, however with the same result (file not found). So that's not "it".

    But after playing with the .lkf file for a while it appears that there is a hard limit on the number of source files it can take - 10. It just so happened that my project contained 10 files before I added the assembly files so I thought that they are the culprit but in fact ANY other additional file will cause that error! I now added file-specific build options to all assembly files and removed their optimization settings. By doing that, they are all built separately and the number of source files in the Release.lkf file is then less than 10. And the build succeeds.

    Having a hard limit on the number of files in a command file seems highly odd, doesn't it?

  • I don't think there's a hard limit of 10 source files in a command file, but there may very well be other hard limits indirectly related to files and filenames.  Most of the hard limits were removed in the toolsets for the other targets, but not for that one.  What version of the compiler are you using with CCS 3.3?