Lines Matching +full:if +full:- +full:no +full:- +full:files +full:- +full:found

1 # Copyright 2023-2024 NXP
4 # SPDX-License-Identifier: Apache-2.0
18 DEFAULT_LINKSERVER_EXE = 'Linkserver.exe' if sys.platform == 'win32' else 'LinkServer'
23 '''Runner front-end for NXP Linkserver'''
39 self.gdb_cmd = cfg.gdb if cfg.gdb else None
49 self.tui_arg = ['-tui'] if tui else []
50 self.override = override if override else []
54 if tool_opt is not None:
70 parser.add_argument('--device', required=True, help='device name')
72 parser.add_argument('--core', required=False, help='core of the device')
74 parser.add_argument('--probe', default='#1',
77 parser.add_argument('--tui', default=False, action='store_true',
78 help='if given, GDB uses -tui')
80 parser.add_argument('--gdb-port', default=DEFAULT_LINKSERVER_GDB_PORT,
83 parser.add_argument('--semihost-port', default=DEFAULT_LINKSERVER_SEMIHOST_PORT,
87 parser.add_argument('--linkserver', default=DEFAULT_LINKSERVER_EXE,
91 parser.add_argument('--override', required=False, action='append',
98 print(f"RUNNER - gdb_port = {args.gdb_port}, semih port = {args.semihost_port}")
112 if not hasattr(self, '_linkserver_version'):
113 linkserver_version_cmd=[self.linkserver, "-v"]
124 if command == 'flash':
127 if self.core is not None:
128 _cmd_core = [ "-c", self.core ]
134 ["--probe", str(self.probe) ] +
135 ["--gdb-port", str(self.gdb_port )] +
136 ["--semihost-port", str(self.semihost_port) ] +
143 if command in ('debug', 'attach'):
144 if self.elf_name is None or not os.path.isfile(self.elf_name):
150 ['-ex', f'target remote {self.gdb_host}:{self.gdb_port}'])
152 if command == 'debug':
153 gdb_cmd += [ '-ex', 'load', '-ex', 'monitor reset']
155 if command == 'attach':
156 linkserver_cmd += ['--attach']
161 if self.gdb_host:
162 raise ValueError('Cannot run debugserver with --gdb-host')
168 linkserver_cmd = ([self.linkserver, "flash"] + ["--probe", str(self.probe)] +
177 if self.override is not None:
179 override_cli = (override_cli + ["-o", str(ov)])
186 + ["--probe", str(self.probe)]
192 if self.erase:
197 if self.supports_hex() and self.hex_name is not None and os.path.isfile(self.hex_name):
201 if self.dt_flash:
204 self.logger.critical("no load flash address could be found...")
205 raise RuntimeError("no load flash address could be found...")
207 flash_cmd = (["load", "--addr", str(load_addr), self.bin_name])
211 err = 'Cannot flash; no hex ({}), bin ({}) or elf ({}) files found.'
218 if not self.logger.isEnabledFor(logging.DEBUG):
219 if self.linkserver_version_str < "v1.3.15":
227 # v1.5.30 has added flash support for Intel Hex files.