Skip to content

Commit d176cc3

Browse files
mbolivar-nordiccarlescufi
authored andcommitted
scripts: runners: update ZephyrBinaryRunner docstring
Fix some things that are incorrect and try to make it more clear. Signed-off-by: Marti Bolivar <[email protected]>
1 parent 6440514 commit d176cc3

File tree

1 file changed

+18
-17
lines changed
  • scripts/west_commands/runners

1 file changed

+18
-17
lines changed

scripts/west_commands/runners/core.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ class ZephyrBinaryRunner(abc.ABC):
268268
(have a breakpoint debugger and program loader on a host
269269
workstation attached to a running target).
270270
271-
This is supported by three top-level commands managed by the
271+
This is supported by four top-level commands managed by the
272272
Zephyr build system:
273273
274274
- 'flash': flash a previously configured binary to the board,
@@ -289,18 +289,19 @@ class ZephyrBinaryRunner(abc.ABC):
289289
the current binary, and block until it exits. Unlike 'debug', this
290290
command does not program the flash.
291291
292-
This class provides an API for these commands. Every runner has a
293-
name (like 'pyocd'), and declares commands it can handle (like
294-
'flash'). Zephyr boards (like 'nrf52_pca10040') declare compatible
295-
runner(s) by name to the build system, which makes concrete runner
296-
instances to execute commands via this class.
292+
This class provides an API for these commands. Every subclass is
293+
called a 'runner' for short. Each runner has a name (like
294+
'pyocd'), and declares commands it can handle (like
295+
'flash'). Boards (like 'nrf52_pca10040') declare which runner(s)
296+
are compatible with them to the Zephyr build system, along with
297+
information on how to configure the runner to work with the board.
297298
298-
If your board can use an existing runner, all you have to do is
299-
give its name to the build system. How to do that is out of the
300-
scope of this documentation, but use the existing boards as a
301-
starting point.
299+
The build system will then place enough information in the build
300+
directory so to create and use runners with this class's create()
301+
method, which provides a command line argument parsing API. You
302+
can also create runners by instantiating subclasses directly.
302303
303-
If you want to define and use your own runner:
304+
In order to define your own runner, you need to:
304305
305306
1. Define a ZephyrBinaryRunner subclass, and implement its
306307
abstract methods. You may need to override capabilities().
@@ -310,19 +311,19 @@ class ZephyrBinaryRunner(abc.ABC):
310311
get_runners() won't work).
311312
312313
3. Give your runner's name to the Zephyr build system in your
313-
board's build files.
314+
board's board.cmake.
314315
315316
For command-line invocation from the Zephyr build system, runners
316317
define their own argparse-based interface through the common
317318
add_parser() (and runner-specific do_add_parser() it delegates
318319
to), and provide a way to create instances of themselves from
319320
a RunnerConfig and parsed runner-specific arguments via create().
320321
321-
Runners use a variety of target-specific tools and configuration
322-
values, the user interface to which is abstracted by this
323-
class. Each runner subclass should take any values it needs to
324-
execute one of these commands in its constructor. The actual
325-
command execution is handled in the run() method.'''
322+
Runners use a variety of host tools and configuration values, the
323+
user interface to which is abstracted by this class. Each runner
324+
subclass should take any values it needs to execute one of these
325+
commands in its constructor. The actual command execution is
326+
handled in the run() method.'''
326327

327328
def __init__(self, cfg):
328329
'''Initialize core runner state.

0 commit comments

Comments
 (0)