mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
e70efb769c
When running tests using 'nordic_softdevice_ble', the 'softdevice.hex' file must also be taken into account for the test hashing and be uploaded to the separated murdock testing boards. When listed as dependency from `test-input-hash` the file must have a target, which he has not. The file is implicitly created when compiling `ELFFILE` so declare it as order only dependency. In practice `BASELIBS` could be enough or even `pkg-build-softdevice` but I do not want to be depend that much on internals there.
51 lines
2.0 KiB
Makefile
51 lines
2.0 KiB
Makefile
# 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
|
|
|
|
# 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
|
|
|
|
PROGRAMMER ?= jlink
|
|
ifeq (jlink,$(PROGRAMMER))
|
|
# setup JLink for flashing
|
|
export JLINK_DEVICE := nrf52
|
|
|
|
# special options when using SoftDevice
|
|
ifneq (,$(filter nordic_softdevice_ble,$(USEPKG)))
|
|
export JLINK_PRE_FLASH := erase\nloadfile $(BINDIR)/softdevice.hex
|
|
export FLASH_ADDR := 0x1f000
|
|
export LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld
|
|
# 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)
|
|
endif
|
|
include $(RIOTMAKE)/tools/jlink.inc.mk
|
|
else ifeq (openocd,$(PROGRAMMER))
|
|
ifneq (,$(filter $(BOARD),ruuvitag thingy52))
|
|
# openocd doesn't fully work with ruuvitag and thingy52
|
|
$(error Cannot use OpenOCD with $(BOARD) board)
|
|
endif
|
|
# 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
|
|
DEBUG_ADAPTER ?= jlink
|
|
export OPENOCD_CONFIG := $(RIOTBOARD)/common/nrf52/dist/openocd.cfg
|
|
include $(RIOTMAKE)/tools/openocd.inc.mk
|
|
endif
|