1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sam0: allow flashing with JLinkExe

Currently sam0 will always use OpenOCD, even when the JLink programmer is selected.
Instead, use JLinkExe when it's availiable and a J-Link programmer is used.
This commit is contained in:
Benjamin Valentin 2019-06-19 18:20:01 +02:00
parent b4079badf7
commit b617e40950

View File

@ -24,8 +24,15 @@ DEBUG_ADAPTER ?= dap
# EDBG can only be used with a compatible Atmel programmer
ifeq ($(DEBUG_ADAPTER),dap)
# set this to either openocd or edbg
# set this to either openocd, jlink or edbg
PROGRAMMER ?= edbg
else ifeq ($(DEBUG_ADAPTER),jlink)
# only use JLinkExe if it's installed
ifneq (,$(shell command -v JLinkExe)))
PROGRAMMER ?= jlink
else
PROGRAMMER ?= openocd
endif
else
PROGRAMMER ?= openocd
endif
@ -37,5 +44,12 @@ ifeq ($(PROGRAMMER),edbg)
endif
endif
# this board uses J-Link for debug and possibly flashing
ifeq ($(PROGRAMMER),jlink)
include $(RIOTMAKE)/tools/jlink.inc.mk
endif
# this board uses openocd for debug and possibly flashing
include $(RIOTMAKE)/tools/openocd.inc.mk
ifeq ($(PROGRAMMER),openocd)
include $(RIOTMAKE)/tools/openocd.inc.mk
endif