scripts: west_commands: runners: remove deprecated options

The --snr (nrfjprog) --id (jlink) and --board-id (pyocd) options were
deprecated a long time ago in favor of --dev-id. It is time to remove
them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-11-30 11:18:13 +01:00 committed by Carles Cufí
commit 2cee5ff519
5 changed files with 5 additions and 24 deletions

View file

@ -485,10 +485,7 @@ class DeviceHandler(Handler):
board_id = hardware.probe_id or hardware.id board_id = hardware.probe_id or hardware.id
product = hardware.product product = hardware.product
if board_id is not None: if board_id is not None:
if runner == "pyocd": if runner in ("pyocd", "nrfjprog"):
command_extra_args.append("--board-id")
command_extra_args.append(board_id)
elif runner == "nrfjprog":
command_extra_args.append("--dev-id") command_extra_args.append("--dev-id")
command_extra_args.append(board_id) command_extra_args.append(board_id)
elif runner == "openocd" and product == "STM32 STLink": elif runner == "openocd" and product == "STM32 STLink":

View file

@ -5,7 +5,6 @@
'''Runner for debugging with J-Link.''' '''Runner for debugging with J-Link.'''
import argparse import argparse
from functools import partial
import logging import logging
import os import os
from pathlib import Path from pathlib import Path
@ -14,7 +13,7 @@ import subprocess
import sys import sys
import tempfile import tempfile
from runners.core import ZephyrBinaryRunner, RunnerCaps, depr_action from runners.core import ZephyrBinaryRunner, RunnerCaps
try: try:
import pylink import pylink
@ -93,10 +92,6 @@ class JLinkBinaryRunner(ZephyrBinaryRunner):
# Optional: # Optional:
parser.add_argument('--loader', required=False, dest='loader', parser.add_argument('--loader', required=False, dest='loader',
help='specifies a loader type') help='specifies a loader type')
parser.add_argument('--id', required=False, dest='dev_id',
action=partial(depr_action,
replacement='-i/--dev-id'),
help='Deprecated: use -i/--dev-id instead')
parser.add_argument('--iface', default='swd', parser.add_argument('--iface', default='swd',
help='interface to use, default is swd') help='interface to use, default is swd')
parser.add_argument('--speed', default='auto', parser.add_argument('--speed', default='auto',

View file

@ -5,7 +5,6 @@
'''Runner for flashing with nrfjprog.''' '''Runner for flashing with nrfjprog.'''
from functools import partial
import os import os
from pathlib import Path from pathlib import Path
import shlex import shlex
@ -13,7 +12,7 @@ import subprocess
import sys import sys
from re import fullmatch, escape from re import fullmatch, escape
from runners.core import ZephyrBinaryRunner, RunnerCaps, depr_action from runners.core import ZephyrBinaryRunner, RunnerCaps
try: try:
from intelhex import IntelHex from intelhex import IntelHex
@ -70,10 +69,6 @@ class NrfJprogBinaryRunner(ZephyrBinaryRunner):
parser.add_argument('--softreset', required=False, parser.add_argument('--softreset', required=False,
action='store_true', action='store_true',
help='use reset instead of pinreset') help='use reset instead of pinreset')
parser.add_argument('--snr', required=False, dest='dev_id',
action=partial(depr_action,
replacement='-i/--dev-id'),
help='Deprecated: use -i/--dev-id instead')
parser.add_argument('--force', required=False, parser.add_argument('--force', required=False,
action='store_true', action='store_true',
help='Flash even if the result cannot be guaranteed.') help='Flash even if the result cannot be guaranteed.')

View file

@ -4,12 +4,10 @@
'''Runner for pyOCD .''' '''Runner for pyOCD .'''
from functools import partial
import os import os
from os import path from os import path
from runners.core import ZephyrBinaryRunner, RunnerCaps, \ from runners.core import ZephyrBinaryRunner, RunnerCaps, BuildConfiguration
BuildConfiguration, depr_action
DEFAULT_PYOCD_GDB_PORT = 3333 DEFAULT_PYOCD_GDB_PORT = 3333
DEFAULT_PYOCD_TELNET_PORT = 4444 DEFAULT_PYOCD_TELNET_PORT = 4444
@ -109,10 +107,6 @@ class PyOcdBinaryRunner(ZephyrBinaryRunner):
DEFAULT_PYOCD_TELNET_PORT)) DEFAULT_PYOCD_TELNET_PORT))
parser.add_argument('--tui', default=False, action='store_true', parser.add_argument('--tui', default=False, action='store_true',
help='if given, GDB uses -tui') help='if given, GDB uses -tui')
parser.add_argument('--board-id', dest='dev_id',
action=partial(depr_action,
replacement='-i/--dev-id'),
help='Deprecated: use -i/--dev-id instead')
@classmethod @classmethod
def tool_opt_help(cls) -> str: def tool_opt_help(cls) -> str:

View file

@ -473,7 +473,7 @@ def test_nrfjprog_create(check_call, get_snr, require, test_case,
if test_case.softreset: if test_case.softreset:
args.append('--softreset') args.append('--softreset')
if test_case.snr: if test_case.snr:
args.extend(['--snr', TEST_OVR_SNR]) args.extend(['--dev-id', TEST_OVR_SNR])
if test_case.erase: if test_case.erase:
args.append('--erase') args.append('--erase')
if test_case.recover: if test_case.recover: