Added support for Black Magic Probe (#787)

* Added flash-bmp and debug-bmp targets; added .gdb_history to .gitignore
* Added the BMP variable, defaults to /dev/ttyBmpGdb
The name of the BMP device is different on different systems. On Linux (after installing the recommended udev rules) it'll be /dev/ttyBmpGdb, but the user should be able to override it.
* Update rules.mk
This commit is contained in:
Dima Barsky 2021-04-16 14:23:27 +01:00 committed by GitHub
parent c611199632
commit 9f925bc900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View File

@ -13,6 +13,7 @@ latex
.env
.settings/
.idea/
.gdb_history
/examples/*/*/build*
test_old/
tests_obsolete/

View File

@ -57,6 +57,7 @@ CROSS_COMPILE ?= arm-none-eabi-
CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
GDB = $(CROSS_COMPILE)gdb
OBJCOPY = $(CROSS_COMPILE)objcopy
SIZE = $(CROSS_COMPILE)size
MKDIR = mkdir

View File

@ -170,6 +170,16 @@ flash-pyocd: $(BUILD)/$(PROJECT).hex
pyocd flash -t $(PYOCD_TARGET) $<
pyocd reset -t $(PYOCD_TARGET)
# flash with Black Magic Probe
# This symlink is created by https://github.com/blacksphere/blackmagic/blob/master/driver/99-blackmagic.rules
BMP ?= /dev/ttyBmpGdb
flash-bmp: $(BUILD)/$(PROJECT).elf
$(GDB) --batch -ex 'target extended-remote $(BMP)' -ex 'monitor swdp_scan' -ex 'attach 1' -ex load $<
debug-bmp: $(BUILD)/$(PROJECT).elf
$(GDB) -ex 'target extended-remote $(BMP)' -ex 'monitor swdp_scan' -ex 'attach 1' $<
#-------------- Artifacts --------------