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.

declaration is incompatible with "__cc_version2 void Timer0_A0(void)

Other Parts Discussed in Thread: SIMPLICITI


Good afternoon,

I have all errors fixed except one using the new IAR compiler using SimpliciTI.  Can anyone comment on using IAR and getting this error?  I have commented out the "__intrinsic int __low_level_init(void);" in the file intrinsics.h

Basically I just added an interrupt and now it gives me an error.  The function below gives an error.  I've looked through BSP_board.c and do not see any "__low_level_init" function defined or used.


#pragma vector = TIMER0_A0_VECTOR
__interrupt   void  Timer0_A0()
{
  //errors even with no code in here
}


I don't know anything about this error and the documentation is not that great.  I'm using IAR 5.10.

Thanks,
Jamie

  • Change the declaration to

    __interrupt void Timer0_A0( void )

    and all should be fine.

    Jim Noxon

  • Hi Jim,

    I just built a new project and have most of the code commented out.  It is now compiling correctly.  Hopefully when I add the rest of the code back in it will work.  I'm hoping it was just a corrupt project file.  I'll test it out tonight and let you know.

    Thanks for your quick response,

    Jamie

  • Hi Jim,

     

    I believe I have figured it out.  You have to disable the checkbox  "Require prototypes" (Under Options\C/C++ Compiler\Language".  When you have a prototype defined for an interrupt, the intrinsic function threw an error.  By removing the prototype declaration and just putting the interrupt function in worked for me.  Very odd that removing that checkbox made it work.  This seems to be a bug in IAR.

     

    Thanks for your help.  I'll do some more testing on actual devices to confirm that everything works now.

    Jamie

     

     

  • It's not a bug.  The original problem was that your prototype didn't match the one for the required form of an interrupt function.  Thus, because the check box was on, you received an error because this check box was telling the compiler to generate one if the prototype didn't match the proper form.  With this check box off, sure you can compile now, but it can be dangerous because the C language allows for many things to be ignored.  Try putting in the void keyword within the parameter list of your function and see if the IAR compiler will allow you to keep the check box turned on.

    Although it is acceptable to turn off this check box, you can run into some really escoteric issues to debug.  These can take several days with plenty of questions as to why.  If you have this check box turned on, then you know the answer right away and can skip the debugging of unnecessary bugs.  See this thread for a great example of just how easily this can happen.  http://e2e.ti.com/support/microcontrollers/tms320c2000_32-bit_real-time_mcus/f/171/p/99365/348383.aspx#348383.  Notice that this took 2 days and the effort of 2 people before the actual problem was figured out by the person placing the post.

    Jim Noxon