Skip to content

Commit cd9a8c1

Browse files
jimmodpgeorge
authored andcommitted
nrf: Add openocd as a supported flasher.
Tested with the Particle Debugger on a Xenon.
1 parent 1f1b787 commit cd9a8c1

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

ports/nrf/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,24 @@ sd: $(BUILD)/$(OUTPUT_FILENAME).elf
419419
-ex 'quit' \
420420
$<
421421

422+
else ifeq ($(FLASHER), openocd)
423+
424+
OPENOCD ?= openocd
425+
426+
ifeq ($(MCU_VARIANT), nrf51)
427+
OPENOCD_TARGET ?= target/nrf52.cfg
428+
else ifeq ($(MCU_VARIANT), nrf52)
429+
OPENOCD_TARGET ?= target/nrf52.cfg
430+
else
431+
$(error Unsupported openocd target)
432+
endif
433+
434+
deploy: $(BUILD)/$(OUTPUT_FILENAME).hex
435+
$(Q)$(OPENOCD) -f interface/cmsis-dap.cfg -f $(OPENOCD_TARGET) -c "init" -c "program $< verify reset" -c "exit"
436+
437+
sd: $(BUILD)/$(OUTPUT_FILENAME).hex
438+
$(Q)$(OPENOCD) -f interface/cmsis-dap.cfg -f $(OPENOCD_TARGET) -c "init" -c "program $(SOFTDEV_HEX) verify reset" -c "exit"
439+
422440
endif
423441

424442
flash: deploy

ports/nrf/boards/particle_xenon/mpconfigboard.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ SOFTDEV_VERSION = 6.1.1
55
LD_FILES += boards/nrf52840_1M_256k.ld
66

77
NRF_DEFINES += -DNRF52840_XXAA
8+
9+
# The nrf52-particle.cfg is not included here, it can be found in the Particle Workbench
10+
# Note: This requires openocd >0.10
11+
OPENOCD_TARGET ?= boards/$(BOARD)/nrf52-particle.cfg

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy