Merge pull request #1023 from arturo182/nrf_pyocd

nrf: Fix flashing with pyocd
This commit is contained in:
Dan Halbert 2018-07-13 10:02:20 -04:00 committed by GitHub
commit 414267388d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 6 deletions

View File

@ -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