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.

About the Smart Meter Reference design MSP430

Dear all,

There is a TI reference design related to the smart meter reference application and a file that goes with it. The file is a zip file named "slaa467", and it contains the compiler files for the IAR compiler. I downloaded the IAR compiler for the MSP430, but when I try to open the project file, I get an error. The following error is repeated for a number of files in the software suit:

Fatal Error[Pe035]: #error directive: Compiler not recognised.       ..\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-toolkit\isr_compat.h 82

I am not sure what it is as I have not looked at the code more closely yet, but what is this error and how may I go about this ?

Best regards,

Maziar




  • Hello Maziar,

    this fatal error message is directly thrown by the preprocessor while parsing isr_compat.h. The piece of code checks if a specific compiler preprocessor definition is set and then takes the ISR call that fits to this compiler. As the preprocessor can not find any of the below listed, it throws exactly this error.

    from file isr_compat.h:

    #if defined(__GNUC__)  &&  defined(__MSP430__)
        /* This is the MSPGCC compiler */
    #define ISR(a,b) interrupt(a ## _VECTOR) b(void)
    #elif defined(__AQCOMPILER__)
        /* This is the Quadravox compiler */
    #define ISR(a,b) void _INTERRUPT[a ## _VECTOR] b(void)
    #elif defined(__IAR_SYSTEMS_ICC__)  &&  (((__TID__ >> 8) & 0x7f) == 43)  &&  (__VER__ < 200)
        /* This is V1.xx of the IAR compiler. */
    #define ISR(a,b) interrupt[a ## _VECTOR] void b(void)
    #elif defined(__IAR_SYSTEMS_ICC__)  &&  (((__TID__ >> 8) & 0x7f) == 43)  &&  (__VER__ < 500)
        /* This is V2.xx, V3.xx, or V4.xx of the IAR compiler. */
    #define ISR(a,b) \
    __PRAGMA__(vector=a ##_VECTOR) \
    __interrupt void b(void)
    #elif defined(__CROSSWORKS_MSP430)
        /* This is the Rowley Crossworks compiler */
    #define ISR(a,b) void b __interrupt[a ## _VECTOR](void)
    #elif defined(__TI_COMPILER_VERSION)
        /* This is the Code Composer Essentials compiler. */
    #define ISR(a,b) __interrupt void b(void); \
    a ## _ISR(b) \
    __interrupt void b(void)
    #else
        #error Compiler not recognised.
    #endif

    In the IAR C/C++ compiler reference following is mentioned:

    __IAR_SYSTEMS_ICC__ An integer that identifies the IAR compiler platform. The
    current value is 7. Note that the number could be higher
    in a future version of the product. This symbol can be
    tested with #ifdef to detect whether the code was
    compiled by a compiler from IAR Systems.
    __ICC430__ An integer that is set to 1 when the code is compiled with
    the IAR C/C++ Compiler for MSP430.

    __VER__ An integer that identifies the version number of the IAR
    compiler in use. The value of the number is calculated in
    this way: (100 * the major version number +
    the minor version number). For example, for
    compiler version 3.34, 3 is the major version number and
    34 is the minor version number. Hence, the value of
    __VER__ is 334.

    I got no information about __TID__ which is also part of this condition check.

    Try to remove &&  (((__TID__ >> 8) & 0x7f) == 43) , maybe this works.

    The compiler and version should also be clear enough without this __TID__ check.

    Does someone else here have any glue about __TID__?

    Regards Marco

    P.S.: Checking your compiler version may also help.

  • Hello Marco,

    Thank you for your reply.

    You are right about the version checking.

    I have a problem of different kind now. Previous error which I posted is related to the IAR compiler, when I am compiling the Debug version of the software as choosing the Debug in the IAR compiler. If I choose the release version, I get a different error:

    This you can see below.

    Could you tell me anything about this, maybe I have to configure the IAR compiler for this.

    Best regards,

    Maziar

    Building configuration: emeter-47197 - Release
    Updating build tree...
     
    12  file(s) deleted.
    Updating build tree...
    bcd2bin.s43
    Error[40]: Bad instruction C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\msp430x471x7.h 614
    Error[40]: Bad instruction C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\msp430x471x7.h 630
    Error[42]: Duplicate label:'sfrl' C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\msp430x471x7.h 648
    Error[40]: Bad instruction C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\msp430x471x7.h 648
    Error[42]: Duplicate label:'sfrl' C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\msp430x471x7.h 664
    Error[40]: Bad instruction C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\msp430x471x7.h 664
    Error[42]: Duplicate label:'sfrl' C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\msp430x471x7.h 682
    Error[40]: Bad instruction C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\msp430x471x7.h 682
    Error[42]: Duplicate label:'sfrl' C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\msp430x471x7.h 698
    Error[40]: Bad instruction C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\msp430x471x7.h 698
    Error[40]: Bad instruction G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-toolkit\bcd2bin.s43 16
    Error[40]: Bad instruction G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-toolkit\bcd2bin.s43 43
    Error while running Assembler
    emeter-background.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-background.c 82
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
    emeter-basic-display.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-basic-display.c 69
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
    emeter-communication.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-communication.c 1
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
    emeter-dlt645.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-dlt645.c 67
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
    emeter-fir-table.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-fir-table.c 68
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
    emeter-foreground.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-foreground.c 80
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
    emeter-main.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-main.c 80
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
    emeter-multirate.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-multirate.c 67
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
    emeter-phase-corrections.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-phase-corrections.c 70
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
    emeter-rtc.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-rtc.c 66
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
    emeter-setup.c  
    Fatal Error[Pe1696]: cannot open source file "stdint.h" G:\Documents and Settings\maziar\My Documents\Downloads\slaa467\SMB2.5 Code\SMB25_latest_code\emeter-ng\emeter-setup.c 73
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\clib\"
                searched: "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\inc\"
    Error while running C/C++ compiler
     
    Total number of errors: 23
    Total number of warnings: 0


  • Hello Maziar,

    @Fatal Error[Pe1696]: cannot open source file "stdint.h"

    stdint.h contains type definitions for exact sized integer types (like uint8_t or int32_t)

    The IAR CLIB does not seem to be 100% C99 conform, thus this header file is only available if you use DLIB (from my experience).

    You can change this in Project/Options/General Options/Library Configuration/Library.

    But this is only a drop in the ocean, as after this fix further errors occur which could also be avoided (like the not defined __MSP430__ definition)

    For me it looks like that the IAR trunk has not been maintained  for some time.

    Maybe it is a good idea to contact the person who wrote or maintains this piece of code (email address can be found in the source files).

    Has someone else here experience with IAR+the mentioned package?

    Regards Marco

**Attention** This is a public forum