2017-10-08 07:58:02 +02:00
|
|
|
# Use DEBUG_ADAPTER_ID to specify the programmer serial number to use:
|
2019-05-31 11:45:23 +02:00
|
|
|
# DEBUG_ADAPTER_ID="ATML..."
|
2017-10-08 07:58:02 +02:00
|
|
|
|
|
|
|
# The SERIAL setting is only available for backwards compatibility with older
|
2020-07-02 19:13:58 +02:00
|
|
|
# settings. It's only checked when a target is given to the make command.
|
|
|
|
ifneq (,$(filter debug% flash% %term test,$(MAKECMDGOALS)))
|
|
|
|
ifneq (,$(SERIAL))
|
|
|
|
EDBG_ARGS += --serial $(SERIAL)
|
|
|
|
SERIAL_TTY = $(firstword $(shell $(RIOTTOOLS)/usb-serial/find-tty.sh $(SERIAL)))
|
|
|
|
ifeq (,$(SERIAL_TTY))
|
|
|
|
$(error Did not find a device with serial $(SERIAL))
|
|
|
|
endif
|
|
|
|
PORT_LINUX := $(SERIAL_TTY)
|
|
|
|
DEBUG_ADAPTER_ID ?= $(SERIAL)
|
2017-10-08 07:58:02 +02:00
|
|
|
endif
|
|
|
|
endif
|
2017-05-18 19:34:15 +02:00
|
|
|
|
2017-10-08 07:58:02 +02:00
|
|
|
# Default for these boards is to use a CMSIS-DAP programmer
|
2021-02-18 17:15:55 +01:00
|
|
|
OPENOCD_DEBUG_ADAPTER ?= dap
|
2017-05-18 19:34:15 +02:00
|
|
|
|
2021-02-11 14:02:04 +01:00
|
|
|
# Increase the list of supported programmers
|
|
|
|
PROGRAMMERS_SUPPORTED += openocd edbg
|
|
|
|
|
2020-06-04 19:56:05 +02:00
|
|
|
# If no programmer is set, select a default programmer
|
|
|
|
ifeq ($(PROGRAMMER),)
|
|
|
|
# EDBG can only be used with a compatible Atmel programmer
|
2021-02-18 17:15:55 +01:00
|
|
|
ifeq ($(OPENOCD_DEBUG_ADAPTER),dap)
|
2020-06-04 19:56:05 +02:00
|
|
|
# set this to either openocd, jlink or edbg
|
|
|
|
PROGRAMMER ?= edbg
|
2021-02-18 17:15:55 +01:00
|
|
|
else ifeq ($(OPENOCD_DEBUG_ADAPTER),jlink)
|
2020-06-04 19:56:05 +02:00
|
|
|
# only use JLinkExe if it's installed
|
2021-09-03 11:27:03 +02:00
|
|
|
ifneq (,$(shell which JLinkExe))
|
2020-06-04 19:56:05 +02:00
|
|
|
PROGRAMMER ?= jlink
|
|
|
|
else
|
|
|
|
PROGRAMMER ?= openocd
|
|
|
|
endif
|
2019-06-19 18:20:01 +02:00
|
|
|
else
|
|
|
|
PROGRAMMER ?= openocd
|
|
|
|
endif
|
2017-10-08 07:58:02 +02:00
|
|
|
endif
|