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.

IAR Problem - Can't Enable Global Interrupts

Other Parts Discussed in Thread: MSP430F2272

The problem I am having is this:

Everytime I attempt to compile my code in IAR Kickstart it throws an error on any method of enabling interrupts. For some reason IAR is not recognizing it's own intrinsic functions or assembler functions...

 

I have tried:

__enable_interrupt();   --> Error[Pe020]: Identifier "__enable_interrupt' is undefined

_EINT();  --> Error[Pe020]: Identifier "_EINT();" is undefined

 

I am using these function in the main program after configuring ports, clocks, USCI modules...

 

If anyone has any ideas as to why this is happening that would be great.

 

Thanks

  • Hi Alexander,

    The function _enable_interrupts()  (one underscore and 's' at the end) is defined in file intrinsics.h. You may include this.

    Just a comment, add also msp____.h for all your device related source files. This helps you on transition between IDEs.

    Regards

    Guenther

    PS: Verify the answer if you think it's correct. This helps to keep the forum clean.

  • Sorry I forgot to mention that I am using 'io430x22x2.h' (MSP430F2272) and 'intrinsics.h' in my includes already. I also found that in some of my other workspaces, I am using both _EINT(); or __enable_interrupt(); (two _ and no 's') and it compiles and loads fine.

    Now I am having another problem in my initial testing of a my 2272 module. Basically, the CPU is cycling through the while loop like it should but it is not calling the delay1(); function:

     

    Code Below:

     


    #include "io430x22x2.h"
    #include "intrinsics.h"

    void delay1(long int);

     

    int main( void )
    {
      // Stop watchdog timer to prevent time out reset
      WDTCTL = WDTPW + WDTHOLD;
     
      //Clock Module Calibration (15.85 MHz Measured SMCLK)
      DCOCTL = CALDCO_16MHZ;
      BCSCTL1 = CALBC1_16MHZ;
     
      P4DIR = 0xFF;
      P4OUT = 0x55;
        
      while(1)
      {
        P4OUT ^= 0xFF;
        delay1(800000);
       
      }

      return 0;
    }

    void delay1(long int ticks)
    {
      while(ticks > 0)
      {
        ticks--;
      }
      return;
    }


    This should just be toggling P4 between 55h and AAh while adding the delay of 800000 loops in between each toggle command. It worked earlier today but now through debugging I can watch as it just skips over the delay1(); function and goes back to the toggle command.

     

    Thanks,

     

    -Alex

  • Hi Alex,

    Most likely your compiler optimized it out. You may switch of the optimizer or declare ticks as volatile.

    Regards

    Guenther

**Attention** This is a public forum