Skip to content

Commit d1135e4

Browse files
committed
Add BMP support
1 parent efcd8dc commit d1135e4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Makefile

+11-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,17 @@ include rules.mk
4949
size: $(OBJS) $(ELF)
5050
@$(PREFIX)-size $(ELF)
5151

52-
debug: $(ELF)
52+
BMP = $(shell ls -1 /dev/cu.usbmodem* | head -1)
53+
BMP_ARGS = -ex "target extended-remote $(BMP)" -ex "mon swdp_scan" -ex "attach 1"
54+
GDB = arm-none-eabi-gdb
55+
56+
flash: $(ELF)
57+
$(GDB) $(BMP_ARGS) -ex "load" -ex "quit" $(ELF)
58+
59+
gdb: $(ELF)
60+
$(GDB) $(BMP_ARGS) $(ELF)
61+
62+
ocd-gdb: $(ELF)
5363
-$(GDB) --eval "target remote | $(OOCD) -f $(OOCD_INTERFACE) -f $(OOCD_BOARD) -f debug.cfg" $(ELF)
5464

5565
erase:

src/rules.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ srec: $(BINARY).srec
143143
list: $(BINARY).list
144144

145145
images: $(BUILD)/$(BINARY).images
146-
flash: $(BUILD)/$(BINARY).flash
146+
ocd-flash: $(BUILD)/$(BINARY).flash
147147

148148
$(LDSCRIPT):
149149
ifeq (,$(wildcard $(LDSCRIPT)))

0 commit comments

Comments
 (0)