summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorCraig Hesling <hesling@chromium.org>2020-06-02 09:01:33 -0700
committerCommit Bot <commit-bot@chromium.org>2020-06-04 20:08:01 +0000
commit0fb5ededcf63703334aee46ddb94f6e3b38d5166 (patch)
tree616a9680c3bf9524c5a450afefb93c47260d9b1f /util
parentf8ba78608c7ab29431d2ad6e043da95d0032b24b (diff)
downloadchrome-ec-0fb5ededcf63703334aee46ddb94f6e3b38d5166.tar.gz
util/flash_jlink.py: Allow USB mode
This adds the option to specify "" for --ip, which will disable the TCP/IP mode. Thus, the JLink tool will default to USB direct. BRANCH=none BUG=none TEST=# Ensure JLinkRemoteServerCLExe is not running ./util/flash_jlink.py --ip '' # Ensure JLinkExe uses direct USB and succeeds TEST=# Ensure "JLinkRemoteServerCLExe -Port 2551 -select USB" is running ./util/flash_jlink.py # Ensure JLinkExe uses TCP/IP and succeeds Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I9da2efa8adf155673f14f12dbb354492b0827332 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2226880 Commit-Queue: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'util')
-rwxr-xr-xutil/flash_jlink.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/util/flash_jlink.py b/util/flash_jlink.py
index 826f6eea60..3dd731bf7d 100755
--- a/util/flash_jlink.py
+++ b/util/flash_jlink.py
@@ -53,13 +53,18 @@ def create_jlink_command_file(firmware_file):
def flash(jlink_exe, ip, device, interface, cmd_file):
cmd = [
jlink_exe,
- '-ip', ip,
+ ]
+
+ if len(ip) > 0:
+ cmd.extend(['-ip', ip])
+
+ cmd.extend([
'-device', device,
'-if', interface,
'-speed', 'auto',
'-autoconnect', '1',
- '-CommandFile', cmd_file
- ]
+ '-CommandFile', cmd_file,
+ ])
logging.debug('Running command: "%s"', ' '.join(cmd))
subprocess.run(cmd)