diff --git a/doc/develop/modules.rst b/doc/develop/modules.rst index ff8f3781d45..352edfb963f 100644 --- a/doc/develop/modules.rst +++ b/doc/develop/modules.rst @@ -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 `, +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 ================ diff --git a/doc/develop/west/build-flash-debug.rst b/doc/develop/west/build-flash-debug.rst index c45a4551843..2b7dd3ecd3b 100644 --- a/doc/develop/west/build-flash-debug.rst +++ b/doc/develop/west/build-flash-debug.rst @@ -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 ` can have external runners discovered by adding python +files in their :ref:`module.yml `. 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 `. + 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