2018-10-28 19:42:48 +01:00
|
|
|
# include this module into the build
|
|
|
|
INCLUDES += -I$(RIOTBOARD)/common/nrf52/include
|
|
|
|
|
2020-02-13 06:34:58 +01:00
|
|
|
ifeq (bmp,$(PROGRAMMER))
|
|
|
|
# On Blackmagic Probe, the first ACM is used to connect to the gdb server,
|
|
|
|
# the second is the BMP's UART interface
|
|
|
|
PORT_LINUX ?= /dev/ttyACM1
|
|
|
|
PORT_DARWIN ?= $(wordlist 2, 2, $(sort $(wildcard /dev/tty.usbmodem*)))
|
|
|
|
endif
|
|
|
|
|
2022-06-21 15:04:13 +02:00
|
|
|
# set list of supported programmers
|
|
|
|
PROGRAMMERS_SUPPORTED += openocd bmp
|
|
|
|
# keep name of `JLINK` in sync with script jlink.sh in $(RIOTTOOLS)/jlink
|
|
|
|
JLINK ?= JLinkExe
|
2023-01-08 20:16:27 +01:00
|
|
|
ifneq (,$(shell command -v $(JLINK)))
|
|
|
|
PROGRAMMER ?= jlink
|
2022-06-03 21:43:50 +02:00
|
|
|
else
|
2023-01-08 20:16:27 +01:00
|
|
|
PROGRAMMER ?= openocd
|
2022-06-03 21:43:50 +02:00
|
|
|
endif
|
2022-06-08 12:38:23 +02:00
|
|
|
|
2024-11-08 16:04:08 +01:00
|
|
|
# Setup OpenOCD for flashing. The nRF52 series is supported from OpenOCD v0.11
|
|
|
|
# onwards.
|
2021-02-18 17:29:53 +01:00
|
|
|
OPENOCD_DEBUG_ADAPTER ?= jlink
|
|
|
|
OPENOCD_CONFIG = $(RIOTBOARD)/common/nrf52/dist/openocd.cfg
|
2024-11-08 16:04:08 +01:00
|
|
|
|
|
|
|
# From Build Code Fxx and later, the nRF52 device is automatically locked after
|
|
|
|
# a power cycle and has to be recovered with a separate command after the
|
|
|
|
# initialization. Otherwise the Flash can not be accessed.
|
|
|
|
OPENOCD_POST_INIT_CMDS = -c 'nrf52_recover'
|