nrf/Makefile: Improve Black Magic Probe commands.

Used batch mode to get rid of the confirmation prompt on flashing.
Used 'compare-sections' to verify flash.
Removed the unnecessary `quit` at the end.
This commit is contained in:
Pooya Moradi 2020-12-04 16:01:19 +03:30 committed by Damien George
parent 19f09414a6
commit 95ccd9a005
1 changed files with 5 additions and 4 deletions

View File

@ -430,19 +430,19 @@ else ifeq ($(FLASHER), bmp)
BMP_PORT ?= /dev/ttyACM0 BMP_PORT ?= /dev/ttyACM0
deploy: $(BUILD)/$(OUTPUT_FILENAME).elf deploy: $(BUILD)/$(OUTPUT_FILENAME).elf
$(Q)$(GDB) \ $(Q)$(GDB) -nx --batch \
-ex 'target extended-remote $(BMP_PORT)' \ -ex 'target extended-remote $(BMP_PORT)' \
-ex 'monitor tpwr enable' \ -ex 'monitor tpwr enable' \
-ex 'monitor swdp_scan' \ -ex 'monitor swdp_scan' \
-ex 'attach 1' \ -ex 'attach 1' \
-ex 'set mem inaccessible-by-default off' \ -ex 'set mem inaccessible-by-default off' \
-ex 'load' \ -ex 'load' \
-ex 'compare-sections' \
-ex 'kill' \ -ex 'kill' \
-ex 'quit' \
$< $<
sd: $(BUILD)/$(OUTPUT_FILENAME).elf sd: $(BUILD)/$(OUTPUT_FILENAME).elf
$(Q)$(GDB) \ $(Q)$(GDB) -nx --batch \
-ex 'target extended-remote $(BMP_PORT)' \ -ex 'target extended-remote $(BMP_PORT)' \
-ex 'monitor tpwr enable' \ -ex 'monitor tpwr enable' \
-ex 'monitor swdp_scan' \ -ex 'monitor swdp_scan' \
@ -450,10 +450,11 @@ sd: $(BUILD)/$(OUTPUT_FILENAME).elf
-ex 'set mem inaccessible-by-default off' \ -ex 'set mem inaccessible-by-default off' \
-ex 'monitor erase_mass' \ -ex 'monitor erase_mass' \
-ex 'load' \ -ex 'load' \
-ex 'compare-sections' \
-ex 'file $(SOFTDEV_HEX)' \ -ex 'file $(SOFTDEV_HEX)' \
-ex 'load' \ -ex 'load' \
-ex 'compare-sections' \
-ex 'kill' \ -ex 'kill' \
-ex 'quit' \
$< $<
else ifeq ($(FLASHER), openocd) else ifeq ($(FLASHER), openocd)