From e5fc8a027fccccf4311771fb364ae86731591101 Mon Sep 17 00:00:00 2001 From: dragorn Date: Tue, 17 Jan 2012 16:13:17 +0000 Subject: [PATCH] Update to add support for MSP430-GCC 4.6 which moved things around; - Use standard linker scripts, existing ones no longer work - Refer to MCUs as 'msp430fZZZZ' instead of 'msp430xZZZZ', the 'x' references no longer work - Rename lib/msp430xZZZZ to msp430fZZZZ to simplify compiling with new MCU name - Compiles clean against all platforms, tested against hardware for gf20, gf30, telosb, nhb12 git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1082 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- firmware/Makefile | 2 +- firmware/config.mk | 20 +++++++++---------- firmware/include/command.h | 2 +- firmware/lib/{msp430x1612.c => msp430f1611.c} | 0 firmware/lib/msp430f1612.c | 2 ++ firmware/lib/{msp430x2254.c => msp430f2254.c} | 2 +- firmware/lib/{msp430x2274.c => msp430f2274.c} | 2 +- firmware/lib/{msp430x2618.c => msp430f2618.c} | 0 firmware/lib/msp430x1611.c | 1 - firmware/platforms/arduino.h | 2 +- firmware/platforms/donbfet.h | 2 +- firmware/platforms/goodfet.h | 2 +- 12 files changed, 19 insertions(+), 18 deletions(-) rename firmware/lib/{msp430x1612.c => msp430f1611.c} (100%) create mode 100644 firmware/lib/msp430f1612.c rename firmware/lib/{msp430x2254.c => msp430f2254.c} (69%) rename firmware/lib/{msp430x2274.c => msp430f2274.c} (69%) rename firmware/lib/{msp430x2618.c => msp430f2618.c} (100%) delete mode 100644 firmware/lib/msp430x1611.c diff --git a/firmware/Makefile b/firmware/Makefile index 897e4ec..319ffd5 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -22,7 +22,7 @@ GCCINC?= # very end of the command line, so they only have an effect for a # default linker script GCC?=msp430-gcc -LDFLAGS?=-Wl,-dT ldscripts/$(mcu).x +LDFLAGS?=-mmcu=$(mcu) #-Wl,-dT ldscripts/$(mcu).x CCEXTRA?= $(CFLAGS) -D$(mcu) -D$(platform) -Dplatform=$(platform) -Dboard=$(board) $(GCCINC) -I include -I platforms CC=$(GCC) -Wall -Os -fno-strict-aliasing -g -mmcu=$(mcu) $(CCEXTRA) diff --git a/firmware/config.mk b/firmware/config.mk index 2a26346..945c7ce 100644 --- a/firmware/config.mk +++ b/firmware/config.mk @@ -4,53 +4,53 @@ mcu = undef ifneq (,$(findstring $(board),goodfet20 goodfet10 goodfet11)) -mcu := msp430x1612 +mcu := msp430f1612 platform := goodfet endif ifneq (,$(findstring $(board),goodfet21)) -mcu := msp430x2618 +mcu := msp430f2618 platform := goodfet endif ifneq (,$(findstring $(board),goodfet30 goodfet31)) -mcu := msp430x2274 +mcu := msp430f2274 platform := goodfet # This will link to fit in a '2254, so unneeded packages should be omited. CONFIG_ccspi = n endif ifneq (,$(findstring $(board),goodfet40 goodfet41)) -mcu := msp430x2618 +mcu := msp430f2618 platform := goodfet endif ifneq (,$(findstring $(board),nhb12b)) -mcu := msp430x2618 +mcu := msp430f2618 CONFIG_nrf = y platform := nhb12b endif ifneq (,$(findstring $(board),nhb12)) -mcu := msp430x2618 +mcu := msp430f2618 CONFIG_nrf = y platform := nhb12 endif ifneq (,$(findstring $(board),goodfet50 goodfet51)) -mcu := msp430x5510 +mcu := msp430f5510 platform := goodfet endif ifeq ($(board),telosb) -mcu := msp430x1612 +mcu := msp430f1611 platform := telosb config := monitor spi ccspi CFLAGS += -Duseuart1 endif ifeq ($(board),telosbbt) -mcu :=msp430x1612 +mcu :=msp430f1612 platform := telosb config := monitor spi ccspi endif @@ -78,7 +78,7 @@ config := monitor endif ifneq (,$(findstring $(board),tilaunchpad)) -mcu :=msp430x1612 +mcu :=msp430f1612 CFLAGS := -DDEBUG_LEVEL=3 -DDEBUG_START=1 -DINBAND_DEBUG #CFLAGS+= -Werror config := monitor chipcon i2c diff --git a/firmware/include/command.h b/firmware/include/command.h index ca2f6a8..3abffad 100644 --- a/firmware/include/command.h +++ b/firmware/include/command.h @@ -15,7 +15,7 @@ #define u32 unsigned long -#ifdef msp430x2274 +#ifdef msp430f2274 //256 bytes, plus overhead //For chips with very little RAM. #define CMDDATALEN 0x104 diff --git a/firmware/lib/msp430x1612.c b/firmware/lib/msp430f1611.c similarity index 100% rename from firmware/lib/msp430x1612.c rename to firmware/lib/msp430f1611.c diff --git a/firmware/lib/msp430f1612.c b/firmware/lib/msp430f1612.c new file mode 100644 index 0000000..3eef946 --- /dev/null +++ b/firmware/lib/msp430f1612.c @@ -0,0 +1,2 @@ + +#include "msp430f1611.c" diff --git a/firmware/lib/msp430x2254.c b/firmware/lib/msp430f2254.c similarity index 69% rename from firmware/lib/msp430x2254.c rename to firmware/lib/msp430f2254.c index 566174c..b2aa30c 100644 --- a/firmware/lib/msp430x2254.c +++ b/firmware/lib/msp430f2254.c @@ -2,4 +2,4 @@ //platform.h will handle patching Port 5 to be Port 3. -#include "msp430x2618.c" +#include "msp430f2618.c" diff --git a/firmware/lib/msp430x2274.c b/firmware/lib/msp430f2274.c similarity index 69% rename from firmware/lib/msp430x2274.c rename to firmware/lib/msp430f2274.c index 566174c..b2aa30c 100644 --- a/firmware/lib/msp430x2274.c +++ b/firmware/lib/msp430f2274.c @@ -2,4 +2,4 @@ //platform.h will handle patching Port 5 to be Port 3. -#include "msp430x2618.c" +#include "msp430f2618.c" diff --git a/firmware/lib/msp430x2618.c b/firmware/lib/msp430f2618.c similarity index 100% rename from firmware/lib/msp430x2618.c rename to firmware/lib/msp430f2618.c diff --git a/firmware/lib/msp430x1611.c b/firmware/lib/msp430x1611.c deleted file mode 100644 index 48d28f0..0000000 --- a/firmware/lib/msp430x1611.c +++ /dev/null @@ -1 +0,0 @@ -#include "msp430x1612.c" diff --git a/firmware/platforms/arduino.h b/firmware/platforms/arduino.h index ea34506..88ec4d1 100644 --- a/firmware/platforms/arduino.h +++ b/firmware/platforms/arduino.h @@ -18,7 +18,7 @@ void arduino_init(); #define PLEDPIN 0x20 //Use P3 instead of P5 for target I/O on chips without P5. -#ifdef msp430x2274 +#ifdef msp430f2274 //#warning "No P5, using P3 instead. Will break 2618 and 1612 support." #define P5OUT P3OUT #define P5DIR P3DIR diff --git a/firmware/platforms/donbfet.h b/firmware/platforms/donbfet.h index 41879fe..37db358 100644 --- a/firmware/platforms/donbfet.h +++ b/firmware/platforms/donbfet.h @@ -53,7 +53,7 @@ #define PLEDPIN PB0 //Use P3 instead of P5 for target I/O on chips without P5. -#ifdef msp430x2274 +#ifdef msp430f2274 //#warning "No P5, using P3 instead. Will break 2618 and 1612 support." # define P5OUT P3OUT # define P5DIR P3DIR diff --git a/firmware/platforms/goodfet.h b/firmware/platforms/goodfet.h index 8e4249c..b2b5bec 100644 --- a/firmware/platforms/goodfet.h +++ b/firmware/platforms/goodfet.h @@ -17,7 +17,7 @@ #define PLEDPIN BIT0 //Use P3 instead of P5 for target I/O on chips without P5. -#ifdef msp430x2274 +#ifdef msp430f2274 //#warning "No P5, using P3 instead. Will break 2618 and 1612 support." #define P5OUT P3OUT #define P5DIR P3DIR -- 2.20.1