2011-02-23 10:35:26 +01:00
|
|
|
# $Id: Makefile.z1,v 1.5 2011/02/26 enricmcalvo Exp $
|
|
|
|
|
2011-02-27 18:02:12 +01:00
|
|
|
PROJECT_SOURCEFILES += i2cmaster.c adxl345.c
|
2011-05-25 17:21:51 +02:00
|
|
|
|
|
|
|
ifdef GCC
|
2011-02-23 10:35:26 +01:00
|
|
|
CFLAGS+=-Os -g
|
2011-05-25 17:21:51 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef IAR
|
2011-06-05 00:21:47 +02:00
|
|
|
CFLAGS+=-e --vla -Ohz --multiplier=16s --core=430X --data_model small --double=32
|
2011-05-25 17:21:51 +02:00
|
|
|
endif
|
|
|
|
|
2011-02-23 10:35:26 +01:00
|
|
|
CLEAN += symbols.c symbols.h
|
2011-02-27 17:14:27 +01:00
|
|
|
#CFLAGS += -ffunction-sections
|
|
|
|
#LDFLAGS += -Wl,--gc-sections,--undefined=_reset_vector__,--undefined=InterruptVectors,--undefined=_copy_data_init__,--undefined=_clear_bss_init__,--undefined=_end_of_init__
|
|
|
|
|
2011-02-23 10:35:26 +01:00
|
|
|
|
|
|
|
ARCH=msp430.c leds.c watchdog.c xmem.c \
|
|
|
|
spix.c cc2420.c cc2420-aes.c cc2420-arch.c cc2420-arch-sfd.c\
|
|
|
|
node-id.c sensors.c button-sensor.c cfs-coffee.c \
|
|
|
|
radio-sensor.c uart0x.c uart0-putchar.c uip-ipchksum.c \
|
2011-02-27 21:28:25 +01:00
|
|
|
checkpoint-arch.c slip.c slip_uart0.c \
|
2011-03-07 21:23:58 +01:00
|
|
|
z1-phidgets.c sht11.c sht11-sensor.c light-sensor.c \
|
2011-03-08 09:20:35 +01:00
|
|
|
battery-sensor.c sky-sensors.c tmp102.c temperature-sensor.c
|
2011-02-23 10:35:26 +01:00
|
|
|
|
|
|
|
CONTIKI_TARGET_DIRS = . dev apps net
|
|
|
|
ifndef CONTIKI_TARGET_MAIN
|
|
|
|
CONTIKI_TARGET_MAIN = contiki-z1-main.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef UIP_CONF_IPV6
|
|
|
|
CFLAGS += -DWITH_UIP6=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef nodemac
|
|
|
|
CFLAGS += -DMACID=$(nodemac)
|
|
|
|
endif
|
|
|
|
|
2011-05-25 17:21:51 +02:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
|
2011-02-23 10:35:26 +01:00
|
|
|
CONTIKI_TARGET_SOURCEFILES += contiki-z1-platform.c
|
|
|
|
|
|
|
|
MCU=msp430x2617
|
|
|
|
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
|
|
|
|
2011-06-05 00:21:47 +02:00
|
|
|
# Add LDFLAGS after IAR_PATH is set
|
|
|
|
ifdef IAR
|
|
|
|
LDFLAGS += -B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f2617.xcl" -l contiki-$(TARGET).map -Fintel-extended -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80
|
|
|
|
endif
|
|
|
|
|
2011-02-23 10:35:26 +01:00
|
|
|
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
|
|
|
|
# $(AR) rcf $@ $^
|
|
|
|
|
|
|
|
|
|
|
|
NUMPAR=20
|
|
|
|
IHEXFILE=tmpimage.ihex
|
|
|
|
|
|
|
|
# If we are not running under Windows, we assume Linux
|
|
|
|
ifndef MOTELIST
|
|
|
|
USBDEVPREFIX=
|
|
|
|
SERIALDUMP = $(CONTIKI)/tools/sky/serialdump-linux
|
|
|
|
MOTELIST = $(CONTIKI)/tools/z1/motelist-z1
|
|
|
|
BSL = $(CONTIKI)/tools/z1/z1-bsl-nopic --z1
|
|
|
|
BSL_FILETYPE = -I
|
|
|
|
MOTES = $(shell $(MOTELIST) -c 2>&- | \
|
|
|
|
cut -f 2 -d , | \
|
|
|
|
perl -ne 'print $$1 . " " if(m-(/dev/\w+)-);')
|
|
|
|
CMOTES=$(MOTES)
|
|
|
|
endif
|
|
|
|
|
2011-07-29 13:06:00 +02:00
|
|
|
motelist: z1-motelist
|
|
|
|
|
2011-02-23 10:35:26 +01:00
|
|
|
z1-motelist:
|
|
|
|
$(MOTELIST)
|
|
|
|
z1-motes:
|
|
|
|
@echo $(MOTES)
|
|
|
|
|
|
|
|
ifdef MOTE
|
|
|
|
%.upload: %.ihex
|
|
|
|
cp $< $(IHEXFILE)
|
|
|
|
$(MAKE) z1-u.$(subst /,-,$(word $(MOTE), $(MOTES)))
|
|
|
|
else # MOTE
|
|
|
|
%.upload: %.ihex
|
|
|
|
cp $< $(IHEXFILE)
|
|
|
|
@echo $(MOTES)
|
|
|
|
$(MAKE) z1-reset z1-upload
|
|
|
|
endif # MOTE
|
|
|
|
|
|
|
|
z1-upload: z1-reset
|
|
|
|
$(MAKE) -j $(NUMPAR) z1-upload-sequence
|
|
|
|
|
|
|
|
z1-upload-sequence: $(foreach PORT, $(MOTES), z1-u.$(subst /,-,$(PORT)))
|
|
|
|
@echo Done
|
|
|
|
|
|
|
|
z1-reset:
|
|
|
|
$(MAKE) -k -j $(NUMPAR) z1-reset-sequence
|
|
|
|
|
|
|
|
z1-reset-sequence: $(foreach PORT, $(MOTES), z1-r.$(subst /,-,$(PORT)))
|
|
|
|
@echo Done
|
|
|
|
|
|
|
|
z1-u.%:
|
|
|
|
@echo +++++ Erasing $(subst -,/,$*); \
|
|
|
|
$(BSL) -c $(subst -,/,$*) -e && sleep 2 ; \
|
|
|
|
echo +++++ Programming $(subst -,/,$*) ; \
|
|
|
|
$(BSL) -c $(subst -,/,$*) $(BSL_FILETYPE) -p $(IHEXFILE) && sleep 2 ; \
|
|
|
|
echo +++++ Resetting $(subst -,/,$*) ; \
|
|
|
|
$(BSL) -c $(subst -,/,$*) -r
|
|
|
|
|
|
|
|
z1-r.%:
|
|
|
|
$(BSL) -c $(subst -,/,$*) -r
|
|
|
|
|
|
|
|
sizeplot:
|
|
|
|
msp430-size $(OBJECTDIR)/*.o | $(CONTIKI)/tools/sky/check-size > size-data
|
|
|
|
gnuplot $(CONTIKI)/tools/sky/plot-size
|
|
|
|
gv size.pdf
|
|
|
|
|
|
|
|
winslip:
|
|
|
|
ifdef INTERFACE
|
|
|
|
$(CONTIKI)/tools/wpcapslip/wpcapslip -s $(USBDEVPREFIX)$(firstword $(CMOTES)) $(INTERFACE) 172.16.0.0 255.255.0.0
|
|
|
|
else
|
|
|
|
@echo "Usage: \"$(MAKE) $@ INTERFACE=<the IP address of a local network interface>\""
|
|
|
|
@echo "Use the \"ipconfig\" command to find out the IP addresses of the local interfaces"
|
|
|
|
endif
|
|
|
|
|
|
|
|
linslip: $(CONTIKI)/tools/tunslip
|
|
|
|
$(CONTIKI)/tools/tunslip -s $(USBDEVPREFIX)$(firstword $(CMOTES)) 172.16.0.0 255.255.0.0
|
|
|
|
|
|
|
|
$(CONTIKI)/tools/tunslip:
|
|
|
|
(cd $(CONTIKI)/tools; $(MAKE) tunslip)
|
|
|
|
|
|
|
|
ifdef MOTE
|
|
|
|
serialdump:
|
|
|
|
$(SERIALDUMP) -b115200 $(USBDEVPREFIX)$(word $(MOTE), $(CMOTES)) | $(CONTIKI)/tools/timestamp | tee serialdump-`date +%Y%m%d-%H%M`
|
|
|
|
|
|
|
|
serialview:
|
|
|
|
$(SERIALDUMP) -b115200 $(USBDEVPREFIX)$(word $(MOTE), $(CMOTES)) | $(CONTIKI)/tools/timestamp
|
|
|
|
|
|
|
|
login:
|
|
|
|
$(SERIALDUMP) -b115200 $(USBDEVPREFIX)$(word $(MOTE), $(CMOTES))
|
|
|
|
else
|
|
|
|
serialdump:
|
|
|
|
$(SERIALDUMP) -b115200 $(USBDEVPREFIX)$(firstword $(CMOTES)) | $(CONTIKI)/tools/timestamp | tee serialdump-`date +%Y%m%d-%H%M`
|
|
|
|
|
|
|
|
serialview:
|
|
|
|
$(SERIALDUMP) -b115200 $(USBDEVPREFIX)$(firstword $(CMOTES)) | $(CONTIKI)/tools/timestamp
|
|
|
|
|
|
|
|
login:
|
|
|
|
$(SERIALDUMP) -b115200 $(USBDEVPREFIX)$(firstword $(CMOTES))
|
|
|
|
endif
|