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.

C674x CPU Register with CCS5 / CGT version change

Other Parts Discussed in Thread: CCSTUDIO

After migration from CCS4 to CCS5 5.1.0.09000 I get a syntax error for the following lines in my main.c file:

extern cregister volatile unsigned int IER;
extern __cregister volatile unsigned int CSR;

(Those lines are identical to the ones from ...\ccsv5\tools\compiler\c6000\include\c6x.h. In that file, no syntax error is shown).

As a consequence, the symbols IER and CSR cannot be resolved. I tried both compiler versions 6.1.14 and 7.3.1. I use those statements on file scope (I also tried as first lines in main.c).

My environment is

Another strange thing: After switching back to CGT 6.1.14, I get the error message:

!CONFIGURATION: {0} [Mon Jan 16 15:16:10 CET 2012]

    !TOOL: {0}

        !WARNING: Unresolved option: com.ti.ccstudio.buildDefinitions.C6000_6.1.compilerID.ABI

My questions:

1) Why does the keyword 'cregister' show in black instead of purple (it is not recognized as keyword in CCS5 and hasn't been in CCS4 either )

2) Can I use both '__cregister' (like in the c6x.h) and 'cregister' (like in spru187t, example 6-1) or is there a difference in behavior?

3) I didn't set the --coffabi compiler option manually, it was set automatically when I switched to CGT 7.3.1 (which is a nice feature but might cause problems). Why doesn't it get removed automatically when switching back to 6.1.14? Are there other settings that are changed when I go from 6.1.14 to 7.3.1 and back?

