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 <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2024-12-19 17:18:22 +01:00 committed by Henrik Brix Andersen
commit 751f3a9c37
2 changed files with 32 additions and 5 deletions

View file

@ -1050,6 +1050,25 @@ requirement files in the ``scripts`` directory of the module.
- scripts/requirements-build.txt
- scripts/requirements-doc.txt
.. _modules-runners:
External Runners
================
If a module has out of tree boards that require custom :ref:`runners <west-runner>`,
then it can add a list to its ``zephyr/module.yml`` file, for example:
.. code-block:: yaml
runners:
- file: scripts/my-runner.py
Each file entry is imported when executing ``west flash`` or ``west debug`` and
subclasses of the ``ZephyrBinaryRunner`` are registered for use.
Module Inclusion
================

View file

@ -779,6 +779,19 @@ To view all available options Renode supports, use::
west simulate --runner=renode --renode-help
Out of tree runners
*******************
:ref:`Zephyr modules <modules>` can have external runners discovered by adding python
files in their :ref:`module.yml <modules-runners>`. Create an external runner class by
inheriting from ``ZephyrBinaryRunner`` and implement all abstract methods.
.. note::
Support for custom out-of-tree runners makes the ``runners.core`` module part of
the public API and backwards incompatible changes need to undergo the
:ref:`deprecation process <breaking_api_changes>`.
Hacking
*******
@ -786,11 +799,6 @@ This section documents the ``runners.core`` module used by the
flash and debug commands. This is the core abstraction used to implement
support for these features.
.. warning::
These APIs are provided for reference, but they are more "shared code" used
to implement multiple extension commands than a stable API.
Developers can add support for new ways to flash and debug Zephyr programs by
implementing additional runners. To get this support into upstream Zephyr, the
runner should be added into a new or existing ``runners`` module, and imported