summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-07-13 10:02:20 -0400
committerGitHub <noreply@github.com>2018-07-13 10:02:20 -0400
commit414267388d37fdffc28f82195a02b165c1724299 (patch)
tree56a2993926d59989a2cf7b557152c3ba5328f3a2 /ports
parent2f877bd8510c5650b5517e5f1920fb2a155132d3 (diff)
parent883ca21321aa5938dfb46349454057ce481c0885 (diff)
Merge pull request #1023 from arturo182/nrf_pyocd
nrf: Fix flashing with pyocd
Diffstat (limited to 'ports')
-rwxr-xr-xports/nrf/Makefile20
1 files changed, 14 insertions, 6 deletions
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index 5bbeb17e3..586b0cbbd 100755
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -132,7 +132,7 @@ SRC_C += \
lib/tinyusb/src/class/msc/msc_device.c \
lib/tinyusb/src/class/cdc/cdc_device.c \
lib/tinyusb/src/tusb.c \
-
+
endif
DRIVERS_SRC_C += $(addprefix modules/,\
@@ -275,16 +275,24 @@ sd: $(BUILD)/$(OUTPUT_FILENAME).hex
bootloader:
nrfjprog --program $(BOOT_FILE).hex -f nrf52 --chiperase --reset
-
+
else ifeq ($(FLASHER), pyocd)
flash: $(BUILD)/$(OUTPUT_FILENAME).hex
- pyocd-flashtool -t $(MCU_VARIANT) $<
+ pyocd-flashtool -t $(MCU_SUB_VARIANT) $< --sector_erase
+ pyocd-tool -t $(MCU_SUB_VARIANT) erase $(BOOT_SETTING_ADDR)
+ pyocd-tool -t $(MCU_SUB_VARIANT) write32 $(BOOT_SETTING_ADDR) 0x00000001
+ pyocd-tool -t $(MCU_SUB_VARIANT) reset
sd: $(BUILD)/$(OUTPUT_FILENAME).hex
- pyocd-flashtool -t $(MCU_VARIANT) --chip_erase
- pyocd-flashtool -t $(MCU_VARIANT) $(SOFTDEV_HEX)
- pyocd-flashtool -t $(MCU_VARIANT) $<
+ pyocd-flashtool -t $(MCU_SUB_VARIANT) --chip_erase
+ pyocd-flashtool -t $(MCU_SUB_VARIANT) $(SOFTDEV_HEX)
+ pyocd-flashtool -t $(MCU_SUB_VARIANT) $< --sector_erase
+ pyocd-tool -t $(MCU_SUB_VARIANT) reset $(BOOT_SETTING_ADDR)
+
+bootloader:
+ pyocd-flashtool -t $(MCU_SUB_VARIANT) $(BOOT_FILE).hex --chip_erase
+ pyocd-tool -t $(MCU_SUB_VARIANT) reset
endif