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.

MSP430g2553 & gcc low power mode issue

Other Parts Discussed in Thread: MSP430G2553

Dear all,

I try to configure my msp430 in ultra low power with the following commands in an hello world code....


BCSCTL3 |= LFXT1S_2;
BCSCTL2 |= SELM_3 | SELS;
BCSCTL3 = 0x20;
__bis_status_register(SCG1+SCG0);

I use gcc compiler on ubuntu 12.04 LTS .

My makefile is like that
 TARGET := $(v).elf
CC:= msp430-gcc
CFLAGS:= -Os -Wall -g -O0 -mmcu=msp430g2553

OBJS:=$(v).o
$(TARGET):$(OBJS)
    $(CC) -o $(TARGET) $(FLAGS) $(OBJS)

clean:
    rm rf $(TARGET) $(OBJS)

prog: $(TARGET)
    mspdebug -q rf2500 "prog $(TARGET)"

I have fine incluse #include <msp430g2553.h> in my hello world file.

Compilation avorte with the followingl inker error : msp430/main.c:9: undefined reference to `__BCSCTL3'



Any ideas o solve this issue ?

Best regards,

GM
  • my makefile:

    CC=msp430-gcc CFLAGS=-Os -Wall -g -mmcu=msp430g2553 OBJS=main.o all: $(OBJS) $(CC) $(CFLAGS) -o main.elf $(OBJS) %.o: %.c $(CC) $(CFLAGS) -c $< clean: rm -fr main.elf $(OBJS)

    and low power is:
      __bis_SR_register(GIE + LPMx_bits);       //interrupts enabled

    and include library is:

    #include<msp430.h>
    #include<legacymsp430.h>


  • It appears that it doesn't know what BCSCTL3 is.

    Have you checked your msp430g2553.h include file to make sure that this register defintion is in there? My IAR version looks correct and nothing in your code appears to be wrong.

    One other thing, does the compiler know where the include file is (if not in the same directory as your main.c source file)?

  • Thank you for your replies.

    I checked the msp430.h library. He know tis register.

    If I transforme my code like that : BCSCTL3|= LFXT1S_0, compiler say ok.

  • In usr/lib/gcc/msp430/4.5.3/include no file such as msp430x2x53 or equivalent.

    When I ask apt-get install gcc-msp430, ubuntu say me that it is the last version...

  • Gege,

    Not sure what to make of your post history on this topic. It should work, but sounds like there is some tool-related issue.

    Most people here on the forum use Code Composer Studio or IAR Workbench, both of which have a suite of include files for all the TI devices.

  • Apologies, it was just a flag issue.... CFLAG and no FLAG in makefile !

     

**Attention** This is a public forum