2015-04-22 15:45:34 +02:00
|
|
|
# define the cpu used by SAMR21 Xplained Pro board
|
2014-09-09 11:12:39 +02:00
|
|
|
export CPU = samd21
|
2016-01-30 06:47:30 +01:00
|
|
|
export CPU_MODEL = samr21x18a
|
2014-09-09 11:12:39 +02:00
|
|
|
|
2015-04-22 15:45:34 +02:00
|
|
|
# set default port depending on operating system
|
|
|
|
PORT_LINUX ?= /dev/ttyACM0
|
2016-02-13 21:51:08 +01:00
|
|
|
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
2014-09-09 11:12:39 +02:00
|
|
|
|
2015-05-28 15:09:17 +02:00
|
|
|
# setup the boards dependencies
|
2015-04-22 15:45:34 +02:00
|
|
|
include $(RIOTBOARD)/$(BOARD)/Makefile.dep
|
2014-09-09 11:12:39 +02:00
|
|
|
|
2015-04-22 15:45:34 +02:00
|
|
|
# setup serial terminal
|
|
|
|
include $(RIOTBOARD)/Makefile.include.serial
|
2014-11-11 15:12:24 +01:00
|
|
|
|
2015-06-16 15:48:05 +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="ATML..." BOARD="samr21-xpro" make flash
|
|
|
|
ifneq (,$(SERIAL))
|
2015-10-27 10:36:42 +01:00
|
|
|
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)
|
2015-06-16 15:48:05 +02:00
|
|
|
endif
|
|
|
|
|
2015-04-22 15:45:34 +02:00
|
|
|
# this board uses openocd
|
|
|
|
include $(RIOTBOARD)/Makefile.include.openocd
|