From ee1e2af232218f0615b905defe5d657b3d1e9e01 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 18 May 2017 19:34:15 +0200 Subject: [PATCH 1/6] makefiles: add shared sam0 board makefile include --- makefiles/boards/sam0.inc.mk | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 makefiles/boards/sam0.inc.mk diff --git a/makefiles/boards/sam0.inc.mk b/makefiles/boards/sam0.inc.mk new file mode 100644 index 0000000000..89a76ea42c --- /dev/null +++ b/makefiles/boards/sam0.inc.mk @@ -0,0 +1,21 @@ +# set default port depending on operating system +PORT_LINUX ?= /dev/ttyACM0 +PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) + +# setup serial terminal +include $(RIOTMAKE)/tools/serial.inc.mk + +# Add board selector (USB serial) to OpenOCD options if specified. +# Use /dist/tools/usb-serial/list-ttys.sh to find out serial number. +# Usage: SERIAL="ATML..." BOARD= make flash +ifneq (,$(SERIAL)) + export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)" + SERIAL_TTY = $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL))) + ifeq (,$(SERIAL_TTY)) + $(error Did not find a device with serial $(SERIAL)) + endif + PORT_LINUX := $(SERIAL_TTY) +endif + +# this board uses openocd +include $(RIOTMAKE)/tools/openocd.inc.mk From 6ce1846eb064abdd436af9646687260de39be48e Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 18 May 2017 19:36:27 +0200 Subject: [PATCH 2/6] board: arduino-zero: make use of shared makefiles/boards/sam0.inc.mk --- boards/arduino-zero/Makefile.include | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/boards/arduino-zero/Makefile.include b/boards/arduino-zero/Makefile.include index d8a948a807..711af3ea92 100644 --- a/boards/arduino-zero/Makefile.include +++ b/boards/arduino-zero/Makefile.include @@ -2,24 +2,4 @@ export CPU = samd21 export CPU_MODEL = samd21g18a -# set default port depending on operating system -export PORT_LINUX ?= /dev/ttyACM0 -export PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) - -# setup serial terminal -include $(RIOTMAKE)/tools/serial.inc.mk - -# Add board selector (USB serial) to OpenOCD options if specified. -# Use /dist/tools/usb-serial/list-ttys.sh to find out serial number. -# Usage: SERIAL="" BOARD="arduino-zero" make flash -ifneq (,$(SERIAL)) - export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)" - SERIAL_TTY = $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL)) - ifeq (,$(SERIAL_TTY)) - $(error Did not find a device with serial $(SERIAL)) - endif - PORT_LINUX := $(SERIAL_TTY) -endif - -# this board uses openocd -include $(RIOTMAKE)/tools/openocd.inc.mk +include $(RIOTMAKE)/boards/sam0.inc.mk From c1ac9dc7396e7ca51b995a6a06d43472f49fafb1 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 18 May 2017 19:36:28 +0200 Subject: [PATCH 3/6] board: samd21-xpro: make use of shared makefiles/boards/sam0.inc.mk --- boards/samd21-xpro/Makefile.include | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/boards/samd21-xpro/Makefile.include b/boards/samd21-xpro/Makefile.include index e8415c937e..06056fc464 100644 --- a/boards/samd21-xpro/Makefile.include +++ b/boards/samd21-xpro/Makefile.include @@ -2,24 +2,4 @@ export CPU = samd21 export CPU_MODEL = samd21j18a -# set default port depending on operating system -PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) - -# setup serial terminal -include $(RIOTMAKE)/tools/serial.inc.mk - -# Add board selector (USB serial) to OpenOCD options if specified. -# Use /dist/tools/usb-serial/list-ttys.sh to find out serial number. -# Usage: SERIAL="ATML..." BOARD="samd21-xpro" make flash -ifneq (,$(SERIAL)) - export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)" - SERIAL_TTY = $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL))) - ifeq (,$(SERIAL_TTY)) - $(error Did not find a device with serial $(SERIAL)) - endif - PORT_LINUX := $(SERIAL_TTY) -endif - -# this board uses openocd -include $(RIOTMAKE)/tools/openocd.inc.mk +include $(RIOTMAKE)/boards/sam0.inc.mk From 18bd055226fec4a48cb22918ae624b26a62ecd2e Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 18 May 2017 19:36:28 +0200 Subject: [PATCH 4/6] board: saml21-xpro: make use of shared makefiles/boards/sam0.inc.mk --- boards/saml21-xpro/Makefile.include | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/boards/saml21-xpro/Makefile.include b/boards/saml21-xpro/Makefile.include index c96d71bec7..d705e25f3b 100644 --- a/boards/saml21-xpro/Makefile.include +++ b/boards/saml21-xpro/Makefile.include @@ -3,9 +3,4 @@ export CPU = saml21 export CPU_MODEL = saml21j18a export CFLAGS += -D__SAML21J18A__ -# setup serial terminal -PORT_LINUX ?= /dev/ttyACM0 -include $(RIOTMAKE)/tools/serial.inc.mk - -# this board uses openocd -include $(RIOTMAKE)/tools/openocd.inc.mk +include $(RIOTMAKE)/boards/sam0.inc.mk From d907789c574aff6405da802d0f080ee573c6679c Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 18 May 2017 19:36:28 +0200 Subject: [PATCH 5/6] board: samr21-xpro: make use of shared makefiles/boards/sam0.inc.mk --- boards/samr21-xpro/Makefile.include | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/boards/samr21-xpro/Makefile.include b/boards/samr21-xpro/Makefile.include index 7f68e0eaa1..acc6ee400b 100644 --- a/boards/samr21-xpro/Makefile.include +++ b/boards/samr21-xpro/Makefile.include @@ -2,24 +2,4 @@ export CPU = samd21 export CPU_MODEL = samr21g18a -# set default port depending on operating system -PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) - -# setup serial terminal -include $(RIOTMAKE)/tools/serial.inc.mk - -# Add board selector (USB serial) to OpenOCD options if specified. -# Use /dist/tools/usb-serial/list-ttys.sh to find out serial number. -# Usage: SERIAL="ATML..." BOARD="samr21-xpro" make flash -ifneq (,$(SERIAL)) - export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)" - SERIAL_TTY = $(firstword $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL))) - ifeq (,$(SERIAL_TTY)) - $(error Did not find a device with serial $(SERIAL)) - endif - PORT_LINUX := $(SERIAL_TTY) -endif - -# this board uses openocd -include $(RIOTMAKE)/tools/openocd.inc.mk +include $(RIOTMAKE)/boards/sam0.inc.mk From 494064b4bad00116a00f84c24bbf628de9ac5317 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 18 May 2017 19:36:28 +0200 Subject: [PATCH 6/6] board: sodaq-autonomo: make use of shared makefiles/boards/sam0.inc.mk --- boards/sodaq-autonomo/Makefile.include | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/boards/sodaq-autonomo/Makefile.include b/boards/sodaq-autonomo/Makefile.include index 83eb6a0314..c6121dd6e3 100644 --- a/boards/sodaq-autonomo/Makefile.include +++ b/boards/sodaq-autonomo/Makefile.include @@ -2,26 +2,4 @@ export CPU = samd21 export CPU_MODEL = samd21j18a -# set default port depending on operating system -PORT_LINUX ?= /dev/ttyACM0 -PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) - -export OFLAGS = -O binary - -# setup serial terminal -include $(RIOTMAKE)/tools/serial.inc.mk - -# Add board selector (USB serial) to OpenOCD options if specified. -# Use /dist/tools/usb-serial/list-ttys.sh to find out serial number. -# Usage: SERIAL="AAA..." BOARD="sodaq-autonomo" make flash -ifneq (,$(SERIAL)) - export OPENOCD_EXTRA_INIT += "-c cmsis_dap_serial $(SERIAL)" - SERIAL_TTY = $(shell $(RIOTBASE)/dist/tools/usb-serial/find-tty.sh $(SERIAL)) - ifeq (,$(SERIAL_TTY)) - $(error Did not find a device with serial $(SERIAL)) - endif - PORT_LINUX := $(SERIAL_TTY) -endif - -# this board uses openocd -include $(RIOTMAKE)/tools/openocd.inc.mk +include $(RIOTMAKE)/boards/sam0.inc.mk