Lines Matching +full:class +full:- +full:rev

4 # SPDX-License-Identifier: Apache-2.0
6 # pylint: disable=duplicate-code
43 class OpenOcdBinaryRunner(ZephyrBinaryRunner):
44 '''Runner front-end for openocd.'''
61 # try to find the board support in-tree
77 search_args.append('-s')
83 search_args.append('-s')
88 search_args.extend(['-s', p])
106 self.tui_arg = ['-tui'] if tui else []
107 self.halt_arg = [] if no_halt else ['-c halt']
108 self.init_arg = [] if no_init else ['-c init']
109 self.targets_arg = [] if no_targets else ['-c targets']
110 self.serial = ['-c set _ZEPHYR_BOARD_SERIAL ' + serial] if serial else []
113 self.load_arg = [] if no_load else ['-ex', 'load']
127 parser.add_argument('--config', action='append',
130 parser.add_argument('--serial', default="",
133 parser.add_argument('--use-elf', default=False, action='store_true',
136 parser.add_argument('--cmd-pre-init', action='append',
139 parser.add_argument('--cmd-reset-halt', default=DEFAULT_OPENOCD_RESET_HALT_CMD,
142 parser.add_argument('--cmd-pre-load', action='append',
145 parser.add_argument('--cmd-load',
148 parser.add_argument('--cmd-verify',
150 parser.add_argument('--cmd-post-verify', action='append',
153 parser.add_argument('--verify', action='store_true',
155 parser.add_argument('--verify-only', action='store_true',
159 parser.add_argument('--tui', default=False, action='store_true',
160 help='if given, GDB uses -tui')
161 parser.add_argument('--tcl-port', default=DEFAULT_OPENOCD_TCL_PORT,
163 parser.add_argument('--telnet-port',
166 parser.add_argument('--gdb-port', default=DEFAULT_OPENOCD_GDB_PORT,
168 parser.add_argument('--gdb-client-port', default=DEFAULT_OPENOCD_GDB_PORT,
171 parser.add_argument('--gdb-init', action='append',
173 parser.add_argument('--no-halt', action='store_true',
175 parser.add_argument('--no-init', action='store_true',
177 parser.add_argument('--no-targets', action='store_true',
179 parser.add_argument('--no-load', action='store_true',
181 parser.add_argument('--target-handle', default=DEFAULT_OPENOCD_TARGET_HANDLE,
185 parser.add_argument('--rtt-port', default=DEFAULT_OPENOCD_RTT_PORT,
222 out = self.check_output([self.openocd_cmd[0], '--version'],
225 version_match = re.search(r"Open On-Chip Debugger (\d+.\d+.\d+)", out)
232 (major, minor, rev) = self.read_version()
233 return (major, minor, rev) > (0, 11, 0)
244 self.cfg_cmd.append('-f')
275 pre_init_cmd.append("-c")
279 pre_load_cmd.append("-c")
283 post_verify_cmd.append("-c")
288 load_image = ['-c', self.reset_halt_cmd,
289 '-c', self.load_cmd + ' ' + hex_name]
293 verify_image = ['-c', self.reset_halt_cmd,
294 '-c', self.verify_cmd + ' ' + hex_name]
301 ['-c', 'reset run',
302 '-c', 'shutdown'])
316 pre_init_cmd.append("-c")
323 pre_load_cmd.append("-c")
325 load_image = ['-c', 'load_image ' + self.elf_name]
330 verify_image = ['-c', 'verify_image ' + self.elf_name]
332 post_verify_cmd.append("-c")
335 prologue = ['-c', 'resume ' + ep_addr,
336 '-c', 'shutdown']
340 pre_load_cmd + ['-c', self.reset_halt_cmd] +
355 pre_init_cmd.append("-c")
359 pre_init_cmd.append("-c")
360 rtos_command = f'${self.target_handle} configure -rtos Zephyr'
364 ['-c', f'tcl_port {self.tcl_port}',
365 '-c', f'telnet_port {self.telnet_port}',
366 '-c', f'gdb_port {self.gdb_port}'] +
370 ['-ex', f'target extended-remote :{self.gdb_client_port}',
376 gdb_cmd.append("-ex")
384 gdb_cmd.extend(['-ex', 'set pagination off'])
387 ['-ex', f'monitor rtt setup 0x{rtt_address:x} 0x10 "SEGGER RTT"'])
388 gdb_cmd.extend(['-ex', 'monitor reset run'])
389 gdb_cmd.extend(['-ex', 'monitor rtt start'])
391 ['-ex', f'monitor rtt server start {self.rtt_port} 0'])
393 gdb_cmd.extend(['-ex', 'detach', '-ex', 'quit'])
420 pre_init_cmd.append("-c")
424 pre_init_cmd.append("-c")
425 rtos_command = f'${self.target_handle} configure -rtos Zephyr'
429 ['-c', f'tcl_port {self.tcl_port}',
430 '-c', f'telnet_port {self.telnet_port}',
431 '-c', f'gdb_port {self.gdb_port}'] +
433 ['-c', self.reset_halt_cmd])