From e2375d219aa57d18fc66929137d204b404e18cb7 Mon Sep 17 00:00:00 2001 From: Hake Huang Date: Wed, 20 Mar 2024 18:42:32 +0800 Subject: [PATCH] runner: linkerserver : remove the probe ID hardcode linkserver is hardcoded to probe ID, now with #70343 merged the probe ID restriction can be removed. (cherry picked from commit f419ea7990998ee13476d5c206a6bdb83a4a0567) Original-Signed-off-by: Hake Huang GitOrigin-RevId: f419ea7990998ee13476d5c206a6bdb83a4a0567 Change-Id: Ic330a9f5858a11108d385e2f59104952ffed4b37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5402705 Commit-Queue: Fabio Baltieri Tested-by: Keith Short Reviewed-by: Fabio Baltieri --- scripts/west_commands/runners/linkserver.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/west_commands/runners/linkserver.py b/scripts/west_commands/runners/linkserver.py index a4ae5c622d4..c1631d391af 100644 --- a/scripts/west_commands/runners/linkserver.py +++ b/scripts/west_commands/runners/linkserver.py @@ -25,7 +25,7 @@ class LinkServerBinaryRunner(ZephyrBinaryRunner): def __init__(self, cfg, device, core, linkserver=DEFAULT_LINKSERVER_EXE, dt_flash=True, erase=True, - probe=1, + probe='#1', gdb_host='', gdb_port=DEFAULT_LINKSERVER_GDB_PORT, semihost_port=DEFAULT_LINKSERVER_SEMIHOST_PORT, @@ -71,8 +71,8 @@ def do_add_parser(cls, parser): parser.add_argument('--core', required=False, help='core of the device') - parser.add_argument('--probe', default=1, - help='interface to use (index, no serial number), default is 1') + parser.add_argument('--probe', default='#1', + help='interface to use (index, or serial number, default is #1') parser.add_argument('--tui', default=False, action='store_true', help='if given, GDB uses -tui') @@ -169,7 +169,7 @@ def do_erase(self, **kwargs): else: _cmd_core = "" - linkserver_cmd = ([self.linkserver, "flash"] + ["--probe", "#"+str(self.probe)] + + linkserver_cmd = ([self.linkserver, "flash"] + ["--probe", str(self.probe)] + [self.device+_cmd_core] + ["erase"]) self.logger.debug("flash erase command = " + str(linkserver_cmd)) self.check_call(linkserver_cmd) @@ -191,7 +191,7 @@ def flash(self, **kwargs): else: _cmd_core = "" - linkserver_cmd = ([self.linkserver, "flash"] + ["--probe", "#"+str(self.probe)] + self.override_cli + [self.device+_cmd_core]) + linkserver_cmd = ([self.linkserver, "flash"] + ["--probe", str(self.probe)] + self.override_cli + [self.device+_cmd_core]) self.logger.debug(f'LinkServer cmd: + {linkserver_cmd}') if self.erase: