1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

Merge pull request #18180 from maribu/boards/common/nrf52

boards/common/nrf52: fix compilation of thingy52 and ruuvitag
This commit is contained in:
Marian Buschsieweke 2022-06-08 14:44:52 +02:00 committed by GitHub
commit 97a203a7ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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