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

boards/common/nrf52: fix compilation of thingy52 and ruuvitag

This commit is contained in:
Marian Buschsieweke 2022-06-08 12:38:23 +02:00
parent e7ac109f0e
commit 2bf39e1aca
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94

View File

@ -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