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.

__TI_COMPILER_VERSION__

Other Parts Discussed in Thread: MSP430F2618, MSP430F2013

Hi,

I have a problem with the CCS5. I port the TI SD MMC Libary to the MSP430F2618. It runns in the SPI mode without problems. If turn on the #define withDMA, I had to set the preprocessor word " __TI_COMPILER_VERSION__ ". A new compile gets this error:

Command-line error #1046: invalid macro definition: __TI_COMPILER_VERSION__

1 fatal error detected in the compilation of "../hal_SPI.c".

Compilation terminated.

Maybee someone knows a workaround.

 

THX

  • Hi Roger,

    I found two immediate things which I hope will help you on your way, but hopefully my more expert colleagues will be able to help further.

    1- there was a ; missing in both .c files where the #ifdef __TI_COMPILER_VERSION__ is used

    2 - I believe the lpm3 exit might have to be done different

    3 - I recommend, if you are modifying things anyhow, just removing the parts for the other compilers.  I found things better if I removed the # defines so I did not need a __TI_COMPILER_VERSION+#ifdef __TI_COMPILER_VERSION__

    #ifdef __TI_COMPILER_VERSION__
    __interrupt void DMA_isr(void);
    DMA_ISR(DMA_isr)
    __interrupt void DMA_isr(void);  //This line was missing a ; in two files
    #endif
    {
      DMA0CTL &= ~(DMAIFG);
      LPM3_EXIT;   // Look at the migration guide, I believe this is done different in CCS ...
    }

    Hope the tip gets you a bit further. 


    Best Regards,

    Lisa

  • You should not set __TI_COMPILER_VERSION__; this macro is reserved for the compiler to identify itself to the user.  It is always set by the TI compilers.

  • I can't find reference to "__TI_COMPILER_VERSION__", but in CCS5.2, at Project > Properties > C/C++ General > Paths and Symbols > Symbols, "__TI_COMPILER_VERSION" is defined (no trailing underscores)

    So, to my current issue. Some of my code has been developed over the years to allow the use of various compilers, so a means of identifying them had to be found. The mspgcc compiler defines CC__MSPGCC, and I tried __TI_COMPILER_VERSION__ for CCS5.2, but the editor immediately shaded it out (The Editor is set to report problems as I type). __TI_COMPILER_VERSION was accepted. It doesn't appear to work as would be expected though.

    My code ...

    .... shows __TI_COMPILER_VERSION has been found / defined, so <msp430f2013.h> should be included. However, the compile fails with 65 errors, the first of which is identifier "WDTCTL" is undefined. <mps430f2013.h> defines it, so clearly, that header file was not found by the compiler. There is also a warning that nop() is declared implicitly. So.

    __TI_COMPILER_VERSION was replaced with __TI_COMPILER_VERSION__:-

    __TI_COMPILER_VERSION__ was not found, judging by the greyed out code, but a compile resulted in no errors at all. The burning question then - where is <msp430f2013.h> and especially, "nop()" defined?  I make reference to WDTCTL and nop() later in the code, so something defined them, and I did a Project -> Clean to build it, so there is no carryover from previous builds. It is there in ./Debug/main.pp, but how did it get there?

  • Errol,

    This is related to this other thread. Basically the issue is that CCS is not handling the preprocessor symbol __TI_COMPILER_VERSION__  properly. This is a symbol defined by the compiler and is handled properly in your code  (as you noticed it does build properly without errors by finding the appropriate header file), however CCS highlights it incorrectly in the editor. We plan to get it logged as a CCS bug, so please continue to follow the other thread I referenced to follow up on it.