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.

Compiling a BIOS application with -pm (program level compile)

Other Parts Discussed in Thread: SYSBIOS, TEST2

Hi

 

I'm having a strange issue compiling my C66 application in CCS 5.0.3 with -pm flag:

After performing the RTSC stage on the cfg file, the compiler starts to compile my cpp (C++) files, and for some reason decides to compile the .cfg file as a C file as well !

Obviously, it generates errors on most lines of the cfg file ...

Looking in the Debug/Release folder, the ccsCompiler.opt file includes the cfg file in the list of files to compile ...

 

How can I overcome this?

 

 

Thanks

Ran

 

 

 

  • Ran,

    Which version of BIOS and XDCtools are you using?

    Can you please copy the full build output that shows these errors to this post?

    Can you please also zip up and attach your entire project directory to this post?

    Thanks,

    Steve

  • Hi Steve,

     

    I'm using

    BIOS 6.32.04.49,

    XDC tools 3.22.01.21,

    CGT 7.3.1

    on CCS 5.0.3.00028.

     

    Attached is a sample project which shows the problem. I am using Debug configuration and have set the -O3 and -pm options.

     

    I would like to point out that this only happens if the compiler command line is long enough that the cl6x call uses -@"ccsCompiler.opt".

    For this reason I created 100 dummy C files in this example ...

     

    Thanks

    Ran

    5153.pm_test.zip

  • Ran,

    I was able to build with the -pm option.  I've attached the project.  Can you try it?

    Steve

    3465.pm_test2.zip

    6811.pm_test2.txt

  • Hi Steve

     

    I tried it but get the same errors - see below.

    The only difference I see is that in my build, the cl6x command line uses -@"ccsCompiler.opt" for the list of files to compile (and this file has the cfg file listed which is a mistake), while in your build the list of files is explicit in the command line.

     

    How did you force the cl6x command line to include the list of files explicitly?

     

    Thanks

    Ran

     

     

     

    C:\TI\ccsv5\utils\gmake\gmake -k all 

    'Building file: ../app.cfg'

    'Invoking: XDCtools'

    "C:/TI/xdctools_3_22_01_21/xs" --xdcpath="C:/TI/bios_6_32_04_49/packages;C:/TI/ipc_1_24_00_16/packages;C:/TI/pdk_C6670_1_0_0_15/packages;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C66 -p ti.platforms.evm6670 -r release -c "C:/TI/C6000 Code Generation Tools 7.3.1" "../app.cfg"

    making package.mak (because of package.bld) ...

    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...

    configuring app.pe66 from package/cfg/app_pe66.cfg ...

    generating custom ti.sysbios library makefile ... 

    Starting build of library sources ...

    Build of libraries done.

    cle66 package/cfg/app_pe66.c ...

    'Finished building: ../app.cfg'

    ' '

    'Invoking: C6000 Compiler'

    "C:/TI/C6000 Code Generation Tools 7.3.1/bin/cl6x" -@"ccsCompiler.opt"

    [just_a_file_name_1.c]

    At end of source: warning: a translation unit must contain at least one declaration

    [app.cfg]

    "../app.cfg", line 1: error: identifier "var" is undefined

    "../app.cfg", line 1: error: identifier "xdc" is undefined

    "../app.cfg", line 1: error: function call is not allowed in a constant expression

    "../app.cfg", line 1: error: too many characters in character constant

    "../app.cfg", line 2: error: identifier "var" is undefined

    "../app.cfg", line 2: error: function call is not allowed in a constant expression

    "../app.cfg", line 2: error: too many characters in character constant

    "../app.cfg", line 3: error: identifier "var" is undefined

    "../app.cfg", line 3: error: function call is not allowed in a constant expression

    "../app.cfg", line 3: error: too many characters in character constant

    "../app.cfg", line 4: error: identifier "var" is undefined

    "../app.cfg", line 4: error: function call is not allowed in a constant expression

    "../app.cfg", line 4: error: too many characters in character constant

    "../app.cfg", line 5: error: identifier "var" is undefined

    "../app.cfg", line 5: error: function call is not allowed in a constant expression

     

    "../app.cfg", line 5: error: too many characters in character constant

    >> Compilation failure

    "../app.cfg", line 6: error: identifier "var" is undefined

    "../app.cfg", line 6: error: function call is not allowed in a constant expression

    "../app.cfg", line 6: error: too many characters in character constant

    "../app.cfg", line 7: error: identifier "var" is undefined

    "../app.cfg", line 7: error: function call is not allowed in a constant expression

    "../app.cfg", line 7: error: too many characters in character constant

    "../app.cfg", line 8: error: expected a ";"

    "../app.cfg", line 8: error: too many characters in character constant

    "../app.cfg", line 9: error: identifier "var" is undefined

    "../app.cfg", line 9: error: function call is not allowed in a constant expression

    "../app.cfg", line 9: error: too many characters in character constant

    "../app.cfg", line 10: error: identifier "var" is undefined

    "../app.cfg", line 10: error: function call is not allowed in a constant expression

    "../app.cfg", line 10: error: too many characters in character constant

    "../app.cfg", line 12: error: identifier "var" is undefined

    "../app.cfg", line 12: error: function call is not allowed in a constant expression

    "../app.cfg", line 12: error: too many characters in character constant

    "../app.cfg", line 13: error: identifier "var" is undefined

    "../app.cfg", line 13: error: function call is not allowed in a constant expression

    "../app.cfg", line 13: error: too many characters in character constant

    "../app.cfg", line 14: error: identifier "var" is undefined

    "../app.cfg", line 14: error: function call is not allowed in a constant expression

    "../app.cfg", line 14: error: too many characters in character constant

    "../app.cfg", line 20: error: this declaration has no storage class or type specifier

    "../app.cfg", line 20: error: expected a ";"

    "../app.cfg", line 37: error: this declaration has no storage class or type specifier

    "../app.cfg", line 37: error: expected a ";"

    "../app.cfg", line 37: error: unrecognized token

    "../app.cfg", line 44: error: this declaration has no storage class or type specifier

    "../app.cfg", line 44: error: expected a ";"

    "../app.cfg", line 62: error: this declaration has no storage class or type specifier

    "../app.cfg", line 62: error: expected a ";"

    "../app.cfg", line 69: error: this declaration has no storage class or type specifier

    "../app.cfg", line 69: error: expected a ";"

    "../app.cfg", line 75: error: this declaration has no storage class or type specifier

    "../app.cfg", line 75: error: expected a ";"

    "../app.cfg", line 78: error: this declaration has no storage class or type specifier

    "../app.cfg", line 78: error: expected a ";"

    "../app.cfg", line 81: error: this declaration has no storage class or type specifier

    "../app.cfg", line 81: error: expected a ";"

    "../app.cfg", line 86: error: identifier "var" is undefined

    "../app.cfg", line 86: error: identifier "new" is undefined

    "../app.cfg", line 86: error: expected a ";"

    "../app.cfg", line 87: error: this declaration has no storage class or type specifier

    "../app.cfg", line 87: error: expected a ";"

    "../app.cfg", line 88: error: identifier "var" is undefined

    "../app.cfg", line 88: error: function call is not allowed in a constant expression

    "../app.cfg", line 89: error: this declaration has no storage class or type specifier

    "../app.cfg", line 89: error: expected a ";"

    "../app.cfg", line 89: error: unrecognized token

    "../app.cfg", line 90: error: this declaration has no storage class or type specifier

    "../app.cfg", line 90: error: expected a ";"

    "../app.cfg", line 90: error: unrecognized token

    "../app.cfg", line 92: error: this declaration has no storage class or type specifier

    "../app.cfg", line 92: error: expected a ";"

    "../app.cfg", line 108: error: this declaration has no storage class or type specifier

    "../app.cfg", line 108: error: expected a ";"

    "../app.cfg", line 109: error: this declaration has no storage class or type specifier

    "../app.cfg", line 109: error: expected a ";"

    "../app.cfg", line 110: error: this declaration has no storage class or type specifier

    "../app.cfg", line 110: error: expected a ";"

    "../app.cfg", line 115: error: identifier "var" is undefined

    "../app.cfg", line 115: error: expected a ";"

    "../app.cfg", line 116: error: identifier "var" is undefined

    "../app.cfg", line 116: error: function call is not allowed in a constant expression

    81 errors detected in the compilation of "../app.cfg".

    gmake: *** [just_a_file_name_1.obj] Error 1

    gmake: Target `all' not remade because of errors.

  • Steve, hi again,

     

    I came across this post, from August 2011, which looks similar enough:

     

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/126323/452837.aspx

     

    Though I'm using CCS 5.0.3 and BIOS 6.x, I wonder if indeed this is the same bug, and if there is already a fix or workaround for it.

     

    Thanks

    Ran

     

  • Ran,

    I did some checking on this.  The bug filed for the post that you reference is SDSCM00041290.  This bug was closed as it was marked as a duplicate of SDSCM00040822.  This latter bug has been marked as fixed and verified as of September 20.  It is marked for inclusion in to the CCS 5.1 GA release, which has not been made available to customers yet.  It is due out later this month.

    BTW, here is the bug's description:

    CCS build interface does not correctly handle program mode compilation option (-pm ) in BIOS 5 projects.

    When program mode compilation (-pm) option is enabled the compiler basically expects all source files to be passed it to the shell together so it can perform optimizations at the whole program level and then it generates a single module (one .obj file). When this option is enabled in BIOS5 projects, the managed build does not seem to take the BIOS generated source files (*cfg_c.c and *cfg.s28) into account. These files are by default generated in \Debug, and it appears the make file is not picking up these files from there correctly. This results in 100+ errors at build time.

    To resolve it, the build has to be done in 2 steps:
    1) First run the build to compile the .tcf file - this build will result in several link errors
    2) Copy the BIOS generated files (*cfg_c.c and *cfg.s28) from \Debug to the same location as the source files
    3) Rebuild project and this time it will complete

    NOTE: This assumes that all source files are in the same directory as the project. If the source files are in a sub-folder, even more problems arise which will be submitted in a different defect report.
  • Hi David,

     

    Actually, I'm not sure it's the same issue here.

     

    I don't understand why in Steve's build the same project is built using cl6x and explicit filenames in the comand line, while in my build CCS builds it with -@ccsCompiler.opt.

    How is that determined and how can I change this?

     

    Thanks

    Ran

     

  • Ran,

    I think I was able to build because I am using an internal CCSv5.1 build that has the fix for this problem.  This version has not been released externally yet, as David mentioned previously.

    Have you tried the workaround for the bug described above?

    To resolve it, the build has to be done in 2 steps:
    1) First run the build to compile the .tcf file - this build will result in several link errors
    2) Copy the BIOS generated files (*cfg_c.c and *cfg.s28) from \Debug to the same location as the source files

    Steve

  • Hi Steve,

     

    I tried to build using the new CCS 5.1.0 GA build, but the same problem persists. Is this the CCS version that worked for you?

     

    Thanks

    Ran

     

  • Ran,

    The version you are having is actually newer and I would have expected the problem to be fixed.

    I am currently uninstalling my version of CCSv5 and will install the GA build. Once I get that done, I will try to reproduce your problem again.

    Steve

  • Ran,

    Are you still having this problem?

    I was still able to build the project (attached in previous post as pm_test2.zip).

    I built it on CCSv5.1

    In CCS "help->about" menu I see that my CCS version is 5.1.0.09000

    Which version of CCS do you see when you click on "help->about"?

    Steve