Skip to content

Commit

Permalink
Added flags to enable 20-bit support from msp430-gcc 4.7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
alignan committed Jun 17, 2014
1 parent 24e2609 commit 3d64b80
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
12 changes: 12 additions & 0 deletions cpu/msp430/Makefile.msp430
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,18 @@ ifndef CC_MCU
CC_MCU := $(MCU)
endif

### Checks for compiler version to enable 20-bit support
ifndef IAR
ifneq (,$(findstring 4.7.,$(shell msp430-gcc -dumpversion)))
ifdef CPU_HAS_MSP430X
TARGET_MEMORY_MODEL ?= medium
CFLAGS += -mmemory-model=$(TARGET_MEMORY_MODEL)
CFLAGS += -ffunction-sections -fdata-sections -mcode-region=far
LDFLAGS += -mmemory-model=$(TARGET_MEMORY_MODEL) -Wl,-gc-sections
endif
endif
endif

ifndef CFLAGSNO
CFLAGSNO = -Wall -mmcu=$(CC_MCU) $(CFLAGSWERROR)
endif
Expand Down
13 changes: 4 additions & 9 deletions platform/exp5438/Makefile.exp5438
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,17 @@ ifeq ($(UIP_CONF_IPV6),1)
CFLAGS += -DWITH_UIP6=1
endif

ifndef IAR
ifneq (,$(findstring 4.7.,$(shell msp430-gcc -dumpversion)))
TARGET_MEMORY_MODEL ?= medium
CFLAGS += -mmemory-model=$(TARGET_MEMORY_MODEL)
CFLAGS += -ffunction-sections -fdata-sections -mcode-region=far
LDFLAGS += -mmemory-model=$(TARGET_MEMORY_MODEL) -Wl,-gc-sections
endif
endif

CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)

ifdef IAR
MCU=msp430f5438a
else
MCU=msp430f5438
endif

# Platform has a MSP430X MCU with 20-bit support
CPU_HAS_MSP430X=1

include $(CONTIKI)/cpu/msp430/Makefile.msp430

contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
Expand Down
13 changes: 4 additions & 9 deletions platform/wismote/Makefile.wismote
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ ifeq ($(UIP_CONF_IPV6),1)
CFLAGS += -DWITH_UIP6=1
endif

ifndef IAR
ifneq (,$(findstring 4.7.,$(shell msp430-gcc -dumpversion)))
TARGET_MEMORY_MODEL ?= medium
CFLAGS += -mmemory-model=$(TARGET_MEMORY_MODEL)
CFLAGS += -ffunction-sections -fdata-sections -mcode-region=far
LDFLAGS += -mmemory-model=$(TARGET_MEMORY_MODEL) -Wl,-gc-sections
endif
endif

ifdef IAR
CFLAGS += -D__MSP430F5437__=1 -e --vla -Ohz --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40 --core=430X --double=32
else
Expand All @@ -40,6 +31,10 @@ endif
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)

MCU=msp430f5437

# Platform has a MSP430X MCU with 20-bit support
CPU_HAS_MSP430X=1

include $(CONTIKI)/cpu/msp430/Makefile.msp430

ifdef IAR
Expand Down
4 changes: 4 additions & 0 deletions platform/z1/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
CONTIKI_TARGET_SOURCEFILES += i2cmaster.c adxl345.c

MCU=msp430f2617

# Platform has a MSP430X MCU with 20-bit support
CPU_HAS_MSP430X=1

include $(CONTIKI)/cpu/msp430/Makefile.msp430

# Add LDFLAGS after IAR_PATH is set
Expand Down

0 comments on commit 3d64b80

Please sign in to comment.