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 v.5.1 (M7) Code Analysis Plug-In Errors

Expert 2430 points

M5 and M6 releases were fine in this regard, but M7 seems to break Eclipse's code analysis plugin.  It will generate "Symbol is not resolved," "Type cannot be resolved," or "Field cannot be resolved" errors for all register references (IER, TSCH, etc.) and for some SYS/BIOS definitions or declarations  (It doesn't like BIOS_WAIT_FOREVER, Diags_USERx macros, fields in the Timer_Params struct, etc.)

I can get around this, of course, by turning off those two specific checks, but I was wondering if there were any plans to fix this before the final v.5.1 release.  I am guessing you got around this in M5 and M6 by somehow adding exclusions to the analysis plugin, but in your quest (which I fully endorse) to make CCS use the official Eclipse releases, my fear is that the code analysis plugin will never be compatible with code generated with TI tools and libraries.

  • Hi Alex,

    Talking with the CCS development team here, there was no change made to this plugin between M6 and M7. There were no exclusions made in the prior builds.

    One thing I found out is that the parsing is disabled for new project but not for imported ones. So maybe in M6, you were working with new projects and with M7, you imported them?

    ki

  • That might be a true statement.  For sure in M7 I imported my projects, but I just don't recall if I also imported them in M6 or just recreated them from scratch.  I am thinking I actually recreated them because at the time, I was worried about workspace compatibility and since I was still in the "evaluate before I fully commit" mindset at the time, I probably recreated them.

    Okay, so that means that the Code Analysis plug-in has probably always been broken.  Are there any plans to fix it, or is our only option just to disable the "Syntax and Semantic Errors" section of the plug-in?

     

    Edit:  By "fix" I just mean provide a work-around, i.e., I am not implying that this is a bug on your part.  I understand if this is just one of the downsides of not using a custom Eclipse build, and I would rather just turn off the checks rather than go back to the CCSv4 model. :-)

  • After further analysis, I must respectfully disagree with the CCS development team--well, sort of.  I believe them when they say no changes were made, but that, quite likely, may be the cause of problem.  Eclipse got upgraded along with the analysis plug-in, and apparently these aren't compatible with TI's headers.

    I still have M6 installed, and when I open up my project with that, the plug-in has no problem interpreting the XDC and SYS/BIOS headers and properly resolving things.  (Yes, I verified and even tested to make sure that the analysis plug-in was doing its thing.)  Same project under M7, errors galore.

    To verify for yourself on your end, simply create the SYS/BIOS "C++ Example (bigtime)" demo project.  Under M5 and M6, you'll get no errors, but under M7, you do.

     

    Addendum #1:  As an added clue, it seems that switching SYS/BIOS versions changes things a bit.  Under M7's default 6.32.3.43, you'll get 6 errors and 7 warnings.  Install 6.32.2.39 (what comes with M6), and it skyrockets to 91 errors and  277 warnings.  Keep in mind that with either SYS/BIOS install, the bigtime demo project builds fine with no warnings or errors (from the compiler).  Again, this is all just with your own "C++ bigtime" demo project.

    Addendum #2: For the SYS/BIOS related errors, the problem is related to your incorrect "__nested__" macro that you have guarding all your "PREFIX ALIASES" sections.  In all the headers, you have __nested__ being defined whether it is nested or not, and therefore, the analysis tool (and the indexer, too, for that matter) is excluding that section and, thus, deeming them undefined.  If I remove that check from the included include files, the errors go away.

    Unfortunately, this does not explain the intrinsic register variables.  In the bigtime demo, include <c6x.h> (and use a 64x+ simulator as your target), and then in main, simply add the line "IER = 0;" to the code.  In M5 and M6, no problem; but M7 produces a "Symbol 'IER' could not be resolved' error.

  • So this subject is considered closed or something?

  • The development team is still investigating. Sorry for the delay in responding.
    Raj

  • Hi Alex,

    I am trying to reproduce this problem, but without any luck. I have both 5.1.06000 and 5.1.07001 install and create the SYS/BIOS bigtime project. These are the steps that I do to create the project and build it, let me know whether I am missing any step.

    1. Open New CCS Project wizard (File | New | CCS Project)
    2. Enter 'bigtime' for Project name
    3. Select 'C6000' family and change variant to 'Generic C64x+ Device'
    4. Select 'SYS/BIOS | Generic Examples | C++ Example (bigtime)' in the project templates tree
    5. Press 'Next >'
    6. Select 'ti.platforms.sim64Pxx' platform
    7. Press 'Finish'

    I build the project and didn't get any analysis error (I guess you mean the error icon in the editor, right?)

    Then I add '#include <c6x.h>' to bigtime.cpp file and 'IER = 0' in main, I also didn't get any error.

    This could be related to caching issue that you see and I don't see. Can you zip up the example project that you use and attach to this thread?

    Also, after you have zipped up the project, can you try to clean, close, re-open the project and rebuild. Are the errors still there?

    Regards,
    Patrick

  • Doing the above, if you look in your project settings (Advanced Settings, C/C++ General, Code Analysis, Launching), you will see that the analysis is not turned on.  Turn it on (select both "build" and "as you type"), build the project, and you will see the 8 errors and 188 warnings.

    Attached is a new bigtime project created in a new workspace.  I created the project inside the workspace and then zipped it all up, so you should be able to just unzip this anywhere, and then just select that directory when launching CCS and it asks for your workspace.

    6874.bigtime.zip

    P.S. The only thing I changed to the generated code was adding the header <c6x.h> and line "IER = 0" for demonstration purposes.  Everything else, including project and workspace settings, are your default values (except the enabling of the analysis tool, of course).

  • Hi Alex,

    CCS currently turns Static Code Analysis off for all new and imported CCS projects.  The reason is that the default rules of the tool do not currently work for TI projects.  They probably never will for complex projects that make use of RTSC - these projects really can't be analysed statically - they must be built.  So, turning Static Code Analysis off, is the current solution (or workaround) to the fact that the tool does not work for TI projects out of the box.

    You may have seen a temporary change in behaviour with one of the milestone builds.  This was because Static Code Analysis has changed the way it persists its settings (the two checkboxes which turn the analysis on during builds and as you type).  Thus, CCS had to adjust the logic that turns the tool off, and there might have been a gap where the tool remained on.  But the current end result is the same - the Static Code Analysis tool has to be turned off for both new and imported CCS projects.

    If you currently have a project that gives you static code analysis errors, try reimporting it with the latest build of CCS.  Or you could also just turn off the two checkboxes on the C/C++ General > Code Analysis > Launching page, and manually select and delete all the errors in the Problems view.

    - Baltasar

  • Hi all,

    I'm trying to build an imported legacy  CCS 3.3 project for ARM7 generic device, in CCSv5.1.1, and I'm getting a list of unresolved symbols.

    Even NULL is undefined, I defined NULL in one of the header files included with the project, that even that doesn't help. I tried that turning off the two checkboxes on the C/C++ General > Code Analysis > Launching page, but I don't see any errors, which can be deleted manually.

    Also, tell me how to check for the releases M6 or M7 etc.

    Thanks

    Jasmeet

     

  • Jasmeet,

    Jasmeet Kaur97544 said:
    I tried that turning off the two checkboxes on the C/C++ General > Code Analysis > Launching page, but I don't see any errors, which can be deleted manually.

    The reference here to deleting the errors manually is referring to deleting the errors in the Problems view before doing a clean and build project.

    Jasmeet Kaur97544 said:

    Also, tell me how to check for the releases M6 or M7 etc.

    These are beta milestone builds that were available prior to the final 5.1.0 release. They are no longer available. If you are already on 5.1.1 you do not need to worry about these releases.

    If you start a clean new workspace in CCS 5.1.1 (and ensure that the two checkboxes in the C/C++ General > Code Analysis > Launching page are disabled) do you still see the errors? I assume these are only indexer errors displayed in the editor and not compiler errors. If so, could you provide a screenshot?