2016-05-29 15:39:38 +02:00
|
|
|
# define the cpu used by Arduino/Genuino Zero board
|
|
|
|
export CPU = samd21
|
|
|
|
export CPU_MODEL = samd21g18a
|
|
|
|
|
|
|
|
# set default port depending on operating system
|
2017-02-02 18:01:55 +01:00
|
|
|
export PORT_LINUX ?= /dev/ttyACM0
|
|
|
|
export PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
2016-05-29 15:39:38 +02:00
|
|
|
|
|
|
|
# setup serial terminal
|
2016-01-27 10:47:12 +01:00
|
|
|
include $(RIOTMAKE)/tools/serial.inc.mk
|
2016-05-29 15:39:38 +02:00
|
|
|
|
|
|
|
# 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="<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
|
2016-01-27 10:47:12 +01:00
|
|
|
include $(RIOTMAKE)/tools/openocd.inc.mk
|