File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 4141NRFJPROG = nrfjprog
4242endif
4343
44+ # auto-detect BMP on macOS, otherwise have to specify
45+ BMP_PORT ?= $(shell ls -1 /dev/cu.usbmodem????????1 | head -1)
46+
4447ifeq ($(OS ) ,Windows_NT)
4548PROGFILES = C:/Program Files (x86)
4649GNU_INSTALL_ROOT = $(PROGFILES ) /GNU Tools ARM Embedded/7 2018-q2-update/bin/
@@ -67,6 +70,9 @@ NM := '$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-nm'
6770OBJDUMP := '$(GNU_INSTALL_ROOT )$(GNU_PREFIX ) -objdump'
6871OBJCOPY := '$(GNU_INSTALL_ROOT )$(GNU_PREFIX ) -objcopy'
6972SIZE := '$(GNU_INSTALL_ROOT )$(GNU_PREFIX ) -size'
73+ GDB := '$(GNU_INSTALL_ROOT )$(GNU_PREFIX ) -gdb'
74+
75+ GDB_BMP = arm-none-eabi-gdb -ex 'target extended-remote $(BMP_PORT ) ' -ex 'monitor swdp_scan' -ex 'attach 1'
7076
7177# function for removing duplicates in a list
7278remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-out $(firstword $1) ,$1) ) ) )
@@ -341,6 +347,10 @@ erase:
341347 @echo Erasing chip
342348 $(NRFJPROG ) --eraseall -f nrf52
343349
350+ gdbflash : $(BUILD ) /$(MERGED_FNAME ) .hex
351+ @echo Flashing: $<
352+ @$(GDB_BMP ) -nx --batch -ex ' load $<' -ex ' compare-sections' -ex ' kill'
353+
344354# ******************* Compile rules *******************
345355
346356# # Create build directories
You can’t perform that action at this time.
0 commit comments