scripts: west_commands: runners: Fix line-too-long (E501)
Wrap long lines to max 100 characters. See https://docs.astral.sh/ruff/rules/line-too-long/ Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
775db0e63a
commit
336c7dadac
17 changed files with 148 additions and 70 deletions
|
@ -144,7 +144,9 @@ class BossacBinaryRunner(ZephyrBinaryRunner):
|
||||||
|
|
||||||
def is_gnu_coreutils_stty(self):
|
def is_gnu_coreutils_stty(self):
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(['stty', '--version'], capture_output=True, text=True, check=True)
|
result = subprocess.run(
|
||||||
|
['stty', '--version'], capture_output=True, text=True, check=True
|
||||||
|
)
|
||||||
return 'coreutils' in result.stdout
|
return 'coreutils' in result.stdout
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -112,8 +112,10 @@ class CANopenBinaryRunner(ZephyrBinaryRunner):
|
||||||
parser.add_argument('--sdo-timeout', type=float, default=DEFAULT_SDO_TIMEOUT,
|
parser.add_argument('--sdo-timeout', type=float, default=DEFAULT_SDO_TIMEOUT,
|
||||||
help=f'''CANopen SDO response timeout in seconds
|
help=f'''CANopen SDO response timeout in seconds
|
||||||
(default: {DEFAULT_SDO_TIMEOUT})''')
|
(default: {DEFAULT_SDO_TIMEOUT})''')
|
||||||
parser.add_argument('--download-buffer-size', type=int, default=DEFAULT_PROGRAM_DOWNLOAD_BUFFER_SIZE,
|
parser.add_argument('--download-buffer-size', type=int,
|
||||||
help=f'Program download buffer size in bytes (default: {DEFAULT_PROGRAM_DOWNLOAD_BUFFER_SIZE})')
|
default=DEFAULT_PROGRAM_DOWNLOAD_BUFFER_SIZE,
|
||||||
|
help=f'''Program download buffer size in bytes
|
||||||
|
(default: {DEFAULT_PROGRAM_DOWNLOAD_BUFFER_SIZE})''')
|
||||||
parser.add_argument('--block-transfer', default=False, action='store_true',
|
parser.add_argument('--block-transfer', default=False, action='store_true',
|
||||||
help='Use SDO block transfers (experimental, default: no)')
|
help='Use SDO block transfers (experimental, default: no)')
|
||||||
|
|
||||||
|
|
|
@ -576,16 +576,22 @@ class ZephyrBinaryRunner(abc.ABC):
|
||||||
else:
|
else:
|
||||||
parser.add_argument('--elf-file',
|
parser.add_argument('--elf-file',
|
||||||
metavar='FILE',
|
metavar='FILE',
|
||||||
action=(partial(depr_action, cls=cls, replacement='-f/--file') if caps.file else None),
|
action=(partial(depr_action, cls=cls,
|
||||||
help='path to zephyr.elf' if not caps.file else 'Deprecated, use -f/--file instead.')
|
replacement='-f/--file') if caps.file else None),
|
||||||
|
help='path to zephyr.elf'
|
||||||
|
if not caps.file else 'Deprecated, use -f/--file instead.')
|
||||||
parser.add_argument('--hex-file',
|
parser.add_argument('--hex-file',
|
||||||
metavar='FILE',
|
metavar='FILE',
|
||||||
action=(partial(depr_action, cls=cls, replacement='-f/--file') if caps.file else None),
|
action=(partial(depr_action, cls=cls,
|
||||||
help='path to zephyr.hex' if not caps.file else 'Deprecated, use -f/--file instead.')
|
replacement='-f/--file') if caps.file else None),
|
||||||
|
help='path to zephyr.hex'
|
||||||
|
if not caps.file else 'Deprecated, use -f/--file instead.')
|
||||||
parser.add_argument('--bin-file',
|
parser.add_argument('--bin-file',
|
||||||
metavar='FILE',
|
metavar='FILE',
|
||||||
action=(partial(depr_action, cls=cls, replacement='-f/--file') if caps.file else None),
|
action=(partial(depr_action, cls=cls,
|
||||||
help='path to zephyr.bin' if not caps.file else 'Deprecated, use -f/--file instead.')
|
replacement='-f/--file') if caps.file else None),
|
||||||
|
help='path to zephyr.bin'
|
||||||
|
if not caps.file else 'Deprecated, use -f/--file instead.')
|
||||||
|
|
||||||
parser.add_argument('--erase', '--no-erase', nargs=0,
|
parser.add_argument('--erase', '--no-erase', nargs=0,
|
||||||
action=_ToggleAction,
|
action=_ToggleAction,
|
||||||
|
@ -611,7 +617,8 @@ class ZephyrBinaryRunner(abc.ABC):
|
||||||
if caps.rtt:
|
if caps.rtt:
|
||||||
parser.add_argument('--rtt-address', dest='rtt_address',
|
parser.add_argument('--rtt-address', dest='rtt_address',
|
||||||
type=lambda x: int(x, 0),
|
type=lambda x: int(x, 0),
|
||||||
help="address of RTT control block. If not supplied, it will be autodetected if possible")
|
help="""address of RTT control block. If not supplied,
|
||||||
|
it will be autodetected if possible""")
|
||||||
else:
|
else:
|
||||||
parser.add_argument('--rtt-address', help=argparse.SUPPRESS)
|
parser.add_argument('--rtt-address', help=argparse.SUPPRESS)
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,9 @@ class EzFlashCliBinaryRunner(ZephyrBinaryRunner):
|
||||||
self.check_call([self.tool] + options + ["image_flash", self.bin_])
|
self.check_call([self.tool] + options + ["image_flash", self.bin_])
|
||||||
else:
|
else:
|
||||||
load_offset = self.build_conf['CONFIG_FLASH_LOAD_OFFSET']
|
load_offset = self.build_conf['CONFIG_FLASH_LOAD_OFFSET']
|
||||||
self.check_call([self.tool] + options + ["write_flash", f'0x{load_offset:x}', self.bin_])
|
self.check_call(
|
||||||
|
[self.tool] + options + ["write_flash", f'0x{load_offset:x}', self.bin_]
|
||||||
|
)
|
||||||
|
|
||||||
def reset_device(self):
|
def reset_device(self):
|
||||||
self.logger.info("Resetting...")
|
self.logger.info("Resetting...")
|
||||||
|
|
|
@ -62,7 +62,8 @@ class IntelAdspBinaryRunner(ZephyrBinaryRunner):
|
||||||
|
|
||||||
for old_sign_param in [ '--rimage-tool', '--config-dir', '--default-key', '--key']:
|
for old_sign_param in [ '--rimage-tool', '--config-dir', '--default-key', '--key']:
|
||||||
parser.add_argument(old_sign_param, action=SignParamError,
|
parser.add_argument(old_sign_param, action=SignParamError,
|
||||||
help='do not use, "west sign" is now called from CMake, see "west sign -h"')
|
help='''do not use, "west sign" is now called from CMake,
|
||||||
|
see "west sign -h"''')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tool_opt_help(cls) -> str:
|
def tool_opt_help(cls) -> str:
|
||||||
|
|
|
@ -106,7 +106,8 @@ class IntelCycloneVBinaryRunner(ZephyrBinaryRunner):
|
||||||
help='''if given, override default config file;
|
help='''if given, override default config file;
|
||||||
may be given multiple times''')
|
may be given multiple times''')
|
||||||
parser.add_argument('--serial', default="",
|
parser.add_argument('--serial', default="",
|
||||||
help='if given, selects FTDI instance by its serial number, defaults to empty')
|
help='''if given, selects FTDI instance by its serial number,
|
||||||
|
defaults to empty''')
|
||||||
parser.add_argument('--use-elf', default=False, action='store_true',
|
parser.add_argument('--use-elf', default=False, action='store_true',
|
||||||
help='if given, Elf file will be used for loading instead of HEX image')
|
help='if given, Elf file will be used for loading instead of HEX image')
|
||||||
# Options for flashing:
|
# Options for flashing:
|
||||||
|
@ -239,11 +240,12 @@ class IntelCycloneVBinaryRunner(ZephyrBinaryRunner):
|
||||||
server_cmd = (self.openocd_cmd + self.serial + self.cfg_cmd + #added mevalver
|
server_cmd = (self.openocd_cmd + self.serial + self.cfg_cmd + #added mevalver
|
||||||
pre_init_cmd)
|
pre_init_cmd)
|
||||||
temp_str = '--cd=' + os.environ.get('ZEPHYR_BASE') #Go to Zephyr base Dir
|
temp_str = '--cd=' + os.environ.get('ZEPHYR_BASE') #Go to Zephyr base Dir
|
||||||
|
# Execute First Script in Zephyr Base Dir
|
||||||
gdb_cmd = (self.gdb_cmd + self.tui_arg +
|
gdb_cmd = (self.gdb_cmd + self.tui_arg +
|
||||||
[temp_str,'-ex', f'target extended-remote localhost:{self.gdb_port}' , '-batch']) #Execute First Script in Zephyr Base Dir
|
[temp_str,'-ex', f'target extended-remote localhost:{self.gdb_port}' , '-batch'])
|
||||||
|
# Execute Second Script in Build Dir
|
||||||
gdb_cmd2 = (self.gdb_cmd + self.tui_arg +
|
gdb_cmd2 = (self.gdb_cmd + self.tui_arg +
|
||||||
['-ex', f'target extended-remote localhost:{self.gdb_port}' , '-batch']) #Execute Second Script in Build Dir
|
['-ex', f'target extended-remote localhost:{self.gdb_port}' , '-batch'])
|
||||||
echo = ['echo']
|
echo = ['echo']
|
||||||
if self.gdb_init is not None:
|
if self.gdb_init is not None:
|
||||||
for i in self.gdb_init:
|
for i in self.gdb_init:
|
||||||
|
@ -300,11 +302,13 @@ class IntelCycloneVBinaryRunner(ZephyrBinaryRunner):
|
||||||
|
|
||||||
temp_str = '--cd=' + os.environ.get('ZEPHYR_BASE') #Go to Zephyr base Dir
|
temp_str = '--cd=' + os.environ.get('ZEPHYR_BASE') #Go to Zephyr base Dir
|
||||||
|
|
||||||
|
# Execute First Script in Zephyr Base Dir
|
||||||
gdb_cmd = (self.gdb_cmd + self.tui_arg +
|
gdb_cmd = (self.gdb_cmd + self.tui_arg +
|
||||||
[temp_str,'-ex', f'target extended-remote localhost:{self.gdb_port}' , '-batch']) #Execute First Script in Zephyr Base Dir
|
[temp_str,'-ex', f'target extended-remote localhost:{self.gdb_port}' , '-batch'])
|
||||||
|
|
||||||
|
# Execute Second Script in Build Dir
|
||||||
gdb_cmd2 = (self.gdb_cmd + self.tui_arg +
|
gdb_cmd2 = (self.gdb_cmd + self.tui_arg +
|
||||||
['-ex', f'target extended-remote :{self.gdb_port}' , '-batch']) #Execute Second Script in Build Dir
|
['-ex', f'target extended-remote :{self.gdb_port}' , '-batch'])
|
||||||
|
|
||||||
|
|
||||||
if self.gdb_init is not None:
|
if self.gdb_init is not None:
|
||||||
|
|
|
@ -253,21 +253,25 @@ class JLinkBinaryRunner(ZephyrBinaryRunner):
|
||||||
'RTOSPlugin_Zephyr')
|
'RTOSPlugin_Zephyr')
|
||||||
big_endian = self.build_conf.getboolean('CONFIG_BIG_ENDIAN')
|
big_endian = self.build_conf.getboolean('CONFIG_BIG_ENDIAN')
|
||||||
|
|
||||||
server_cmd = ([self.gdbserver] +
|
server_cmd = (
|
||||||
['-select',
|
[self.gdbserver]
|
||||||
('ip' if (is_ip(self.dev_id) or is_tunnel(self.dev_id)) else 'usb') +
|
+ [
|
||||||
(f'={self.dev_id}' if self.dev_id else ''),
|
'-select',
|
||||||
'-port', str(self.gdb_port),
|
('ip' if (is_ip(self.dev_id) or is_tunnel(self.dev_id)) else 'usb')
|
||||||
'-if', self.iface,
|
+ (f'={self.dev_id}' if self.dev_id else ''),
|
||||||
'-speed', self.speed,
|
]
|
||||||
'-device', self.device,
|
+ ['-port', str(self.gdb_port)]
|
||||||
'-silent',
|
+ ['-if', self.iface]
|
||||||
'-endian', 'big' if big_endian else 'little',
|
+ ['-speed', self.speed]
|
||||||
'-singlerun'] +
|
+ ['-device', self.device]
|
||||||
(['-nogui'] if self.supports_nogui else []) +
|
+ ['-silent']
|
||||||
(['-rtos', plugin_dir] if rtos else []) +
|
+ ['-endian' 'big' if big_endian else 'little']
|
||||||
['-rtttelnetport', str(self.rtt_port)] +
|
+ ['-singlerun']
|
||||||
self.tool_opt)
|
+ (['-nogui'] if self.supports_nogui else [])
|
||||||
|
+ (['-rtos', plugin_dir] if rtos else [])
|
||||||
|
+ ['-rtttelnetport', str(self.rtt_port)]
|
||||||
|
+ self.tool_opt
|
||||||
|
)
|
||||||
|
|
||||||
if command == 'flash':
|
if command == 'flash':
|
||||||
self.flash(**kwargs)
|
self.flash(**kwargs)
|
||||||
|
@ -412,15 +416,21 @@ class JLinkBinaryRunner(ZephyrBinaryRunner):
|
||||||
if self.supports_loader and self.loader:
|
if self.supports_loader and self.loader:
|
||||||
loader_details = "?" + self.loader
|
loader_details = "?" + self.loader
|
||||||
|
|
||||||
cmd = ([self.commander] +
|
cmd = (
|
||||||
(['-IP', f'{self.dev_id}'] if (is_ip(self.dev_id) or is_tunnel(self.dev_id)) else (['-USB', f'{self.dev_id}'] if self.dev_id else [])) +
|
[self.commander]
|
||||||
(['-nogui', '1'] if self.supports_nogui else []) +
|
+ (
|
||||||
['-if', self.iface,
|
['-IP', f'{self.dev_id}']
|
||||||
'-speed', self.speed,
|
if (is_ip(self.dev_id) or is_tunnel(self.dev_id))
|
||||||
'-device', self.device + loader_details,
|
else (['-USB', f'{self.dev_id}'] if self.dev_id else [])
|
||||||
'-CommanderScript', fname] +
|
)
|
||||||
(['-nogui', '1'] if self.supports_nogui else []) +
|
+ (['-nogui', '1'] if self.supports_nogui else [])
|
||||||
self.tool_opt)
|
+ ['-if', self.iface]
|
||||||
|
+ ['-speed', self.speed]
|
||||||
|
+ ['-device', self.device + loader_details]
|
||||||
|
+ ['-CommanderScript', fname]
|
||||||
|
+ (['-nogui', '1'] if self.supports_nogui else [])
|
||||||
|
+ self.tool_opt
|
||||||
|
)
|
||||||
|
|
||||||
self.logger.info(f'Flashing file: {flash_file}')
|
self.logger.info(f'Flashing file: {flash_file}')
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
|
|
|
@ -89,12 +89,13 @@ class LinkServerBinaryRunner(ZephyrBinaryRunner):
|
||||||
{DEFAULT_LINKSERVER_EXE}''')
|
{DEFAULT_LINKSERVER_EXE}''')
|
||||||
# user may need to override settings.
|
# user may need to override settings.
|
||||||
parser.add_argument('--override', required=False, action='append',
|
parser.add_argument('--override', required=False, action='append',
|
||||||
help='''configuration overrides as defined bylinkserver. Example: /device/memory/0/location=0xcafecafe''')
|
help='''configuration overrides as defined bylinkserver.
|
||||||
|
Example: /device/memory/0/location=0xcafecafe''')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def do_create(cls, cfg, args):
|
def do_create(cls, cfg, args):
|
||||||
|
|
||||||
print("RUNNER - gdb_port = " + str(args.gdb_port) + ", semih port = " + str(args.semihost_port))
|
print(f"RUNNER - gdb_port = {args.gdb_port}, semih port = {args.semihost_port}")
|
||||||
return LinkServerBinaryRunner(cfg, args.device, args.core,
|
return LinkServerBinaryRunner(cfg, args.device, args.core,
|
||||||
linkserver=args.linkserver,
|
linkserver=args.linkserver,
|
||||||
dt_flash=args.dt_flash,
|
dt_flash=args.dt_flash,
|
||||||
|
@ -180,8 +181,12 @@ class LinkServerBinaryRunner(ZephyrBinaryRunner):
|
||||||
return override_cli
|
return override_cli
|
||||||
|
|
||||||
def flash(self, **kwargs):
|
def flash(self, **kwargs):
|
||||||
|
linkserver_cmd = (
|
||||||
linkserver_cmd = ([self.linkserver, "flash"] + ["--probe", str(self.probe)] + self.override_cli + [self.device])
|
[self.linkserver, "flash"]
|
||||||
|
+ ["--probe", str(self.probe)]
|
||||||
|
+ self.override_cli
|
||||||
|
+ [self.device]
|
||||||
|
)
|
||||||
self.logger.debug(f'LinkServer cmd: + {linkserver_cmd}')
|
self.logger.debug(f'LinkServer cmd: + {linkserver_cmd}')
|
||||||
|
|
||||||
if self.erase:
|
if self.erase:
|
||||||
|
|
|
@ -34,11 +34,14 @@ def is_flash_cmd_need_exit_immediately(mdb_runner):
|
||||||
|
|
||||||
def smp_core_order(mdb_runner, id):
|
def smp_core_order(mdb_runner, id):
|
||||||
if is_simulation_run(mdb_runner):
|
if is_simulation_run(mdb_runner):
|
||||||
# for simulation targets we start cores in direct order (core 0 first, core 1 second, etc...)
|
# for simulation targets we start cores in direct order
|
||||||
# otherwise we face mismatch arcnum (code ID) with ARConnect ID and core ID in instruction traces
|
# (core 0 first, core 1 second, etc...)
|
||||||
|
# otherwise we face mismatch arcnum (code ID) with ARConnect ID
|
||||||
|
# and core ID in instruction traces
|
||||||
return id
|
return id
|
||||||
else:
|
else:
|
||||||
# for HW targets we want to start the primary core last, to avoid ARConnect initialization interfere
|
# for HW targets we want to start the primary core last,
|
||||||
|
# to avoid ARConnect initialization interfere
|
||||||
# with secondary cores startup - so we reverse start order
|
# with secondary cores startup - so we reverse start order
|
||||||
return mdb_runner.cores - 1 - id
|
return mdb_runner.cores - 1 - id
|
||||||
|
|
||||||
|
@ -91,7 +94,7 @@ def mdb_do_run(mdb_runner, command):
|
||||||
mdb_sub_cmd += ['-prop=download=2']
|
mdb_sub_cmd += ['-prop=download=2']
|
||||||
mdb_sub_cmd += mdb_basic_options + mdb_target + [mdb_runner.elf_name]
|
mdb_sub_cmd += mdb_basic_options + mdb_target + [mdb_runner.elf_name]
|
||||||
mdb_runner.check_call(mdb_sub_cmd, cwd=mdb_runner.build_dir)
|
mdb_runner.check_call(mdb_sub_cmd, cwd=mdb_runner.build_dir)
|
||||||
mdb_multifiles += ('core{}' if i == 0 else ',core{}').format(smp_core_order(mdb_runner, i))
|
mdb_multifiles += f'{"" if i == 0 else ","}core{smp_core_order(mdb_runner, i)}'
|
||||||
|
|
||||||
# to enable multi-core aware mode for use with the MetaWare debugger,
|
# to enable multi-core aware mode for use with the MetaWare debugger,
|
||||||
# need to set the NSIM_MULTICORE environment variable to a non-zero value
|
# need to set the NSIM_MULTICORE environment variable to a non-zero value
|
||||||
|
|
|
@ -334,8 +334,11 @@ class NrfBinaryRunner(ZephyrBinaryRunner):
|
||||||
|
|
||||||
# Manage SUIT artifacts.
|
# Manage SUIT artifacts.
|
||||||
# This logic should be executed only once per build.
|
# This logic should be executed only once per build.
|
||||||
# Use sysbuild board qualifiers to select the context, with which the artifacts will be programmed.
|
# Use sysbuild board qualifiers to select the context,
|
||||||
if self.build_conf.get('CONFIG_BOARD_QUALIFIERS') == self.sysbuild_conf.get('SB_CONFIG_BOARD_QUALIFIERS'):
|
# with which the artifacts will be programmed.
|
||||||
|
if self.build_conf.get('CONFIG_BOARD_QUALIFIERS') == self.sysbuild_conf.get(
|
||||||
|
'SB_CONFIG_BOARD_QUALIFIERS'
|
||||||
|
):
|
||||||
mpi_hex_dir = Path(os.path.join(self.cfg.build_dir, 'zephyr'))
|
mpi_hex_dir = Path(os.path.join(self.cfg.build_dir, 'zephyr'))
|
||||||
|
|
||||||
# Handle Manifest Provisioning Information
|
# Handle Manifest Provisioning Information
|
||||||
|
@ -343,17 +346,37 @@ class NrfBinaryRunner(ZephyrBinaryRunner):
|
||||||
app_mpi_hex_file = os.fspath(
|
app_mpi_hex_file = os.fspath(
|
||||||
mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_APP_AREA_PATH'))
|
mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_APP_AREA_PATH'))
|
||||||
rad_mpi_hex_file = os.fspath(
|
rad_mpi_hex_file = os.fspath(
|
||||||
mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_RAD_AREA_PATH'))
|
mpi_hex_dir / self.build_conf.get('CONFIG_SUIT_MPI_RAD_AREA_PATH')
|
||||||
self.op_program(app_mpi_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_APPLICATION')
|
)
|
||||||
self.op_program(rad_mpi_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_NETWORK')
|
self.op_program(
|
||||||
|
app_mpi_hex_file,
|
||||||
|
'ERASE_NONE',
|
||||||
|
None,
|
||||||
|
defer=True,
|
||||||
|
core='NRFDL_DEVICE_CORE_APPLICATION',
|
||||||
|
)
|
||||||
|
self.op_program(
|
||||||
|
rad_mpi_hex_file,
|
||||||
|
'ERASE_NONE',
|
||||||
|
None,
|
||||||
|
defer=True,
|
||||||
|
core='NRFDL_DEVICE_CORE_NETWORK',
|
||||||
|
)
|
||||||
|
|
||||||
# Handle SUIT root manifest if application manifests are not used.
|
# Handle SUIT root manifest if application manifests are not used.
|
||||||
# If an application firmware is built, the root envelope is merged with other application manifests
|
# If an application firmware is built, the root envelope is merged
|
||||||
# as well as the output HEX file.
|
# with other application manifests as well as the output HEX file.
|
||||||
if not cpuapp and self.sysbuild_conf.get('SB_CONFIG_SUIT_ENVELOPE'):
|
if not cpuapp and self.sysbuild_conf.get('SB_CONFIG_SUIT_ENVELOPE'):
|
||||||
app_root_envelope_hex_file = os.fspath(
|
app_root_envelope_hex_file = os.fspath(
|
||||||
mpi_hex_dir / 'suit_installed_envelopes_application_merged.hex')
|
mpi_hex_dir / 'suit_installed_envelopes_application_merged.hex'
|
||||||
self.op_program(app_root_envelope_hex_file, 'ERASE_NONE', None, defer=True, core='NRFDL_DEVICE_CORE_APPLICATION')
|
)
|
||||||
|
self.op_program(
|
||||||
|
app_root_envelope_hex_file,
|
||||||
|
'ERASE_NONE',
|
||||||
|
None,
|
||||||
|
defer=True,
|
||||||
|
core='NRFDL_DEVICE_CORE_APPLICATION',
|
||||||
|
)
|
||||||
|
|
||||||
if not self.erase and generated_uicr:
|
if not self.erase and generated_uicr:
|
||||||
self.exec_op('erase', core=core, option={'chip_erase_mode': 'ERASE_UICR',
|
self.exec_op('erase', core=core, option={'chip_erase_mode': 'ERASE_UICR',
|
||||||
|
|
|
@ -128,7 +128,8 @@ class OpenOcdBinaryRunner(ZephyrBinaryRunner):
|
||||||
help='''if given, override default config file;
|
help='''if given, override default config file;
|
||||||
may be given multiple times''')
|
may be given multiple times''')
|
||||||
parser.add_argument('--serial', default="",
|
parser.add_argument('--serial', default="",
|
||||||
help='if given, selects FTDI instance by its serial number, defaults to empty')
|
help='''if given, selects FTDI instance by its serial number,
|
||||||
|
defaults to empty''')
|
||||||
parser.add_argument('--use-elf', default=False, action='store_true',
|
parser.add_argument('--use-elf', default=False, action='store_true',
|
||||||
help='if given, Elf file will be used for loading instead of HEX image')
|
help='if given, Elf file will be used for loading instead of HEX image')
|
||||||
# Options for flashing:
|
# Options for flashing:
|
||||||
|
|
|
@ -159,7 +159,8 @@ class PyOcdBinaryRunner(ZephyrBinaryRunner):
|
||||||
fname = self.elf_name
|
fname = self.elf_name
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f'Cannot flash; no hex ({self.hex_name}), bin ({self.bin_name}) or elf ({self.elf_name}) files found. ')
|
f'Cannot flash; no hex ({self.hex_name}), bin ({self.bin_name}) '
|
||||||
|
f'or elf ({self.elf_name}) files found. ')
|
||||||
|
|
||||||
erase_method = 'chip' if self.erase else 'sector'
|
erase_method = 'chip' if self.erase else 'sector'
|
||||||
|
|
||||||
|
|
|
@ -60,5 +60,6 @@ class RenodeRobotRunner(ZephyrBinaryRunner):
|
||||||
for suite in self.testsuite:
|
for suite in self.testsuite:
|
||||||
cmd.append(suite)
|
cmd.append(suite)
|
||||||
else:
|
else:
|
||||||
self.logger.error("No Robot testsuite passed to renode-test! Use the `--testsuite` argument to provide one.")
|
self.logger.error("No Robot testsuite passed to renode-test! "
|
||||||
|
"Use the `--testsuite` argument to provide one.")
|
||||||
subprocess.run(cmd, check=True)
|
subprocess.run(cmd, check=True)
|
||||||
|
|
|
@ -31,7 +31,8 @@ class RenodeRunner(ZephyrBinaryRunner):
|
||||||
parser.add_argument('--renode-arg',
|
parser.add_argument('--renode-arg',
|
||||||
metavar='ARG',
|
metavar='ARG',
|
||||||
action='append',
|
action='append',
|
||||||
help='additional argument passed to Renode; `--help` will print all possible arguments')
|
help='''additional argument passed to Renode;
|
||||||
|
`--help` will print all possible arguments''')
|
||||||
parser.add_argument('--renode-command',
|
parser.add_argument('--renode-command',
|
||||||
metavar='COMMAND',
|
metavar='COMMAND',
|
||||||
action='append',
|
action='append',
|
||||||
|
|
|
@ -119,7 +119,8 @@ class SiLabsCommanderBinaryRunner(ZephyrBinaryRunner):
|
||||||
flash_file = self.bin_name
|
flash_file = self.bin_name
|
||||||
flash_args = ['--binary', '--address', f'0x{flash_addr:x}', flash_file]
|
flash_args = ['--binary', '--address', f'0x{flash_addr:x}', flash_file]
|
||||||
else:
|
else:
|
||||||
raise ValueError(f'Cannot flash; no hex ({self.hex_name}) or bin ({self.bin_name}) files found.')
|
raise ValueError(f'Cannot flash; no hex ({self.hex_name}) or '
|
||||||
|
f'bin ({self.bin_name}) files found.')
|
||||||
|
|
||||||
args = [self.commander, 'flash'] + opts + self.tool_opt + flash_args
|
args = [self.commander, 'flash'] + opts + self.tool_opt + flash_args
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,8 @@ class SpiBurnBinaryRunner(ZephyrBinaryRunner):
|
||||||
help='ICEman connection establishing timeout in seconds')
|
help='ICEman connection establishing timeout in seconds')
|
||||||
parser.add_argument('--telink-tools-path', help='path to Telink flash tools')
|
parser.add_argument('--telink-tools-path', help='path to Telink flash tools')
|
||||||
parser.add_argument('--gdb-port', default='1111', help='Port to connect for gdb-client')
|
parser.add_argument('--gdb-port', default='1111', help='Port to connect for gdb-client')
|
||||||
parser.add_argument('--gdb-ex', default='', nargs='?', help='Additional gdb commands to run')
|
parser.add_argument('--gdb-ex', default='', nargs='?',
|
||||||
|
help='Additional gdb commands to run')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def do_create(cls, cfg, args):
|
def do_create(cls, cfg, args):
|
||||||
|
@ -49,18 +50,23 @@ class SpiBurnBinaryRunner(ZephyrBinaryRunner):
|
||||||
spiburn = f'{args.telink_tools_path}/flash/bin/SPI_burn'
|
spiburn = f'{args.telink_tools_path}/flash/bin/SPI_burn'
|
||||||
iceman = f'{args.telink_tools_path}/ice/ICEman'
|
iceman = f'{args.telink_tools_path}/ice/ICEman'
|
||||||
else:
|
else:
|
||||||
# If telink_tools_path arg is not specified then pass to tools shall be specified in PATH
|
# If telink_tools_path arg is not specified then
|
||||||
|
# pass to tools shall be specified in PATH
|
||||||
spiburn = 'SPI_burn'
|
spiburn = 'SPI_burn'
|
||||||
iceman = 'ICEman'
|
iceman = 'ICEman'
|
||||||
|
|
||||||
# Get flash address offset
|
# Get flash address offset
|
||||||
if args.dt_flash == 'y':
|
if args.dt_flash == 'y':
|
||||||
build_conf = BuildConfiguration(cfg.build_dir)
|
build_conf = BuildConfiguration(cfg.build_dir)
|
||||||
address = hex(cls.get_flash_address(args, build_conf) - build_conf['CONFIG_FLASH_BASE_ADDRESS'])
|
address = hex(
|
||||||
|
cls.get_flash_address(args, build_conf) - build_conf['CONFIG_FLASH_BASE_ADDRESS']
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
address = args.addr
|
address = args.addr
|
||||||
|
|
||||||
return SpiBurnBinaryRunner(cfg, address, spiburn, iceman, args.timeout, args.gdb_port, args.gdb_ex, args.erase)
|
return SpiBurnBinaryRunner(
|
||||||
|
cfg, address, spiburn, iceman, args.timeout, args.gdb_port, args.gdb_ex, args.erase
|
||||||
|
)
|
||||||
|
|
||||||
def do_run(self, command, **kwargs):
|
def do_run(self, command, **kwargs):
|
||||||
|
|
||||||
|
@ -128,7 +134,12 @@ class SpiBurnBinaryRunner(ZephyrBinaryRunner):
|
||||||
gdb_ex = re.split("(-ex) ", self.gdb_ex)[1::]
|
gdb_ex = re.split("(-ex) ", self.gdb_ex)[1::]
|
||||||
|
|
||||||
# Compose gdb command
|
# Compose gdb command
|
||||||
client_cmd = [self.cfg.gdb, self.cfg.elf_file, '-ex', f'target remote :{self.gdb_port}'] + gdb_ex
|
client_cmd = [
|
||||||
|
self.cfg.gdb,
|
||||||
|
self.cfg.elf_file,
|
||||||
|
'-ex',
|
||||||
|
f'target remote :{self.gdb_port}',
|
||||||
|
] + gdb_ex
|
||||||
|
|
||||||
# Run gdb
|
# Run gdb
|
||||||
self.run_client(client_cmd)
|
self.run_client(client_cmd)
|
||||||
|
|
|
@ -53,7 +53,10 @@ class STM32CubeProgrammerBinaryRunner(ZephyrBinaryRunner):
|
||||||
self._erase = erase
|
self._erase = erase
|
||||||
|
|
||||||
if extload:
|
if extload:
|
||||||
p = STM32CubeProgrammerBinaryRunner._get_stm32cubeprogrammer_path().parent.resolve() / 'ExternalLoader'
|
p = (
|
||||||
|
STM32CubeProgrammerBinaryRunner._get_stm32cubeprogrammer_path().parent.resolve()
|
||||||
|
/ 'ExternalLoader'
|
||||||
|
)
|
||||||
self._extload = ['-el', str(p / extload)]
|
self._extload = ['-el', str(p / extload)]
|
||||||
else:
|
else:
|
||||||
self._extload = []
|
self._extload = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue