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 error e89.



Hey guys!

Im creating a program to be implemented in the ez430-RF2500 kit, bit Im getting this error but i'm not quite sure why: 

Fatal Error[e89]: Too much object code produced (more than 0x1000 bytes) for this package

I've been searching about it and it says that my code is bigger than 4kb, but it isn't.

The IAR main specs are:

AR Assembler for MSP430
4.21.2 (4.21.2.50066)
C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\430\bin\a430.exe
28/08/2009 09:50:48 a.m., 2035712 bytes

IAR C/C++ Compiler for MSP430
4.21.2 [Kickstart] (4.21.2.30066)
C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\430\bin\icc430.exe
28/08/2009 09:58:32 a.m., 16039936 bytes

IAR Library Builder
4.61O (4.61.15.0)
C:\Program Files (x86)\IAR Systems\Embedded Workbench 5.4 Kickstart\430\bin\xar.exe
02/07/2009 01:41:04 p.m., 151552 bytes

And, if you want to see my code (and please check that it isn't bigger than 4kb), it is below. Pleasy if you can help me, i'd very grateful.

# include "mrfi.h"
# include <string.h>
# include <stdio.h>
# include <stdlib.h>
char dato[15];
char temp[15];
char temp1[15]="\nN";
char ene[15];
char temp3[15]="\nL";
char log[15];
char temp5[15]="\n00000012";
char jeringa_vacia[15];
char temp7[15]="\n00000021";
char jeringa_llena[15];
char temp_j[15];
int leer_tag=0;
int leer_masaje;
int cont_masajes=0;
char dato_xbee;
char dato_masaje;
int habilitar_serial=1;
//PIN_D2 variable de control
//0  Xbee 1 Tag
#pragma vector=PORT2_VECTOR
__interrupt void Port_2(void)
{
if (leer_masaje == 1)
{
cont_masajes++;
__delay_cycles (1000);
if(cont_masajes==dato_masaje)
{
P1OUT ^= 0x01; //PIN_D1
// UCA0TXBUF ='j'; //Es necesario el envio de 'j'?
leer_masaje=0;
cont_masajes=0;
}
}
}
void main()
{
BSP_Init();
MRFI_Init();
P3SEL    |= 0x30;     
UCA0CTL1  = UCSSEL_2; 
UCA0BR0   = 0x41;
UCA0BR1   = 0x3;
P2DIR |= ~0x01;
P2DIR |= 0x02;
P2REN |= 0x01;
P2IE |= 0x01;
P1OUT |= 0x00;
UCA0MCTL  = UCBRS_2;                     
UCA0CTL1 &= ~UCSWRST;
IE2      |= UCA0RXIE;
MRFI_WakeUp();
MRFI_RxOn();
__bis_SR_register(GIE+LPM4_bits);
   leer_tag=0;
   habilitar_serial=1;
   cont_masajes=0;
    printf("a");
   while(1)
   {
      if(habilitar_serial==1)
      {
         dato_xbee=getc();
         if (dato_xbee=='y')
         {
            P2OUT = 0x06;
            leer_tag=1;
            P1OUT = 0x01;
            habilitar_serial=0;
         }
         
         if (dato_xbee=='1'||dato_xbee=='2'||dato_xbee=='3'||dato_xbee=='4'||dato_xbee=='5'||dato_xbee=='6'||dato_xbee=='7'||dato_xbee=='8'||dato_xbee=='9')
         {
             P2OUT = 0x06;
            leer_masaje=1; 
            dato_masaje=dato_xbee;
            dato_masaje=dato_masaje-'0';
         }
      }
    
      if(leer_tag==1)
      {
         strcpy(ene,temp1);
         strcpy(log,temp3);
         strcpy(jeringa_vacia,temp5);
         strcpy(jeringa_llena,temp7);
         printf("s");
         P2OUT ^= 0x00;
         gets(dato);
         strcpy(temp,dato);
         if(!strcmp(ene,temp)){
            P2OUT = 0x10;
         }
         else{
            P2OUT = 0x08;
            printf("l01AAFFFFFFFFFFFF");
            gets(dato);
            strcpy(temp,dato);
            if(!strcmp(log,temp))
            {
              P2OUT = 0x04; //0x0000100
               printf("rv04");
               gets(dato);
               strcpy(temp,dato);
            if(!strcmp(jeringa_llena,temp))
                  P2OUT = ~BIT3; 
                  P2OUT = BIT1;
                  printf("wv0400000012");
                  gets(temp_j);
                  P2OUT = ~BIT0;
                  printf("j");
                  habilitar_serial=1;
                  leer_tag=0;
               }
               else
               {
                  P2OUT = ~BIT1;
               }
            }
         }  
      }
   }





  • The code you shown may be small, but it dragged in a lot of other code. Try to simplify your code to:

    #include "stdio.h"
    void main(void) {
      printf("s");
    }

    And see yourself how much code this drags in.

  • I'm sorry, but sincerely i'm not sure i understood your suggestion. This is my first time using microcontrollers and really i'm not veru sure of what i'm doing. My task is to translate a PIC compiler code into a MSP430 compiler code.

    As i got the trouble i've already told, what i'm doing now is to do some simple modifications, as converting this:

    printf("s");

    into:

    IE2 |= UCA0TXIE;
    UCA0TXBUF = 's';
    __delay_cycles (1000);
    UCA0TXBUF = 0x0;

    So i dont use a lot of stuff from the libraries and I certainly don't know if it works (in functions as printf or strcpy, that come from PIC compiler)

    I'm working on it but I'm not done, but the code is getting larger, so... I'm doing it still having my doubts..

  • IAR compiler for MSP430 can handle those Library function too. But the resulting total code size is more than 4KB. Your code size limited license does not allow you to do that.

    You may configure IAR compiler to use smaller versions of the Library, and it might work.

  • Oh really? I though that those functions where only for PIC compiler. I would like to try configuring the IAR compiler in order to use smaller versions of the libraries, as you suggest, but I dont know how. Could you give me a little explanation of that? It would help me a lot! 

    Sorry if there is any inconvenience.

  • Nicolas Cuervo said:
    This is my first time using microcontrollers

    Sounds like also your first time programming in 'C':

    Nicolas Cuervo said:
    functions as printf or strcpy, that come from PIC compiler

    Nicolas Cuervo said:
     I though that those functions where only for PIC compiler

    No:  those are part of the Standard 'C' library;  they are provided by every standard-compliant 'C' compiler - see any 'C' textbook for details.

  • I've tried this but i'm still getting the error. Thanks anyway for that tip, it looks very useful.

  • Solved it. Tho it is tricky to translate this codes that use STD libraries, the solution was simply NOT using them, as they consume a lot (or all) resources in very few lines.

    I replaced or created new functions using mrfi.h and msp430x22x4.h libraries, and everything went fine. So, in my opinion, it is better to create new functions instead of using STD functions (or at least I recommend that when using IAR kickstart, like my case)

    Hope this recommendation will be useful for newbies like me.

**Attention** This is a public forum