4) How can I get rid of the syntax error (I wouldn't want to go back to assembler code to modify IER unless there is a compiler directive to reserve one or two registers for my own assembler code)?

By the way, I was missing the tags 'compiler'/'CGT' and 'CCS v5'

  • Andreas44690 said:

    After migration from CCS4 to CCS5 5.1.0.09000 I get a syntax error for the following lines in my main.c file:

    extern cregister volatile unsigned int IER;
    extern __cregister volatile unsigned int CSR;

    Did you simply open your CCSv4 workspace in CCSv5? If so, that may be the reason for the syntax errors as we made some changes to the indexer during the move to v5. When migrating to CCSv5, it is recommended to open a new workspace and import v4 projects into it rather than opening the v4 workspace directly. Could you create a new workspace in CCSv5 and import your project into it and let us know if the syntax errors go away?

    A related thread is http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/138757.aspx

    Andreas44690 said:

    Another strange thing: After switching back to CGT 6.1.14, I get the error message:

    !CONFIGURATION: {0} [Mon Jan 16 15:16:10 CET 2012]

        !TOOL: {0}

            !WARNING: Unresolved option: com.ti.ccstudio.buildDefinitions.C6000_6.1.compilerID.ABI

    As you already realized, CGT 6.1.x does not have the --abi option which was added in later versions. When you change compilers from a newer CGT that had this build option to an older CGT that does not support the option, the warning message is expected. The message is to let the user know that the option is unresolved and is usually due to the version of CGT selected not supporting it. In this particular case the build should not be affected (since with CGT 6.1.x it will just default to COFF ABI).

     

     

  • I closed the 2nd thread on this topic (see http://e2e.ti.com/support/development_tools/compiler/f/343/t/159851.aspx#580846).

    AartiG said:
    Did you simply open your CCSv4 workspace in CCSv5?

    The link 'http://processors.wiki.ti.com/index.php/Migrating_to_CCSv5' doesn't seem to strictly require this. Thanks for the hint. When I start with a new workspace and import the 'corrupted' CCSv5 project, the live syntax checker recognizes the cregister keyword and the error disappears.

    However, the keyword __cregister is not recognized neither by the live syntax checker nor by the compiler (CGT 7.3.1, still the error message symbol 'IER' could not be resolved). I cannot explain this with the information JohnS gave on the other thread. By the way, c6x.h will also generate this error.

    Originally, I 'partly' opened a new workspace: Actually I work under clearcase version control using the eclipse plugin. I opened a new branch (snapshot view), obviously this is on a new workspace. Then I imported the project that was already existing within the workspace. The window

    appeared where I entered 'yes'. This for some reason did not work, probably because some project files were already 'there' (I didn't check the option 'copy into workspace', the project is in a subfolder). Is there a proposed path for migrating if I want to use a version control system? The following files are under version control (as proposed by TI Wiki: CCSv4 Tips & Tricks.pdf: .ccsproject / .cdtbuild / .cdtproject /  .settings  / .project (and inadvertently .gconf which I will delete). There are quite some differences in the files comparing 

    The file .cproject is not yet under version control (as proposed by the CCSv5 FAQ), the folder .metadata is not under version control.

    This leaves the following of the original questions open:

    - Which files are meant by 'new workspace'? How can I make sure my settings will get imported?

    Andreas44690 said:

    2) Can I use both '__cregister' (like in the c6x.h) and 'cregister' (like in spru187t, example 6-1) or is there a difference in behavior?

    3) ... Are there other settings that are changed when I go from 6.1.14 to 7.3.1 and back?

    By the way, I got an error message

    which I don't want to follow... .

  • Andreas44690 said:
    However, the keyword __cregister is not recognized neither by the live syntax checker nor by the compiler (CGT 7.3.1, still the error message symbol 'IER' could not be resolved). I cannot explain this with the information JohnS gave on the other thread.



    John's reply in the other thread acknowledged the issue with the syntax checker not correctly recognizing the __cregister keyword. This is a bug and is being tracked in bug # SDSCM00042924.

    Andreas44690 said:

    - Which files are meant by 'new workspace'? How can I make sure my settings will get imported?

    Regarding using version control with CCS, the files suggested to check in for CCSv4 and CCSv5 are documented in the wiki as you have found. You should be able to open a workspace in any location, check out the above set of files and then import and build your project.

    Andreas44690 said:
    Can I use both '__cregister' (like in the c6x.h) and 'cregister' (like in spru187t, example 6-1) or is there a difference in behavior?



    Please see this thread for further explanation.

    Andreas44690 said:
    Are there other settings that are changed when I go from 6.1.14 to 7.3.1 and back?

    I don't believe there should be but if you run into problems let us know.

    Andreas44690 said:

    By the way, I got an error message

    which I don't want to follow... .

    The message did not come through. Could you please re-attach a screenshot or the full text of the message and additional details on when it appears?

  • AartiG said:
    Regarding using version control with CCS, the files suggested to check in for CCSv4 and CCSv5 are documented in the wiki as you have found. You should be able to open a workspace in any location, check out the above set of files and then import and build your project.

    That did not work out. The only difference I can think of is that I checked 'Copy projects into workspace' when I did succeed in using the cregister keyword (in my 'test' project) whereas I did not check this box now. The differences are within the

    .cproject

    file (and many files in the .metadata file which is definitively not part of my version control). When I overwrite this file in my 'real' project with the one from the 'test' project, then I can use the cregister keyword. Should I send you both files?

    What is the difference (both files are generated new)?

  • Andreas,

    I'm not sure if I am clear on what you are saying. Are you saying that the method used for checking in/checking out of source control (whether you check the box to copy to workspace or not) affects whether the cregister keyword shows a syntax error or not?

    It would be very helpful if you could provide exact steps to duplicate the issue and if possible, attach your project here as well to help us reproduce it.

  • I don't think it is an issue related to source control. I did test many scenarios to eliminate this factor.

    AartiG said:
    It would be very helpful if you could provide exact steps to duplicate the issue

    The following scenario (if I remember correctly) works:

    •    open a new workspace (switch to a new workspace)
    •    Close the TI Resource Explorer
    •    File → Import → General → Existing Projects into Workspace, then click Next
    •    Select root directory, select 'Copy projects into workspace', click 'finish'
    •    Confirm the window 'Update Managed Build Project' with ‘Yes’   
    •    Window → Customize Perspective → Command Groups Availability: check ClearCase, click OK
    •    ClearCase → Connect to Rational Clearcase
    •    Build

    The following scenario fails:

    •    open a snapshot view
    •    check out all project files (.settings, .ccsproject, .cdtbuild, .cdtproject, .project)
    •    check out target configuration files
    •    CCS5: switch workspace to <new snapshot view>\<subdir>
    •    Close the TI Resource Explorer
    •    File → Import → General → Existing Projects into Workspace, then click Next
    •    Select root directory: <new snapshot view>\<subdir>\<subsubdir>, don't select 'Copy projects into workspace', Click Finish
    •    Confirm the window 'Update Managed Build Project' with ‘Yes’    
     
    •    Window → Customize Perspective → Command Groups Availability: check ClearCase, click OK
    •    ClearCase → Connect to Rational Clearcase
    •    Build

    Attached you find the two files where I noticed a difference.


  • The main difference I see between the two sets of steps is "copying project to workspace" and I don't see why that would make a difference in how the syntax checker works.

    Just to check if this makes a difference, could you try importing with File->Import->Code Composer Studio->Existing CCS/CCE Eclipse Projects instead of File->Import->General->Existing Projcts into Workspace?

    Also the files you mentioned were not attached. Could you please re-attach them?

  • I tried both again (to be sure I do exactly the same steps), the following did work:

    •    open a snapshot view
    •    check out all project files (.settings, .ccsproject, .cdtbuild, .cdtproject, .project)
    •    check out target configuration files:
    •    CCS5: switch workspace to <new snapshot view>\<subdir>
    •    Close the TI Resource Explorer
    •    Window → Customize Perspective → Command Groups Availability:    
    check ClearCase    
    click OK
    •    ClearCase → Connect to Rational Clearcase
    •    File → Import → Code Composer Studio → Existing CCS/CCE Eclipse Projects
    •    Select root directory: <new snapshot view>\<subdir>\<subsubdir>   
    Copy projects into workspace should not be selected    
    Click Finish

    The difference when I imported the projects was, I got asked whether I wanted to 'Update managed build project' when I was using 'File->Import->General->Existing Projcets', whereas there was no prompt when I used ''File->Import->Code Composer Studio->Existing CCS/CCE Eclipse Projects'. However, in the latter case, a couple of new files were generated automatically.

    Another strange thing happend using 'File->Import->General->Existing Projcets': Here I got an error message during my compilation:

    After closing the window, compilation continued and the next build ran without any problems.

  • OK, glad to hear that you were able to get things working. The recommended method when importing CCS projects is to always use "Project->Import Existing CCS/CCE Eclipse Projects" or "File->Import->Code Composer Studio->Existing CCS/CCE Eclipse Projects" as "CCS projects" extend the Eclipse project and add CCS specific information.

    I could not see details of the compilation error you mentioned above (there was nothing attached), but if you have other problems after importing projects using the above method, then please open a new thread for it so we can keep the issues separate, which make it easier to track and search.