Skip to content

Commit e9b6728

Browse files
greg-fercarlescufi
authored andcommitted
doc: west: runner allows nrfutil
Added information about the change of west runner for Nordic devices. Edited the programming page, migration guide for 3.0.0, and other affected pages. NCSDK-32305, part 1. Signed-off-by: Grzegorz Ferenc <Grzegorz.Ferenc@nordicsemi.no>
1 parent 4732c22 commit e9b6728

File tree

5 files changed

+95
-1
lines changed

5 files changed

+95
-1
lines changed

doc/nrf/app_dev/device_guides/nrf54h/ug_nrf54h20_gs.rst

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ If you have multiple Nordic Semiconductor devices, ensure that only the nRF54H20
266266
267267
west flash
268268
269+
Make sure you have the :ref:`nrfutil device <ug_nrf54h20_install_toolchain>` command installed for ``west flash`` to work with the nRF54H20 DK.
269270
This command builds and programs the sample automatically on both the application core and the Peripheral Processor (PPR) of the nRF54H20 SoC.
270271

271272
.. include:: /includes/nRF54H20_erase_UICR.txt

doc/nrf/app_dev/programming.rst

+58
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,60 @@ To program the :ref:`output build files <app_build_output_files>` to your device
2121
The flash command programs all cores by default, both in the |nRFVSC| and on the command line.
2222
If you want to program only one selected core, use ``west flash`` on the command line and :ref:`specify the domain <zephyr:west-multi-domain-flashing>`.
2323

24+
.. _programming_selecting_runner:
25+
26+
Selecting west runner
27+
*********************
28+
29+
Starting with the |NCS| v3.0.0, all Nordic Semiconductor :ref:`boards <app_boards>` are using the `nRF Util`_ as the default runner for the ``west flash`` command.
30+
This change ensures that the programming process is consistent across all boards.
31+
See the :ref:`build system section in the v3.0.0 migration guide <migration_3.0_recommended>` for more information.
32+
33+
.. note::
34+
35+
The ``west debug`` command is not affected by this change of the default runner.
36+
37+
Runners are Zephyr-specific Python classes that wrap Zephyr's :ref:`flash and debug host tools <zephyr:flash-debug-host-tools>` and integrate them with west and the Zephyr build system to support ``west flash`` and related commands.
38+
Runners supported on a board are determined by the :file:`board.cmake` file in the board folder, for example `this one <nRF52840 DK board.cmake_>`_.
39+
In particular, the following include lines enable them, with the first ``<runner>`` listed becoming the default runner:
40+
41+
.. code-block:: cmake
42+
43+
include(${ZEPHYR_BASE}/boards/common/<runner>.board.cmake)
44+
45+
For more information about runners, see the Zephyr documentation: :ref:`zephyr:flash-and-debug-support` and :ref:`zephyr:west-flashing`.
46+
47+
If you want to change the runner used by ``west flash``, you can use one of the following options:
48+
49+
* Specify the runner permanently in your application's :file:`CMakeLists.txt` file:
50+
51+
.. code-block::
52+
53+
set(BOARD_FLASH_RUNNER nrfjprog)
54+
55+
* Specify the runner for a single command:
56+
57+
.. code-block::
58+
59+
west flash -r nrfjprog
60+
61+
In either case, make sure you have the required tools installed on your system: `nRF Util`_ for ``-r nrfutil`` or the archived `nRF Command Line Tools`_ for ``-r nrfjprog``.
62+
63+
To see which runners are available for your board, run the following command:
64+
65+
.. code-block::
66+
67+
west flash --context
68+
69+
The output will include lines like the following:
70+
71+
.. code-block::
72+
73+
available runners in runners.yaml:
74+
nrfutil, nrfjprog, jlink, pyocd, openocd
75+
default runner in runners.yaml:
76+
nrfutil
77+
2478
.. _programming_hw:
2579

2680
Hardware-specific programming steps
@@ -35,6 +89,10 @@ Programming to Thingy:91 also requires a :ref:`similar step <building_pgming>`,
3589
Programming the nRF52840 Dongle
3690
To program the nRF52840 Dongle instead of a development kit, follow the programming instructions in :ref:`zephyr:nrf52840dongle_nrf52840` or use the `Programmer app <Programming the nRF52840 Dongle_>`_.
3791

