nrf: Add openocd as a supported flasher.
Tested with the Particle Debugger on a Xenon.
This commit is contained in:
parent
1f1b78752f
commit
cd9a8c1742
@ -419,6 +419,24 @@ sd: $(BUILD)/$(OUTPUT_FILENAME).elf
|
||||
-ex 'quit' \
|
||||
$<
|
||||
|
||||
else ifeq ($(FLASHER), openocd)
|
||||
|
||||
OPENOCD ?= openocd
|
||||
|
||||
ifeq ($(MCU_VARIANT), nrf51)
|
||||
OPENOCD_TARGET ?= target/nrf52.cfg
|
||||
else ifeq ($(MCU_VARIANT), nrf52)
|
||||
OPENOCD_TARGET ?= target/nrf52.cfg
|
||||
else
|
||||
$(error Unsupported openocd target)
|
||||
endif
|
||||
|
||||
deploy: $(BUILD)/$(OUTPUT_FILENAME).hex
|
||||
$(Q)$(OPENOCD) -f interface/cmsis-dap.cfg -f $(OPENOCD_TARGET) -c "init" -c "program $< verify reset" -c "exit"
|
||||
|
||||
sd: $(BUILD)/$(OUTPUT_FILENAME).hex
|
||||
$(Q)$(OPENOCD) -f interface/cmsis-dap.cfg -f $(OPENOCD_TARGET) -c "init" -c "program $(SOFTDEV_HEX) verify reset" -c "exit"
|
||||
|
||||
endif
|
||||
|
||||
flash: deploy
|
||||
|
@ -5,3 +5,7 @@ SOFTDEV_VERSION = 6.1.1
|
||||
LD_FILES += boards/nrf52840_1M_256k.ld
|
||||
|
||||
NRF_DEFINES += -DNRF52840_XXAA
|
||||
|
||||
# The nrf52-particle.cfg is not included here, it can be found in the Particle Workbench
|
||||
# Note: This requires openocd >0.10
|
||||
OPENOCD_TARGET ?= boards/$(BOARD)/nrf52-particle.cfg
|
||||
|
Loading…
Reference in New Issue
Block a user