From e3f5ba90fdbbd299df94e57f9356d48ffa1da77d Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Tue, 21 Jun 2022 15:04:13 +0200 Subject: [PATCH] boards/{thingy52,ruuvitag}: allow OpenOCD as programmer --- boards/common/nrf52/Makefile.include | 25 +++++++------------------ boards/ruuvitag/Makefile.include | 3 --- boards/thingy52/Makefile.include | 3 --- 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/boards/common/nrf52/Makefile.include b/boards/common/nrf52/Makefile.include index 8b14066c0f..8d04f9e5d8 100644 --- a/boards/common/nrf52/Makefile.include +++ b/boards/common/nrf52/Makefile.include @@ -8,22 +8,14 @@ ifeq (bmp,$(PROGRAMMER)) PORT_DARWIN ?= $(wordlist 2, 2, $(sort $(wildcard /dev/tty.usbmodem*))) endif -ifneq (,$(filter $(BOARD),ruuvitag thingy52)) - # openocd doesn't fully work with ruuvitag and thingy52 - PROGRAMMER ?= jlink - ifeq (openocd,$(PROGRAMMER)) - $(error Cannot use OpenOCD with $(BOARD) board) - endif +# set list of supported programmers +PROGRAMMERS_SUPPORTED += openocd bmp +# keep name of `JLINK` in sync with script jlink.sh in $(RIOTTOOLS)/jlink +JLINK ?= JLinkExe +ifneq (,$(command -v $(JLINK))) +PROGRAMMER ?= jlink else - # no issues with OpenOCD for other nRF52 boards are known - PROGRAMMERS_SUPPORTED += openocd - # keep name of `JLINK` in sync with script jlink.sh in $(RIOTTOOLS)/jlink - JLINK ?= JLinkExe - ifneq (,$(command -v $(JLINK))) - PROGRAMMER ?= jlink - else - PROGRAMMER ?= openocd - endif +PROGRAMMER ?= openocd endif # setup JLink for flashing @@ -33,6 +25,3 @@ JLINK_DEVICE = nrf52 # build from source (master > 2018, August the 13rd) is required. OPENOCD_DEBUG_ADAPTER ?= jlink OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf52/dist/openocd.cfg - -# set list of supported programmers -PROGRAMMERS_SUPPORTED += bmp diff --git a/boards/ruuvitag/Makefile.include b/boards/ruuvitag/Makefile.include index d90c0b68c4..03e3beeae0 100644 --- a/boards/ruuvitag/Makefile.include +++ b/boards/ruuvitag/Makefile.include @@ -7,6 +7,3 @@ endif # use shared Makefile.include include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.include - -# openocd doesn't fully work with this board -PROGRAMMERS_SUPPORTED := $(filter-out openocd,$(PROGRAMMERS_SUPPORTED)) diff --git a/boards/thingy52/Makefile.include b/boards/thingy52/Makefile.include index a229253a2a..59dbf42556 100644 --- a/boards/thingy52/Makefile.include +++ b/boards/thingy52/Makefile.include @@ -7,6 +7,3 @@ endif # use shared Makefile.include include $(RIOTBOARD)/common/nrf52/Makefile.include - -# openocd doesn't fully work with this board -PROGRAMMERS_SUPPORTED := $(filter-out openocd,$(PROGRAMMERS_SUPPORTED))