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.

CCS: gmake error

Other Parts Discussed in Thread: MSP430G2553

Tool/software: Code Composer Studio

hi, i was using msp430 in CCSv7......i was getting the following errors

1.  .h file includes itself

2.  gmake[main.obj]

3.   target all not remade because of  errors

  • Hi Likhil,
    Did you modify the msp430g2553.h that comes with CCS? The original file should guard against recursive inclusion.

    Thanks
    ki
  • Hi sir, I have gone through MSP430g2553 userguide, Erratasheet, & launchpad...But I didn't find how to rectify my errors....plz help me in rectifying my above errors

    Thanks in advance,
    likhil
  • Did you read my prior post? Your error looks like a recursive inclusion error of the header file.
  • can i know the procedure to overcome it?
  • See:
    en.wikipedia.org/.../Include_guard

    Now the msp430g2553.h file should have a guard. That is why I asked you in my first post if you modified it somehow.
  •  
    #include  "msp430g2553.h"
    #include  "stdio.h"
    #include  "string.h"
    #include "stdlib.h"
    #include "MSP430_LCD.h"     these are my header files
     
  • I'm actually interested in the actual file. Please attach the actual "msp430g2553.h" file being used to this thread
  • Thanks. But you attached the file msp430g2533.h. Your project is using msp430g2553.h

    Also, it would be helpful if you attached your entire project so i can analyze it

    Thanks

    ki

  • ok sir sure , i will send my project code now
  • and the msp430g2553.h file also. thanks
  • #include "msp430g2553.h"
    #include "stdio.h"
    #include "string.h"
    #include "stdlib.h"
    #include "MSP430_LCD.h"

    #define delay_value 500
    unsigned char status = 0;

    void main(void)
    {
    WDTCTL = WDTPW + WDTHOLD; // Stop WDT

    // initialize the clock frequency and DCO frequency to 8MHz by setting BCSCTLx registers
    BCSCTL1 = CALBC1_8MHZ;
    DCOCTL = CALDCO_8MHZ; // Set DCO

    //obtain 2MHz clock frequency
    BCSCTL2 |= DIVM_2 + SELM_0 + DIVS_2; // SMCLK = MCLK = DCO/4 = 8M/4 = 2MHz

    // Making all the port2 pins as basic I/O functionality
    P2SEL = 0;
    P2SEL2 = 0;

    // define necessary input and output pins
    P2DIR = 0xF0; // make all port pins as output P2.7,P2.6,P2.5,P2.4 are LCD pins
    P1DIR |= 0xC7; // P1.5 - gas Sensor(input), P1.6 and P1.7 for LCD, P1.0 - LED output, P1.3 - Motor , P1.2 - Buzzer
    P1OUT = 0X00;
    P2OUT = 0x00;
    P1IE |= 0x20; // P1.5 interrupt enabled
    P1IES &= ~0x20; // P1.5 low to high edge
    P1IFG &= ~0x20; // P1.5 IFG cleared


    // LCD first time initialize code
    delayms(1500); // wait for more than 15ms after supply rises to 4.5V
    send_cmd(0x30);
    delayms(4000); // wait more than 4.1ms
    send_cmd(0x30);
    delayms(1000); // wait more than 100us, but delayms(1) will provide 1ms
    send_cmd(0x30);
    delayms(1000);
    send_cmd(0x02); // return to home
    delayms(1000);

    LCD_Init(); // LCD initialization
    delayms(500);


    send_cmd(0x01);
    delayms(delay_value);
    send_cmd(0x80); // clear display
    delayms(delay_value);
    send_string("Fire Detection System:");
    delayms(60000);
    delayms(60000);
    __enable_interrupt(); // enable the global interrupt


    while(1)
    {

    if(status == 1)
    {
    P1OUT |= BIT2; // enable motor
    P1OUT |= BIT1; // buzzer motor
    send_cmd(0x01);
    delayms(delay_value);
    send_cmd(0x80);
    delayms(delay_value);
    send_string("Fire Detected!");
    delayms(60000);
    delayms(60000);

    }
    if(status == 0)
    {
    P1OUT &= ~BIT2; // enable motor
    P1OUT &= ~BIT1; // buzzer motor
    send_cmd(0x01);
    delayms(delay_value);
    send_cmd(0x80);
    delayms(delay_value);
    send_string("No Fire Detected!");
    delayms(60000);
    delayms(60000);



    //stop the timer
    }


    }// End of while

    } // end of main


    // Port 1 interrupt service routine
    #pragma vector=PORT1_VECTOR
    __interrupt void Port_1(void)
    {
    P1OUT ^= 0x01; // P1.0 = toggle output, it is just like a bench mark,
    //when P1OUT is 1, then motor will on otherwise it is off

    if(P1OUT & 0x01 == 0x01)
    {
    status = 1; // Fire detected
    P1IES |= 0X20; // Change the interrupt edge detection to high to low transition
    }
    else
    {
    status = 0; // no Fire detected
    P1IES &= ~0X20; // Change the interrupt edge detection to low to high transition
    }

    P1IFG &= ~0x20; // P1.5 IFG cleared

    }
    LCD CODE:
    #include "MSP430_LCD.h"
    #include "msp430g2553.h"
    #define delay_value 500
    void LCD_Init(void)
    {
    send_cmd(0x28); // configuring LCD as 2 line 5x7 matrix in 4-bit mode
    delayms(delay_value);
    send_cmd(0x0E); //display on, cursor blink
    delayms(delay_value);
    send_cmd(0x06); // auto increment of cursor
    delayms(delay_value);
    send_cmd(0x01); // clear display
    delayms(delay_value);

    }

    void send_cmd(unsigned char command)
    {


    P2OUT &= 0X00;

    P2OUT &= 0x00; // make upper bits of port as zero
    P2OUT =(command); //mask lower nibble and send upper nibble

    P1OUT &= ~0x40; // RS = 0 for command, P1.6 0x40
    //RW is grounded
    P1OUT &= ~0x80; //EN = 0, P1.7, 0x80
    delayms(delay_value);
    P1OUT |= 0x80; // EN = 1, P1.7, 0x80
    delayms(delay_value);
    P1OUT &= ~0x80; //EN = 0, P1.7, 0x80
    delayms(delay_value);

    P2OUT &= 0x00; // make upper bits of port as zero

    P2OUT =(command<<4 data-blogger-escaped-0="" data-blogger-escaped-0x00="" data-blogger-escaped-0x40="" data-blogger-escaped-0x80="" data-blogger-escaped-and="" data-blogger-escaped-as="" data-blogger-escaped-bits="" data-blogger-escaped-char="" data-blogger-escaped-character="" data-blogger-escaped-command="" data-blogger-escaped-delay_value="" data-blogger-escaped-delayms="" data-blogger-escaped-en="1," data-blogger-escaped-for="" data-blogger-escaped-grounded="" data-blogger-escaped-i="" data-blogger-escaped-if="" data-blogger-escaped-is="" data-blogger-escaped-lower="" data-blogger-escaped-make="" data-blogger-escaped-mask="" data-blogger-escaped-nibble="" data-blogger-escaped-of="" data-blogger-escaped-p1.6="" data-blogger-escaped-p1.7="" data-blogger-escaped-p1out="" data-blogger-escaped-p2out="(String[i]<<4);" data-blogger-escaped-port="" data-blogger-escaped-rs="0" data-blogger-escaped-send="" data-blogger-escaped-send_char="" data-blogger-escaped-send_string="" data-blogger-escaped-tring="" data-blogger-escaped-unsigned="" data-blogger-escaped-upper="" data-blogger-escaped-void="" data-blogger-escaped-while="" data-blogger-escaped-x40="" data-blogger-escaped-x80="" data-blogger-escaped-zero="">=16) // If the number of characters in the string > 16, then the below command automatically
    send_cmd(0x18); // Shift the display right side
    delayms(40000); // 100 millisec delay
    i++;
    }

    }


    void delayms(unsigned int value)
    {
    unsigned int i;
    for(i=0;i<value __delay_cycles="" i="" pre=""></value><!--4-->
  • Hello,

    I am not looking for a copy&paste of your code. I am looking for the actual project and source files (attached as a zip file). This would include everything in your project folder and and any dependent files outside of it (like header files). I basically want to import your project into my workspace.

  • Thank you for the header file. 

    This header file has been completely modified. There are many errors in it. You have source file in there that belongs in a *.c file. Where did you get this header file?

  • That header file is recursively including itself. It has no guard. But that is not the main issue. It looks like the original header file was gutted and replaced with custom code.
  • I downloaded it from github sir...can u send me the correct headerfile
  • Attached is the original header file found in:

    .\ccsv7\ccs_base\msp430\include

    /cfs-file/__key/communityserver-discussions-components-files/81/2072.msp430g2553.h

    The files you got from github may not be a good start for you. I would start with examples from MSPWare:

    http://dev.ti.com/tirex/#/?link=Software%2FMSP430Ware

    That is the recommended place to start.

    Also check out the CCS workshop for MSP430:

    http://dev.ti.com/tirex/#/?link=Development%20Tools%2FIntegrated%20Development%20Environments%2FCode%20Composer%20Studio%2FGeneral%20and%20IDE%2FTraining%2FWorkshops%2FMSP430%20Fundamentals%20Workshop%20for%20CCSv7

    It uses a different device but you can apply it to your device if you use the example for your device.

    Good luck!

    ki

  • Likhil,
    Just to clarify, I do not recommend using that example from github. Please check MSPWare for better examples to get started with. I would also seek the advice of the MSP experts in the MSP forum for more suggestions on which examples to get started with.

    Thanks
    ki