Skip to content

Commit 49fd3d9

Browse files
authored
Merge pull request #9 from openmv/fix_search_paths
backends: Fix search paths.
2 parents ab84075 + 0adc92e commit 49fd3d9

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/gdbrunner/backends.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
"stlink": {
1515
"command": "ST-LINK_gdbserver",
1616
"fixed_args": ["--persistent"],
17-
"paths": [
18-
"~/STM32CubeProgrammer/bin",
19-
"/opt/st/STM32CubeProgrammer/bin",
20-
"~/st/stm32cubeide_*/plugins/*cubeprogrammer.*/tools/bin",
21-
"/opt/st/stm32cubeide_*/plugins/*cubeprogrammer.*/tools/bin"
22-
],
2317
"arguments": [
2418
{"flag": "--port", "cmd": "--port-number", "type": "int", "default": 2331, "help": "GDB server port (default: 2331)"},
25-
{"flag": "--cube-prog", "cmd": "--stm32cubeprogrammer-path", "required": true, "auto": true, "help": "Path to STM32CubeProgrammer tools"},
19+
{"flag": "--cube-prog", "cmd": "--stm32cubeprogrammer-path", "required": true, "paths": [
20+
"~/STM32CubeProgrammer/bin",
21+
"/opt/st/STM32CubeProgrammer/bin",
22+
"~/st/stm32cubeide_*/plugins/*cubeprogrammer.*/tools/bin",
23+
"/opt/st/stm32cubeide_*/plugins/*cubeprogrammer.*/tools/bin"
24+
], "help": "Path to STM32CubeProgrammer tools"},
2625
{"flag": "--extload", "cmd": "--extload", "help": "External loader file"},
2726
{"flag": "--apid", "cmd": "--apid", "type": "int", "default": 1, "help": "Access port ID (default: 1)"},
2827
{"flag": "--halt", "cmd": "--halt", "type": "bool", "default": true, "help": "Halt on connect (default: true)"},

src/gdbrunner/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def parse_bool(value):
5151
kwargs["help"] = arg["help"]
5252
if "default" in arg:
5353
kwargs["default"] = arg["default"]
54-
elif arg.get("auto"):
55-
path = search_path(config.get("paths", []))
54+
elif "paths" in arg:
55+
path = search_path(arg["paths"])
5656
if path:
5757
kwargs["default"] = path
5858
if arg.get("required") and "default" not in kwargs:

0 commit comments

Comments
 (0)