Skip to content

Commit 751f3a9

Browse files
pdgendthenrikbrixandersen
authored andcommitted
doc: develop: Add external runners for modules information
Add an example for the `runners` section in the zephyr/module.yml file, and a paragraph to the west "flash and debug runners" section. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 640a8b9 commit 751f3a9

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

doc/develop/modules.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,6 +1050,25 @@ requirement files in the ``scripts`` directory of the module.
10501050
- scripts/requirements-build.txt
10511051
- scripts/requirements-doc.txt
10521052
1053+
1054+
.. _modules-runners:
1055+
1056+
External Runners
1057+
================
1058+
1059+
If a module has out of tree boards that require custom :ref:`runners <west-runner>`,
1060+
then it can add a list to its ``zephyr/module.yml`` file, for example:
1061+
1062+
1063+
.. code-block:: yaml
1064+
1065+
runners:
1066+
- file: scripts/my-runner.py
1067+
1068+
1069+
Each file entry is imported when executing ``west flash`` or ``west debug`` and
1070+
subclasses of the ``ZephyrBinaryRunner`` are registered for use.
1071+
10531072
Module Inclusion
10541073
================
10551074

doc/develop/west/build-flash-debug.rst

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -779,18 +779,26 @@ To view all available options Renode supports, use::
779779

780780
west simulate --runner=renode --renode-help
781781

782+
Out of tree runners
783+
*******************
784+
785+
:ref:`Zephyr modules <modules>` can have external runners discovered by adding python
786+
files in their :ref:`module.yml <modules-runners>`. Create an external runner class by
787+
inheriting from ``ZephyrBinaryRunner`` and implement all abstract methods.
788+
789+
.. note::
790+
791+
Support for custom out-of-tree runners makes the ``runners.core`` module part of
792+
the public API and backwards incompatible changes need to undergo the
793+
:ref:`deprecation process <breaking_api_changes>`.
794+
782795
Hacking
783796
*******
784797

785798
This section documents the ``runners.core`` module used by the
786799
flash and debug commands. This is the core abstraction used to implement
787800
support for these features.
788801

789-
.. warning::
790-
791-
These APIs are provided for reference, but they are more "shared code" used
792-
to implement multiple extension commands than a stable API.
793-
794802
Developers can add support for new ways to flash and debug Zephyr programs by
795803
implementing additional runners. To get this support into upstream Zephyr, the
796804
runner should be added into a new or existing ``runners`` module, and imported

0 commit comments

Comments
 (0)