Skip to content

Commit 9ad7f84

Browse files
VynDragonkartben
authored andcommitted
west: runners: Do not ignore --no-reset in command line or arguments
Prevents this code section from enforcing reset even if --no-reset was passed at some point Signed-off-by: Camille BAUD <[email protected]>
1 parent 681c7da commit 9ad7f84

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

scripts/west_commands/run_common.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,17 @@ def do_run_common_image(command, user_args, user_runner_args, used_cmds,
411411

412412
i = i - 1
413413

414+
# Arguments in this order to allow specific to override general:
415+
#
416+
# - runner-specific runners.yaml arguments
417+
# - user-provided command line arguments
418+
final_argv = runners_yaml['args'][runner_name] + runner_args
419+
414420
# If flashing multiple images, the runner supports reset after flashing and
415421
# the board has enabled this functionality, check if the board should be
416422
# reset or not. If this is not specified in the board/soc file, leave it up to
417423
# the runner's default configuration to decide if a reset should occur.
418-
if runner_cls.capabilities().reset:
424+
if runner_cls.capabilities().reset and '--no-reset' not in final_argv:
419425
if board_image_count is not None:
420426
reset = True
421427

@@ -449,15 +455,9 @@ def do_run_common_image(command, user_args, user_runner_args, used_cmds,
449455
break
450456

451457
if reset:
452-
runner_args.append('--reset')
458+
final_argv.append('--reset')
453459
else:
454-
runner_args.append('--no-reset')
455-
456-
# Arguments in this order to allow specific to override general:
457-
#
458-
# - runner-specific runners.yaml arguments
459-
# - user-provided command line arguments
460-
final_argv = runners_yaml['args'][runner_name] + runner_args
460+
final_argv.append('--no-reset')
461461

462462
# 'user_args' contains parsed arguments which are:
463463
#

0 commit comments

Comments
 (0)