|
| 1 | +.. _ug_nrf54h20_ppr: |
| 2 | + |
| 3 | +Working with the PPR core |
| 4 | +######################### |
| 5 | + |
| 6 | +.. contents:: |
| 7 | + :local: |
| 8 | + :depth: 2 |
| 9 | + |
| 10 | +The nRF54H20 SoC includes a dedicated VPR CPU, based on RISC-V architecture, known as the *Peripheral Processor* (PPR). |
| 11 | + |
| 12 | +.. _vpr_ppr_nrf54h20_initiating: |
| 13 | + |
| 14 | +Using Zephyr multithreaded mode on PPR |
| 15 | +************************************** |
| 16 | + |
| 17 | +The PPR core can operate as a general-purpose core, running under the full Zephyr kernel. |
| 18 | +Building the PPR target is similar to building the application core, but the application core build must include an overlay that enables the PPR core. |
| 19 | + |
| 20 | +Bootstrapping the PPR core |
| 21 | +========================== |
| 22 | + |
| 23 | +The |NCS| provides a PPR snippet that adds the overlay needed for bootstrapping the PPR core. |
| 24 | +The primary purpose of this snippet is to enable the transfer of the PPR code to the designated memory region (if required) and to initiate the PPR core. |
| 25 | + |
| 26 | +When building for the ``nrf54h20dk/nrf54h20/cpuppr`` target, a minimal sample is automatically loaded onto the application core. |
| 27 | +For more details, see :ref:`building_nrf54h_app_ppr_core`. |
| 28 | + |
| 29 | +Memory allocation |
| 30 | +***************** |
| 31 | + |
| 32 | +Running the PPR CPU can lead to increased latency when accessing ``RAM_30``. |
| 33 | +To mitigate this, use ``RAM_30`` exclusively for PPR code, PPR data, and non-time-sensitive data from the application CPU. |
| 34 | +If both ``RAM_30`` and ``RAM_31`` are available, prefer using ``RAM_31`` to avoid memory access latency caused by the PPR. |
| 35 | +For data that requires strict access times, such as CPU data used in low-latency Interrupt Service Routines (ISRs), use local RAM, or ``RAM_0x`` when higher latency is acceptable. |
| 36 | +Place the DMA buffers in a memory designed to a given peripheral. |
| 37 | + |
| 38 | +Building and programming with the nRF54H20 DK |
| 39 | +********************************************* |
| 40 | + |
| 41 | +Depending on the sample, you might need to program only the application core or both the PPR and application cores. |
| 42 | +Additionally, the process varies depending on whether you are working with a single-image or multi-image build. |
| 43 | + |
| 44 | +.. note:: |
| 45 | + The following instructions do not cover the scenario of multi-image single-core builds. |
| 46 | + |
| 47 | +Building for the application core only |
| 48 | +====================================== |
| 49 | + |
| 50 | +Building for the application core follows the default building process for the |NCS|. |
| 51 | +For detailed instructions, refer to the :ref:`building` page. |
| 52 | + |
| 53 | +.. _building_nrf54h_app_ppr_core: |
| 54 | + |
| 55 | +Building for both the application and PPR core |
| 56 | +=============================================== |
| 57 | + |
| 58 | +Building for both the application core and the PPR core differs from the default |NCS| procedure. |
| 59 | +Additional configuration is required to enable the PPR core. |
| 60 | + |
| 61 | +This section explains how to build and program both cores, covering separate builds and sysbuild configurations. |
| 62 | +The PPR core supports two variants: |
| 63 | + |
| 64 | +* ``nrf54h20dk/nrf54h20/cpuppr``: PPR runs from ``RAM_30`` (recommended method). |
| 65 | + The application core image must include the ``nordic-ppr`` :ref:`snippet <app_build_snippets>`. |
| 66 | + |
| 67 | +* ``nrf54h20dk/nrf54h20/cpuppr/xip``: PPR runs from MRAM. |
| 68 | + The application core image must include the ``nordic-ppr-xip`` snippet. |
| 69 | + |
| 70 | +Standard build |
| 71 | +-------------- |
| 72 | + |
| 73 | +This section explains how to build an application using :ref:`sysbuild <configuration_system_overview_sysbuild>`. |
| 74 | + |
| 75 | +.. note:: |
| 76 | + Currently, the documentation does not provide specific instructions for building an application image using sysbuild to incorporate the PPR core as a sub-image. |
| 77 | + The only documented scenario involves building the PPR as the main image and the application as a sub-image. |
| 78 | + |
| 79 | +To complete the build, do the following: |
| 80 | + |
| 81 | +.. tabs:: |
| 82 | + |
| 83 | + .. group-tab:: Using minimal sample for VPR bootstrapping |
| 84 | + |
| 85 | + This option automatically programs the PPR core with :ref:`dedicated bootstrapping firmware <vpr_ppr_nrf54h20_initiating>`. |
| 86 | + |
| 87 | + To build and flash both images, run the following command to perform a :ref:`pristine build <zephyr:west-building>`: |
| 88 | + |
| 89 | + .. code-block:: console |
| 90 | +
|
| 91 | + west build -p -b nrf54h20dk/nrf54h20/cpuppr |
| 92 | + west flash |
| 93 | +
|
| 94 | + .. group-tab:: Using an application that supports multi-image builds |
| 95 | + |
| 96 | + If your application involves creating custom images for both the application core and the PPR core, disable the VPR bootstrapping sample by setting the ``SB_CONFIG_VPR_LAUNCHER`` option to ``n`` when building for the PPR target. |
| 97 | + For more details, see :ref:`how to configure Kconfig <configuring_kconfig>`. |
| 98 | + |
| 99 | + To build and flash both images, run the following command to perform a :ref:`pristine build <zephyr:west-building>`: |
| 100 | + |
| 101 | + .. code-block:: console |
| 102 | +
|
| 103 | + west build -p -b nrf54h20dk/nrf54h20/cpuppr -- -DSB_CONFIG_VPR_LAUNCHER=n |
| 104 | + west flash |
| 105 | +
|
| 106 | +Separate images |
| 107 | +--------------- |
| 108 | + |
| 109 | +You can build and program the application sample and the PPR sample as separate images using either the |nRFVSC| or the command line. |
| 110 | +Refer to `nRF Util`_ documentation for instructions on using nRF Util. |
| 111 | +Depending on the method you select, complete the following steps: |
| 112 | + |
| 113 | +.. tabs:: |
| 114 | + |
| 115 | + .. group-tab:: nRF Connect for VS Code |
| 116 | + |
| 117 | + .. include:: /includes/vsc_build_and_run.txt |
| 118 | + |
| 119 | + 3. Build the application image by configuring the following options: |
| 120 | + |
| 121 | + * Set the Board target to ``nrf54h20dk/nrf54h20/cpuapp``. |
| 122 | + * Select either the ``nordic-ppr`` or ``nordic-ppr-xip`` snippet, depending on the PPR image target. |
| 123 | + * Set System build to :guilabel:`No sysbuild`. |
| 124 | + |
| 125 | + For more information, see :ref:`cmake_options`. |
| 126 | + |
| 127 | + #. Build the PPR image by configuring the following options: |
| 128 | + |
| 129 | + * Set the Board target to ``nrf54h20dk/nrf54h20/cpuppr`` (recommended) or ``nrf54h20dk/nrf54h20/cpuppr/xip``. |
| 130 | + * Set System build to :guilabel:`No sysbuild`. |
| 131 | + |
| 132 | + For more information, see :ref:`cmake_options`. |
| 133 | + |
| 134 | + .. group-tab:: Command Line |
| 135 | + |
| 136 | + 1. |open_terminal_window_with_environment| |
| 137 | + #. Build the application core image, and based on your build target, include the appropriate snippet: |
| 138 | + |
| 139 | + .. code-block:: console |
| 140 | +
|
| 141 | + west build -p -b nrf54h20dk/nrf54h20/cpuapp -S nordic-ppr --no-sysbuild |
| 142 | +
|
| 143 | + #. Program the application core image by running the ``west flash`` command :ref:`without --erase <programming_params_no_erase>`. |
| 144 | + |
| 145 | + .. code-block:: console |
| 146 | +
|
| 147 | + west flash |
| 148 | +
|
| 149 | + #. Build the PPR core image: |
| 150 | + |
| 151 | + .. code-block:: console |
| 152 | +
|
| 153 | + west build -p -b nrf54h20dk/nrf54h20/cpuppr --no-sysbuild |
| 154 | +
|
| 155 | + You can customize the command for additional options by adding :ref:`build parameters <optional_build_parameters>`. |
| 156 | + |
| 157 | + #. Once the PPR core image is successfully built, program it by running the ``west flash`` command :ref:`without --erase <programming_params_no_erase>`. |
| 158 | + |
| 159 | + .. code-block:: console |
| 160 | +
|
| 161 | + west flash |
0 commit comments