Skip to content

Commit 636df43

Browse files
mathieuchopstmnashif
authored andcommitted
twister: device-handler: use --dev-id for STM32CubeProgrammer runner
Now that the STM32CubeProgrammer runner supports the standard `--dev-id` argument, replace usage of `--tool-opt` in the Twister device handler code. Signed-off-by: Mathieu Choplain <[email protected]>
1 parent aaaf1d3 commit 636df43

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

scripts/pylib/twister/twisterlib/handlers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,8 @@ def _create_command(self, runner, hardware):
638638
# --probe=<serial number> select by probe serial number
639639
command.append(f"--probe={board_id}")
640640
elif runner == "stm32cubeprogrammer" and product != "BOOT-SERIAL":
641-
command.append(f"--tool-opt=sn={board_id}")
641+
command.append('--dev-id')
642+
command.append(board_id)
642643

643644
# Receive parameters from runner_params field.
644645
if hardware.runner_params:

scripts/tests/twister/test_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ def mock_availability(handler, instance, no=num_of_failures):
11411141
'product',
11421142
None,
11431143
['west', 'flash', '--skip-rebuild', '-d', '$build_dir',
1144-
'--runner', 'stm32cubeprogrammer', '--tool-opt=sn=12345',
1144+
'--runner', 'stm32cubeprogrammer', '--dev-id', 12345,
11451145
'param1', 'param2']
11461146
),
11471147
(

0 commit comments

Comments
 (0)