runners: openocd: always search the board support directory if found
Always add the boards/<arch>/<board>/support directory to the OpenOCD runner search path if the directory exists. This simplifies using custom --config <partial-board.cfg> runner arguments without having to use the full path to the cfg file. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
fd316a5452
commit
5d34a45697
|
@ -35,16 +35,22 @@ class OpenOcdBinaryRunner(ZephyrBinaryRunner):
|
||||||
gdb_init=None, no_load=False):
|
gdb_init=None, no_load=False):
|
||||||
super().__init__(cfg)
|
super().__init__(cfg)
|
||||||
|
|
||||||
|
support = path.join(cfg.board_dir, 'support')
|
||||||
|
|
||||||
if not config:
|
if not config:
|
||||||
default = path.join(cfg.board_dir, 'support', 'openocd.cfg')
|
default = path.join(support, 'openocd.cfg')
|
||||||
if path.exists(default):
|
if path.exists(default):
|
||||||
config = [default]
|
config = [default]
|
||||||
self.openocd_config = config
|
self.openocd_config = config
|
||||||
|
|
||||||
search_args = []
|
search_args = []
|
||||||
|
if path.exists(support):
|
||||||
|
search_args.append('-s')
|
||||||
|
search_args.append(support)
|
||||||
|
|
||||||
if self.openocd_config is not None:
|
if self.openocd_config is not None:
|
||||||
for i in self.openocd_config:
|
for i in self.openocd_config:
|
||||||
if path.exists(i):
|
if path.exists(i) and not path.samefile(path.dirname(i), support):
|
||||||
search_args.append('-s')
|
search_args.append('-s')
|
||||||
search_args.append(path.dirname(i))
|
search_args.append(path.dirname(i))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue