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 41
41
NRFJPROG = nrfjprog
42
42
endif
43
43
44
+ # auto-detect BMP on macOS, otherwise have to specify
45
+ BMP_PORT ?= $(shell ls -1 /dev/cu.usbmodem????????1 | head -1)
46
+
44
47
ifeq ($(OS ) ,Windows_NT)
45
48
PROGFILES = C:/Program Files (x86)
46
49
GNU_INSTALL_ROOT = $(PROGFILES ) /GNU Tools ARM Embedded/7 2018-q2-update/bin/
@@ -67,6 +70,9 @@ NM := '$(GNU_INSTALL_ROOT)$(GNU_PREFIX)-nm'
67
70
OBJDUMP := '$(GNU_INSTALL_ROOT )$(GNU_PREFIX ) -objdump'
68
71
OBJCOPY := '$(GNU_INSTALL_ROOT )$(GNU_PREFIX ) -objcopy'
69
72
SIZE := '$(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'
70
76
71
77
# function for removing duplicates in a list
72
78
remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-out $(firstword $1) ,$1) ) ) )
@@ -341,6 +347,10 @@ erase:
341
347
@echo Erasing chip
342
348
$(NRFJPROG ) --eraseall -f nrf52
343
349
350
+ gdbflash : $(BUILD ) /$(MERGED_FNAME ) .hex
351
+ @echo Flashing: $<
352
+ @$(GDB_BMP ) -nx --batch -ex ' load $<' -ex ' compare-sections' -ex ' kill'
353
+
344
354
# ******************* Compile rules *******************
345
355
346
356
# # Create build directories
You can’t perform that action at this time.
0 commit comments