Skip to content

Commit ad8f167

Browse files
committed
driver/openocddriver: unconditionally configure USB location
It seems that in some cases, the catch and error message command causes the error 'extra characters after close-brace' in OpenOCD. As this feature is contained in 0.11.0-rc1 (published 2020-12-09) and the command will trigger an error if the support is missing, we can drop the special handling here. Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
1 parent 4d69485 commit ad8f167

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
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]

0 commit comments

Comments
 (0)