diff --git a/boards/arduino-due/Makefile.include b/boards/arduino-due/Makefile.include index 96f4bf2f51..c21188e4b1 100644 --- a/boards/arduino-due/Makefile.include +++ b/boards/arduino-due/Makefile.include @@ -11,20 +11,18 @@ export LINK = $(PREFIX)gcc export SIZE = $(PREFIX)size export OBJCOPY = $(PREFIX)objcopy export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm +export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh #define the flash-tool and default port depending on the host operating system OS := $(shell uname) ifeq ($(OS),Linux) PORT ?= /dev/ttyACM0 - FLASHER = stty -F $(PORT) raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255; $(RIOTBOARD)/$(BOARD)/dist/bossac else ifeq ($(OS),Darwin) PORT ?= $(shell ls -1 /dev/tty.usbmodem* | head -n 1) - FLASHER = stty -f $(PORT) raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255; $(RIOTBOARD)/$(BOARD)/dist/bossac_osx else $(info CAUTION: No flash tool for your host system found!) # TODO: add support for windows as host platform endif -export FLASHER export PORT # define build specific options @@ -36,7 +34,6 @@ export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endi # linkerscript specified in cpu/Makefile.include export LINKFLAGS += -T$(LINKERSCRIPT) export OFLAGS += -O binary -export FFLAGS += -R -e -w -v -b bin/$(BOARD)/$(APPLICATION).hex export TERMFLAGS += -p "$(PORT)" # use the nano-specs of the NewLib when available diff --git a/boards/arduino-due/dist/flash.sh b/boards/arduino-due/dist/flash.sh new file mode 100755 index 0000000000..ee85081d5b --- /dev/null +++ b/boards/arduino-due/dist/flash.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ `uname` = "Linux" ]; then + stty -F "${PORT}" raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255 + "${RIOTBOARD}"/"${BOARD}"/dist/bossac -R -e -w -v -b "${HEXFILE}" +elif [ `uname` = "Darwin" ]; then + stty -f $(PORT) raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255 + "${RIOTBOARD}"/"${BOARD}"/dist/bossac_osx -R -e -w -v -b "${HEXFILE}" +else + echo "CAUTION: No flash tool for your host system found!" +fi