Made the stack and heap size configurable when using the IAR compiler on the MSP430 platforms

This commit is contained in:
Niclas Finne 2012-09-19 22:49:19 +02:00
parent 919ddfbf09
commit 4630945475
6 changed files with 19 additions and 6 deletions

View file

@ -72,6 +72,20 @@ CFLAGSNO = --dlib_config "$(IAR_PATH)/LIB/DLIB/dl430xlfn.h" $(CFLAGSWERROR)
# CFLAGSNO = --dlib_config $(IAR_PATH)/LIB/DLIB/dl430xlfn.h -Ohz --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40 --core=430X $(CFLAGSWERROR) --data_model large --double=32 # CFLAGSNO = --dlib_config $(IAR_PATH)/LIB/DLIB/dl430xlfn.h -Ohz --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40 --core=430X $(CFLAGSWERROR) --data_model large --double=32
endif endif
LDFLAGSNO += -B -l contiki-$(TARGET).map -s __program_start
# Stack and heap size in hex
ifndef IAR_STACK_SIZE
IAR_STACK_SIZE=300
endif
# Set this to a positive number (hex) to enable malloc/free with IAR compiler
ifndef IAR_DATA16_HEAP_SIZE
IAR_DATA16_HEAP_SIZE=100
endif
LDFLAGSNO += -D_STACK_SIZE=$(IAR_STACK_SIZE) -D_DATA16_HEAP_SIZE=$(IAR_DATA16_HEAP_SIZE)
ifdef IAR_DATA20_HEAP_SIZE
LDFLAGSNO += -D_DATA20_HEAP_SIZE=$(IAR_DATA20_HEAP_SIZE)
endif
CUSTOM_RULE_C_TO_O = 1 CUSTOM_RULE_C_TO_O = 1
%.o: %.c %.o: %.c
$(CC) $(CFLAGS) $< -o $@ $(CC) $(CFLAGS) $< -o $@

View file

@ -54,7 +54,7 @@ MCU=msp430f149
include $(CONTIKI)/cpu/msp430/Makefile.msp430 include $(CONTIKI)/cpu/msp430/Makefile.msp430
ifdef IAR ifdef IAR
LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f149.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80 LDFLAGSNO += -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f149.xcl"
LDFLAGS += $(LDFLAGSNO) -Felf -yn LDFLAGS += $(LDFLAGSNO) -Felf -yn
endif # IAR endif # IAR

View file

@ -58,8 +58,7 @@ contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
ifdef IAR ifdef IAR
STACKSIZE=300 LDFLAGSNO += -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl"
LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=$(STACKSIZE) -D_DATA16_HEAP_SIZE=$(STACKSIZE) -D_DATA20_HEAP_SIZE=$(STACKSIZE)
LDFLAGS += $(LDFLAGSNO) -Felf -yn LDFLAGS += $(LDFLAGSNO) -Felf -yn
endif endif

View file

@ -29,7 +29,7 @@ contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
ifdef IAR ifdef IAR
LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f1611.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80 LDFLAGSNO += -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f1611.xcl"
LDFLAGS += $(LDFLAGSNO) -Felf -yn LDFLAGS += $(LDFLAGSNO) -Felf -yn
endif # IAR endif # IAR

View file

@ -34,7 +34,7 @@ MCU=msp430f5437
include $(CONTIKI)/cpu/msp430/Makefile.msp430 include $(CONTIKI)/cpu/msp430/Makefile.msp430
ifdef IAR ifdef IAR
LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80 LDFLAGSNO += -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl"
LDFLAGS += $(LDFLAGSNO) -Felf -yn LDFLAGS += $(LDFLAGSNO) -Felf -yn
endif endif

View file

@ -42,7 +42,7 @@ include $(CONTIKI)/cpu/msp430/Makefile.msp430
# Add LDFLAGS after IAR_PATH is set # Add LDFLAGS after IAR_PATH is set
ifdef IAR ifdef IAR
LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f2617.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80 LDFLAGSNO += -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f2617.xcl"
LDFLAGS += $(LDFLAGSNO) -Felf -yn LDFLAGS += $(LDFLAGSNO) -Felf -yn
endif endif