From 2bf39e1aca646c6064e5f82b64e1cd2e04b7e3fc Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 8 Jun 2022 12:38:23 +0200 Subject: [PATCH] boards/common/nrf52: fix compilation of thingy52 and ruuvitag --- boards/common/nrf52/Makefile.include | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/boards/common/nrf52/Makefile.include b/boards/common/nrf52/Makefile.include index 960ac4946f..8b14066c0f 100644 --- a/boards/common/nrf52/Makefile.include +++ b/boards/common/nrf52/Makefile.include @@ -8,13 +8,24 @@ ifeq (bmp,$(PROGRAMMER)) PORT_DARWIN ?= $(wordlist 2, 2, $(sort $(wildcard /dev/tty.usbmodem*))) endif -# keep name of `JLINK` in sync with script jlink.sh in $(RIOTTOOLS)/jlink -JLINK ?= JLinkExe -ifneq (,$(command -v $(JLINK))) +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 else - PROGRAMMER ?= openocd + # 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 endif + # setup JLink for flashing JLINK_DEVICE = nrf52 # setup OpenOCD for flashing. Version 0.10 of OpenOCD doesn't contain support @@ -23,12 +34,5 @@ JLINK_DEVICE = nrf52 OPENOCD_DEBUG_ADAPTER ?= jlink OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf52/dist/openocd.cfg -ifneq (,$(filter $(BOARD),ruuvitag thingy52)) - # openocd doesn't fully work with ruuvitag and thingy52 - ifeq (openocd,$(PROGRAMMER)) - $(error Cannot use OpenOCD with $(BOARD) board) - endif -endif - # set list of supported programmers -PROGRAMMERS_SUPPORTED += bmp openocd +PROGRAMMERS_SUPPORTED += bmp