Added support for mspgcc 4.6+ that no longer supports generic MCU identifiers such as msp430x1611
This commit is contained in:
parent
57a166c3db
commit
1b13b69814
7 changed files with 50 additions and 23 deletions
|
@ -11,19 +11,24 @@ CONTIKI_CPU=$(CONTIKI)/cpu/msp430
|
||||||
|
|
||||||
### Define the source files we have in the MSP430 port
|
### Define the source files we have in the MSP430 port
|
||||||
|
|
||||||
ifneq (,$(findstring msp430x1,$(MCU)))
|
ifndef CONTIKI_CPU_FAM_DIR
|
||||||
CONTIKI_CPU_FAM_DIR = f1xxx
|
ifneq (,$(findstring msp430f1,$(MCU)))
|
||||||
else
|
CONTIKI_CPU_FAM_DIR = f1xxx
|
||||||
ifneq (,$(findstring msp430x5,$(MCU)))
|
|
||||||
CONTIKI_CPU_FAM_DIR = f5xxx
|
|
||||||
else
|
|
||||||
ifneq (,$(findstring msp430x2,$(MCU)))
|
|
||||||
CONTIKI_CPU_FAM_DIR = f2xxx f1xxx
|
|
||||||
else
|
|
||||||
${error Unhandled MSP430 family: "$(MCU)"}
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifndef CONTIKI_CPU_FAM_DIR
|
||||||
|
ifneq (,$(findstring msp430f5,$(MCU)))
|
||||||
|
CONTIKI_CPU_FAM_DIR = f5xxx
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifndef CONTIKI_CPU_FAM_DIR
|
||||||
|
ifneq (,$(findstring msp430f2,$(MCU)))
|
||||||
|
CONTIKI_CPU_FAM_DIR = f2xxx f1xxx
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifndef CONTIKI_CPU_FAM_DIR
|
||||||
|
${error Unhandled MSP430 family: "$(MCU)"}
|
||||||
|
endif
|
||||||
|
|
||||||
CONTIKI_CPU_DIRS = $(CONTIKI_CPU_FAM_DIR) . dev
|
CONTIKI_CPU_DIRS = $(CONTIKI_CPU_FAM_DIR) . dev
|
||||||
|
|
||||||
|
@ -54,9 +59,9 @@ STRIP = strip
|
||||||
|
|
||||||
ifndef IAR_PATH
|
ifndef IAR_PATH
|
||||||
# This works with cygwin...
|
# This works with cygwin...
|
||||||
IAR_BIN_PATH = $(shell dirname "`which $(CC)`")
|
IAR_BIN_PATH := $(shell dirname "`which $(CC)`")
|
||||||
IAR_PATH_C = $(shell dirname "$(IAR_BIN_PATH)")
|
IAR_PATH_C := $(shell dirname "$(IAR_BIN_PATH)")
|
||||||
IAR_PATH = $(shell cygpath -m "$(IAR_PATH_C)")
|
IAR_PATH := $(shell cygpath -m "$(IAR_PATH_C)")
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += --diag_suppress=Pa050 --silent
|
CFLAGS += --diag_suppress=Pa050 --silent
|
||||||
|
@ -101,11 +106,33 @@ NM = msp430-nm
|
||||||
OBJCOPY = msp430-objcopy
|
OBJCOPY = msp430-objcopy
|
||||||
STRIP = msp430-strip
|
STRIP = msp430-strip
|
||||||
BSL = msp430-bsl
|
BSL = msp430-bsl
|
||||||
|
|
||||||
|
# From version 4.6.x, mspgcc does not support generic MCU identifiers such as
|
||||||
|
# msp430x1611 in contrast to msp430f1611
|
||||||
|
ifndef CC_MCU
|
||||||
|
ifndef MSPGCC_VERSION
|
||||||
|
MSPGCC_VERSION := ${shell $(CC) -dumpversion}
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifndef CC_MCU
|
||||||
|
ifneq (,$(findstring 4.4.,$(MSPGCC_VERSION)))
|
||||||
|
CC_MCU := ${subst msp430f,msp430x,$(MCU)}
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifndef CC_MCU
|
||||||
|
ifneq (,$(findstring 3.2.,$(MSPGCC_VERSION)))
|
||||||
|
CC_MCU := ${subst msp430f,msp430x,$(MCU)}
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
ifndef CC_MCU
|
||||||
|
CC_MCU := $(MCU)
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef CFLAGSNO
|
ifndef CFLAGSNO
|
||||||
CFLAGSNO = -Wall -mmcu=$(MCU) -g $(CFLAGSWERROR)
|
CFLAGSNO = -Wall -mmcu=$(CC_MCU) -g $(CFLAGSWERROR)
|
||||||
endif
|
endif
|
||||||
CFLAGS += -Os -fno-strict-aliasing
|
CFLAGS += -Os -fno-strict-aliasing
|
||||||
LDFLAGS += -mmcu=$(MCU) -Wl,-Map=contiki-$(TARGET).map
|
LDFLAGS += -mmcu=$(CC_MCU) -Wl,-Map=contiki-$(TARGET).map
|
||||||
|
|
||||||
### These flags can reduce the code size and RAM usage with up to 10%
|
### These flags can reduce the code size and RAM usage with up to 10%
|
||||||
ifeq ($(SMALL),1)
|
ifeq ($(SMALL),1)
|
||||||
|
|
|
@ -50,7 +50,7 @@ endif
|
||||||
|
|
||||||
include $(CONTIKI)/platform/$(TARGET)/apps/Makefile.apps
|
include $(CONTIKI)/platform/$(TARGET)/apps/Makefile.apps
|
||||||
|
|
||||||
MCU=msp430x149
|
MCU=msp430f149
|
||||||
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
||||||
|
|
||||||
ifdef IAR
|
ifdef IAR
|
||||||
|
|
|
@ -47,9 +47,9 @@ endif
|
||||||
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
|
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
|
||||||
|
|
||||||
ifdef IAR
|
ifdef IAR
|
||||||
MCU=msp430x5438a
|
MCU=msp430f5438a
|
||||||
else
|
else
|
||||||
MCU=msp430x5438
|
MCU=msp430f5438
|
||||||
endif
|
endif
|
||||||
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ endif
|
||||||
|
|
||||||
CONTIKI_TARGET_SOURCEFILES += $(SENSORS) $(MSB) $(CONTIKI_TARGET_MAIN)
|
CONTIKI_TARGET_SOURCEFILES += $(SENSORS) $(MSB) $(CONTIKI_TARGET_MAIN)
|
||||||
|
|
||||||
MCU=msp430x1612
|
MCU=msp430f1612
|
||||||
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
||||||
|
|
||||||
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
|
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
|
||||||
|
|
|
@ -21,7 +21,7 @@ endif
|
||||||
|
|
||||||
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
|
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
|
||||||
|
|
||||||
MCU=msp430x1611
|
MCU=msp430f1611
|
||||||
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
||||||
|
|
||||||
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
|
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
|
||||||
|
|
|
@ -30,7 +30,7 @@ endif
|
||||||
|
|
||||||
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
|
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
|
||||||
|
|
||||||
MCU=msp430x5437
|
MCU=msp430f5437
|
||||||
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
||||||
|
|
||||||
ifdef IAR
|
ifdef IAR
|
||||||
|
|
|
@ -36,7 +36,7 @@ endif
|
||||||
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
|
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
|
||||||
CONTIKI_TARGET_SOURCEFILES += i2cmaster.c adxl345.c
|
CONTIKI_TARGET_SOURCEFILES += i2cmaster.c adxl345.c
|
||||||
|
|
||||||
MCU=msp430x2617
|
MCU=msp430f2617
|
||||||
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
||||||
|
|
||||||
# Add LDFLAGS after IAR_PATH is set
|
# Add LDFLAGS after IAR_PATH is set
|
||||||
|
|
Loading…
Add table
Reference in a new issue