92+
Programming the nRF54H20 DK
93+
To program the nRF54H20 DK, follow the programming instructions in the :ref:`nRF54H20 device guide <ug_nrf54h20_gs_sample>`.
94+
Programming the nRF54H20 DK with the |NCS| version earlier than v3.0.0 requires installing the `nrfutil device command <Installing and upgrading nRF Util commands_>`_ for the ``west flash`` command to work with this device.
95+
3896
.. _programming_params:
3997

4098
Optional programming parameters

doc/nrf/links.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,11 @@
6868
.. _`manifest group filter`: https://github.com/nrfconnect/sdk-nrf/blob/20f40501f69bc9bfd2b321704917da1769411936/west.yml#L42
6969
.. _`Zephyr commit 8dc3f8`: https://github.com/nrfconnect/sdk-zephyr/commit/8dc3f856229ce083c956aa301c31a23e65bd8cd8
7070
.. _`hwmv2 conversion script`: https://github.com/nrfconnect/sdk-zephyr/blob/main/scripts/utils/board_v1_to_v2.py
71-
.. _`ncs-example-application commit f9f2da`: https://github.com/nrfconnect/ncs-example-application/commit/f9f2da24041a7b1923e49893cca912482c138aae
7271
.. _`sdk-zephyr west build patch`: https://github.com/nrfconnect/sdk-zephyr/blob/1a5d3b4a4ff98a33222856526afdf9c089b96d2b/scripts/west_commands/build.py#L585-L598
72+
.. _`nRF52840 DK board.cmake`: https://github.com/nrfconnect/sdk-zephyr/blob/main/boards/nordic/nrf52840dk/board.cmake
73+
74+
.. _`ncs-example-application commit f9f2da`: https://github.com/nrfconnect/ncs-example-application/commit/f9f2da24041a7b1923e49893cca912482c138aae
75+
7376
.. _`sdk-nrf PR #15892`: https://github.com/nrfconnect/sdk-nrf/pull/15892
7477
.. _`sdk-nrf PR #14474`: https://github.com/nrfconnect/sdk-nrf/pull/14474
7578
.. _`sdk-nrf PR #16242`: https://github.com/nrfconnect/sdk-nrf/pull/16242

doc/nrf/releases_and_maturity/migration/migration_guide_3.0.rst

+30
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,36 @@ Recommended changes
5353

5454
The following changes are recommended for your application to work optimally after the migration.
5555

56+
Build system
57+
============
58+
59+
.. toggle::
60+
61+
* The default runner for the ``west flash`` command has been changed to use `nRF Util`_ instead of ``nrfjprog`` that is part of the archived `nRF Command Line Tools`_.
62+
This affects all :ref:`boards <app_boards>` that used ``nrfjprog`` as the west runner backend for programming the following SoCs and SiPs:
63+
64+
* nRF91 Series (including nRF91x1)
65+
* nRF7002
66+
* nRF5340 (including nRF5340 Audio DK)
67+
* Nordic Thingy:53
68+
* nRF52 Series
69+
* nRF21540
70+
71+
This change is made to ensure that the programming process is consistent across all boards and to provide a more robust programming experience.
72+
The ``west flash`` command now uses the ``nrfutil device`` subcommand by default to flash the application to the board.
73+
74+
It is recommended to install nRF Util to avoid potential issues during programming.
75+
Complete the following steps:
76+
77+
1. Follow the steps for `Installing nRF Util`_ in its official documentation.
78+
2. Install the `nrfutil device <Device command overview_>`_ using the following command:
79+
80+
.. code-block::
81+
82+
nrfutil install device
83+
84+
If you prefer to continue using ``nrfjprog`` for programming devices, :ref:`specify the west runner <programming_selecting_runner>` with ``west flash``.
85+
5686
Samples and applications
5787
========================
5888

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Build and configuration system
4949
* Removed support for the deprecated multi-image builds (parent-child images) functionality.
5050
All |NCS| projects must now use :ref:`sysbuild`.
5151
See :ref:`child_parent_to_sysbuild_migration` for an overview of differences with parent-child image and how to migrate.
52+
* Updated the default runner for the ``west flash`` command to `nRF Util`_ instead of ``nrfjprog`` that is part of the archived `nRF Command Line Tools`_.
53+
For more information, see the :ref:`build system section in the v3.0.0 migration guide <migration_3.0_recommended>` and the :ref:`programming_selecting_runner` section on the programming page.
5254

5355
Bootloaders and DFU
5456
===================

0 commit comments

Comments
 (0)