diff --git a/scripts/pylib/pytest-twister-harness/src/twister_harness/device/hardware_adapter.py b/scripts/pylib/pytest-twister-harness/src/twister_harness/device/hardware_adapter.py index a058c2a0eb4..2289ffb04c4 100644 --- a/scripts/pylib/pytest-twister-harness/src/twister_harness/device/hardware_adapter.py +++ b/scripts/pylib/pytest-twister-harness/src/twister_harness/device/hardware_adapter.py @@ -86,7 +86,7 @@ class HardwareAdapter(DeviceAdapter): extra_args.append("--cmd-pre-init") extra_args.append(f'adapter serial {board_id}') elif runner == 'jlink': - base_args.append(f'--tool-opt=-SelectEmuBySN {board_id}') + base_args.append(f'--dev-id {board_id}') elif runner == 'stm32cubeprogrammer': base_args.append(f'--tool-opt=sn={board_id}') elif runner == 'linkserver': diff --git a/scripts/pylib/pytest-twister-harness/tests/device/hardware_adapter_test.py b/scripts/pylib/pytest-twister-harness/tests/device/hardware_adapter_test.py index 214a6080877..fc77d6e16ac 100644 --- a/scripts/pylib/pytest-twister-harness/tests/device/hardware_adapter_test.py +++ b/scripts/pylib/pytest-twister-harness/tests/device/hardware_adapter_test.py @@ -99,7 +99,7 @@ def test_if_get_command_returns_proper_string_6(patched_which, device: HardwareA assert isinstance(device.command, list) assert device.command == [ 'west', 'flash', '--skip-rebuild', '--build-dir', 'build', '--runner', 'jlink', - '--tool-opt=-SelectEmuBySN p_id' + '--dev-id p_id' ] diff --git a/scripts/pylib/twister/twisterlib/handlers.py b/scripts/pylib/twister/twisterlib/handlers.py index 9ec0eade215..dab77fc1a74 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -547,7 +547,8 @@ class DeviceHandler(Handler): command_extra_args.append("--cmd-pre-init") command_extra_args.append("adapter serial %s" % board_id) elif runner == "jlink": - command.append("--tool-opt=-SelectEmuBySN %s" % board_id) + command.append("--dev-id") + command.append(board_id) elif runner == "linkserver": # for linkserver # --probe=# select by probe index diff --git a/scripts/tests/twister/test_handlers.py b/scripts/tests/twister/test_handlers.py index b857ae3cc20..4d5505ae473 100644 --- a/scripts/tests/twister/test_handlers.py +++ b/scripts/tests/twister/test_handlers.py @@ -1117,7 +1117,7 @@ TESTDATA_13 = [ 'jlink', 'product', ['west', 'flash', '--skip-rebuild', '-d', '$build_dir', - '--runner', 'jlink', '--tool-opt=-SelectEmuBySN 12345', # 2x space + '--runner', 'jlink', '--dev-id', 12345, 'param1', 'param2'] ), (