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.

Porting IAR code to CCS Build errors

Other Parts Discussed in Thread: MSP430F2410

Hi,

I am porting IAR Embedded workbench project source code to Code composer studio.5.5.0

The source code is building fine with IAR Embedded workbench IDE.MCU is msp430f2410.


I have created a project in CCS with the same MCU as target and i integrated all source files to the project.

During Build i have Build errors..
====================================

1) #102 "BYTE" has already been declared in the current scope     tick.c     line 95     C/C++ Problem


====================================


Below code exist on the Build error line for the above.
====================================
1) static volatile __no_init BYTE   CurrentMode;                               tick.c     line 95
 ====================================

 If __no_init is removed the build error is gone. I think this IAR specific code but i need the equivalent of this in CCS?

 

  • Add something like this to an appropriate header file ...

    #ifdef __TI_COMPILER_VERSION__  // only true for TI compiler
    #define __no_init __attribute__((noinit))
    #endif
    

    You also have to use the build option --abi=eabi, because NOINIT variables are only supported with the newer EABI, and not the older COFF ABI.

    It is likely that the TI compiler handling of NOINIT matches that of the IAR compiler.  However, because I am not familiar with the IAR compiler, you ought to check and be sure.  Start by reading the section titled The NOINIT and PERSISTENT Pragmas in the MSP430 compiler manual.

    Thanks and regards,

    -George