Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards/common/nrf52: add openocd support for 'nordic_softdevice_ble' #11470

Merged
merged 1 commit into from
Sep 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions boards/common/nrf52/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,24 @@ else ifeq (openocd,$(PROGRAMMER))
# 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)
LINKER_SCRIPT ?= $(RIOTCPU)/$(CPU)/ldscripts/$(CPU_MODEL)_sd.ld

export OPENOCD_PRE_FLASH_CMDS += -c 'flash write_image erase "$(BINDIR)/softdevice.hex"'
export OPENOCD_PRE_VERIFY_CMDS += -c 'verify_image "$(BINDIR)/softdevice.hex"'

# Cannot use the 'ELFFILE' here
# The segments are 0x10000 aligned so padding bytes are copied and verified
#
# Using 'LINKFLAGS += -Wl,--nmagic' prevents it but would require
# dedicated testing/review
FLASHFILE ?= $(HEXFILE)

# murdock: softdevice.hex file is used for flashing
aabadie marked this conversation as resolved.
Show resolved Hide resolved
# 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
DEBUG_ADAPTER ?= jlink
export OPENOCD_CONFIG := $(RIOTBOARD)/common/nrf52/dist/openocd.cfg
Expand Down