Skip to content

Commit 25d6663

Browse files
authored
Merge pull request #972 from jluebbe/openocd-st-link-3
OpenOCD fix and device support
2 parents 60807bd + ad8f167 commit 25d6663

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

labgrid/driver/openocddriver.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,8 @@ def __attrs_post_init__(self):
6363
self.search = [self.search]
6464

6565
def _get_usb_path_cmd(self):
66-
# OpenOCD supports "adapter usb location" since a1b308ab, if the command is not known
67-
# notice user and continue
68-
message = ("Your OpenOCD version does not support specifying USB paths.\n"
69-
"Consider updating to OpenOCD v0.11 when using multiple USB Blasters.")
70-
return [
71-
"--command",
72-
"'if {{ [catch {{adapter usb location \"{usbpath}\"}}] }} {{ puts stderr \"{msg}\" }}'"
73-
.format(usbpath=self.interface.path, msg=message)
74-
]
66+
# OpenOCD supports "adapter usb location" since a1b308ab, released with 0.11.0-rc1
67+
return ["--command", f"'adapter usb location \"{self.interface.path}\"'"]
7568

7669
def _run_commands(self, commands: list):
7770
cmd = self.interface.command_prefix+[self.tool]

labgrid/resource/udev.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,8 @@ class USBDebugger(USBResource):
677677
def filter_match(self, device):
678678
match = (device.properties.get('ID_VENDOR_ID'), device.properties.get('ID_MODEL_ID'))
679679

680-
if match not in [("0403", "6010"),
680+
if match not in [("0403", "6010"), # FT2232C/D/H Dual UART/FIFO IC
681+
("0483", "374f"), # STLINK-V3
681682
]:
682683
return False
683684

0 commit comments

Comments
 (0)