Package: gcc-msp430 Version: 4.5.3~msp20110421-1 Severity: wishlist The documentation should make clear that gcc-msp430 has some differences with respect to mspgcc4 (http://mspgcc4.sourceforge.net/), a project aiming at a GCC 4.x toolchain for Texas Instruments MSP430 MCUs. In fact most of the HOWTOs one can find online about developing on MSP430 by using the GCC compiler are about mspgcc4 (or mspgcc, with GCCv3) and the adaption to gcc-msp430 is non trivial.
For example, the code available at https://github.com/Hack-a-Day/had_launchpad-blink had to be modified with the following patch to compile correctly diff --git a/Makefile b/Makefile index 1c1e2c5..9e99753 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC=msp430-gcc -CFLAGS=-Os -Wall -g -mmcu=msp430x2012 +CFLAGS=-Os -Wall -g -mmcu=msp430g2231 -nostdlib /usr/lib/gcc/msp430/4.5.3/crt0ivtbl16.o -lgcc -lcrt0 OBJS=main.o diff --git a/main.c b/main.c index a52c4cf..4558ee5 100644 --- a/main.c +++ b/main.c @@ -28,8 +28,7 @@ Copyright (c) 2010 - Mike Szczys That the MPS430x2012 is closely related and I haven't observed any problems with using this header file. */ -#include <io.h> -#include <signal.h> +#include <msp430> #define LED0 BIT0 @@ -61,7 +60,7 @@ int main(void) { BCSCTL3 |= LFXT1S_2; //Set ACLK to use internal VLO (12 kHz clock) - TACTL = TASSEL__ACLK | MC__UP; //Set TimerA to use auxiliary clock in UP mode + TACTL = TASSEL_1 | MC_1; //Set TimerA to use auxiliary clock in UP mode TACCTL0 = CCIE; //Enable the interrupt for TACCR0 match TACCR0 = 11999; /*Set TACCR0 which also starts the timer. At 12 kHz, counting to 12000 should output @@ -75,7 +74,7 @@ int main(void) { } } -interrupt(TIMERA0_VECTOR) TIMERA0_ISR(void) { +void __attribute__(interrupt (TIMERA0_VECTOR)) TIMERA0_ISR(void) { LED_OUT ^= (LED0 + LED1); //Toggle both LEDs } The reasons for the changes are: - io.h is obsolete in Debian gcc-msp430, and should not be used. The header file msp430g2231.h (in package msp430mcu), included indirectly via msp430.h, has slightly different names of some macros. - signal.h is missing, thus there is no interrupt macro and the programmer has to use directly the GCC __attribute__ - libc.a is missing: this is not a problem for this example, since no libc functions are used; however the default linking gives an error since libc cannot be found. The last difference is the most annoying. I suggest to include libc.a in the next releases of the package, or to create a new libc-msp430 package. -- System Information: Debian Release: wheezy/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.39 (SMP w/2 CPU cores; PREEMPT) Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages gcc-msp430 depends on: ii binutils-msp430 2.21~msp20110421-2 Binary utilities supporting TI's M ii libc6 2.13-6 Embedded GNU C Library: Shared lib ii libgmp10 2:5.0.1+dfsg-7 Multiprecision arithmetic library ii libmpc2 0.9-3 multiple precision complex floatin ii libmpfr4 3.0.1-3 multiple precision floating-point ii msp430mcu 0~20110512-2 Spec files, headers and linker scr ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime gcc-msp430 recommends no packages. gcc-msp430 suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org