File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ def add_subparser(subparser):
73
73
# -----------------------------------------------------------------------------
74
74
if __name__ == "__main__" :
75
75
import argparse
76
+ import os .path
76
77
77
78
parser = argparse .ArgumentParser (
78
79
description = 'Program ELF file or reset device via Black Magic Probe' )
Original file line number Diff line number Diff line change @@ -50,7 +50,18 @@ def guess_serial_port(port_hint=None):
50
50
else :
51
51
ports = glob .glob ('/dev/tty.usb*' )
52
52
else :
53
- ports = glob .glob ('/dev/tty[A-Za-z]*' )
53
+ if port_hint == 'bmp' :
54
+ import os .path
55
+ # Symlink created by BMP udev rules
56
+ # https://github.com/blackmagic-debug/blackmagic/blob/main/driver/99-blackmagic-plugdev.rules
57
+ if os .path .exists ('/dev/ttyBmpGdb' ):
58
+ ports = ['/dev/ttyBmpGdb' ]
59
+ elif os .path .exists ('/dev/ttyACM0' ):
60
+ ports = ['/dev/ttyACM0' ]
61
+ else :
62
+ ports = [None ]
63
+ else :
64
+ ports = glob .glob ('/dev/tty[A-Za-z]*' )
54
65
return next (iter (ports ), None )
55
66
56
67
You can’t perform that action at this time.
0 commit comments