On Mon, 2009-06-22 at 20:10 +0400, Dmitry Zuikov wrote:
> I have a compilation error when try to build a sample with USCI for
> 5418:

> led.c: In function `main':
> led.c:71: `UCA1CTL1' undeclared (first use in this function)
...
> However, when I try to fix it, say by defining 
> 
> #define __MSP430_HAS_USCI__
> #define __MSP430_HAS_USCI0__
> #define __MSP430_HAS_USCI1__

After peeking at the top of usci.h, it looks like __MSP430_HAS_USCI0_5__
and __MSP430_HAS_USCI1_5__ should be declared in the device's header
file.  The two that you've declared are for non-5xx targets, and the
device header file should deal with these anyway.

Looking in msp430x54xx.h, __MSP430_HAS_USCI0_5__ and
__MSP430_HAS_USCI1_5__ are declared -- so something odd is happening!

> $ msp430-gcc -Os -mmcu=msp430x5418 ./led.c -o led.elf 
> In file included from /opt/mspgcc/msp430/include/msp430x54xx.h:51,
>                  from /opt/mspgcc/msp430/include/io.h:152,
>                  from led.c:8:
> /opt/mspgcc/msp430/include/msp430/usci.h:426: conflicting types for 
> `UCB0I2COA'
> /opt/mspgcc/msp430/include/msp430/usci.h:303: previous declaration of 
> `UCB0I2COA'
> /opt/mspgcc/msp430/include/msp430/usci.h:428: conflicting types for 
> `UCB0I2CSA'
> /opt/mspgcc/msp430/include/msp430/usci.h:305: previous declaration of 
> `UCB0I2CSA'
> In file included from led.c:9:
> /opt/mspgcc/msp430/include/signal.h:39:2: warning: #warning X2 ist da

This is because you've declared the __MSP430_HAS_USCI0__ and
__MSP430_HAS_USCI1__ constants, which aren't for the 5xx devices.

> BTW, there were alse errors during build libc from the latest CVS
> snapshot - see diff:

This error is fixed by the patch I sent last week:
http://article.gmane.org/gmane.comp.hardware.texas-instruments.msp430.gcc.user/7833

I don't think it's hit CVS yet though.

Cheers,

Rob


Reply via email to