1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

dist/tools/bmp: Fix flashing with pygdbmi 0.10.0

The flashing script for the black magic probe stopped working with pygdbmi in
version 0.10.0 due to an API change. This adapts the code to first try
initialization with the old pygdbmi API (as before), but tries again with the
new API if that fails.
This commit is contained in:
Marian Buschsieweke 2020-11-03 16:33:46 +01:00
parent 9681c204d6
commit 71b2860322
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F

View File

@ -219,7 +219,12 @@ def debug_mode(port):
def connect_to_target(port):
# open GDB in machine interface mode
gdbmi = GdbController(gdb_path=args.gdb_path, gdb_args=["--nx", "--quiet", "--interpreter=mi2", args.file])
try:
# try old API first
gdbmi = GdbController(gdb_path=args.gdb_path, gdb_args=["--nx", "--quiet", "--interpreter=mi2", args.file])
except TypeError:
# and then new API
gdbmi = GdbController(command=[args.gdb_path, "--nx", "--quiet", "--interpreter=mi2", args.file])
assert gdb_write_and_wait_for_result(gdbmi, '-target-select extended-remote %s' % port, 'connecting',
expected_result='connected')
# set options