diff --git a/platform/exp5438/Makefile.exp5438 b/platform/exp5438/Makefile.exp5438 index e2a1c3297..aea4efa49 100644 --- a/platform/exp5438/Makefile.exp5438 +++ b/platform/exp5438/Makefile.exp5438 @@ -44,6 +44,15 @@ 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