2018-10-28 19:42:48 +01:00
|
|
|
# this module contains shared code for all boards using the nrf52 CPU
|
|
|
|
export CPU = nrf52
|
|
|
|
|
|
|
|
# include this module into the build
|
|
|
|
INCLUDES += -I$(RIOTBOARD)/common/nrf52/include
|
|
|
|
|
|
|
|
# set default port depending on operating system
|
|
|
|
PORT_LINUX ?= /dev/ttyACM0
|
|
|
|
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
|
|
|
|
include $(RIOTMAKE)/tools/serial.inc.mk
|
|
|
|
|
2018-06-20 10:42:38 +02:00
|
|
|
# The following configuration is dependencies specific
|
|
|
|
# but they are resolved later
|
|
|
|
# Hack to know now if 'nordic_softdevice_ble' is used
|
|
|
|
include $(RIOTBOARD)/$(BOARD)/Makefile.dep
|
2018-10-28 19:42:48 +01:00
|
|
|
|
2018-06-20 10:42:38 +02:00
|
|
|
PROGRAMMER ?= jlink
|
2018-10-28 19:42:48 +01:00
|
|
|
ifeq (jlink,$(PROGRAMMER))
|
|
|
|
# setup JLink for flashing
|
|
|
|
export JLINK_DEVICE := nrf52
|
|
|
|
|
|
|
|
# special options when using SoftDevice
|
|
|
|
ifneq (,$(filter nordic_softdevice_ble,$(USEPKG)))
|
2019-05-27 15:13:28 +02:00
|
|
|
export JLINK_PRE_FLASH := loadfile $(BINDIR)/softdevice.hex
|
2018-10-28 19:42:48 +01:00
|
|
|
export FLASH_ADDR := 0x1f000
|
|
|
|
export LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld
|
2019-08-12 11:08:35 +02:00
|
|
|
# murdock: softdevice.hex file is used for flashing
|
|
|
|
# It must be taken into account for the test input hash and
|
|
|
|
# be sent to the separated testing boards
|
|
|
|
TEST_EXTRA_FILES += $(BINDIR)/softdevice.hex
|
|
|
|
# Files in TEST_EXTRA_FILES need to have an explicit target
|
|
|
|
$(BINDIR)/softdevice.hex: | $(ELFFILE)
|
2018-10-28 19:42:48 +01:00
|
|
|
endif
|
|
|
|
include $(RIOTMAKE)/tools/jlink.inc.mk
|
2018-06-20 10:42:38 +02:00
|
|
|
else ifeq (openocd,$(PROGRAMMER))
|
2019-02-26 11:15:36 +01:00
|
|
|
ifneq (,$(filter $(BOARD),ruuvitag thingy52))
|
|
|
|
# openocd doesn't fully work with ruuvitag and thingy52
|
|
|
|
$(error Cannot use OpenOCD with $(BOARD) board)
|
|
|
|
endif
|
2018-06-20 10:42:38 +02:00
|
|
|
# setup OpenOCD for flashing. Version 0.10 of OpenOCD doesn't contain support
|
|
|
|
# for nrf52dk and nrf52840dk boards. To use OpenOCD with these a version
|
|
|
|
# build from source (master > 2018, August the 13rd) is required.
|
|
|
|
ifneq (,$(filter nordic_softdevice_ble,$(USEPKG)))
|
|
|
|
# openocd doesn't work (yet) with softdevice
|
|
|
|
$(error Cannot use OpenOCD with nordic_softdevice module)
|
|
|
|
endif
|
2019-05-31 11:43:47 +02:00
|
|
|
DEBUG_ADAPTER ?= jlink
|
2018-06-20 10:42:38 +02:00
|
|
|
export OPENOCD_CONFIG := $(RIOTBOARD)/common/nrf52/dist/openocd.cfg
|
|
|
|
include $(RIOTMAKE)/tools/openocd.inc.mk
|
2018-10-28 19:42:48 +01:00
|
|
|
endif
|