Working with the PPR core
The nRF54H20 SoC includes a dedicated VPR CPU, based on RISC-V architecture, known as the Peripheral Processor (PPR).
Using Zephyr multithreaded mode on PPR
The PPR core can operate as a general-purpose core, running under the full Zephyr kernel. 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. See Assigning peripherals to cores on the nRF54H20 SoC for information on how to assign peripherals to the PPR core.
Bootstrapping the PPR core
The nRF Connect SDK provides a PPR snippet that adds the overlay needed for bootstrapping the PPR core. 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.
When building for the nrf54h20dk/nrf54h20/cpuppr target, a minimal sample is automatically loaded onto the application core.
For more details, see Building for both the application and PPR core.
Memory allocation
Running the PPR CPU can lead to increased latency when accessing RAM_30.
To mitigate this, use RAM_30 exclusively for PPR code, PPR data, and non-time-sensitive data from the application CPU.
If both RAM_30 and RAM_31 are available, prefer using RAM_31 to avoid memory access latency caused by the PPR.
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.
Place the DMA buffers in a memory designed to a given peripheral.
Building and programming with the nRF54H20 DK
Depending on the sample, you might need to program only the application core or both the PPR and application cores. Additionally, the process varies depending on whether you are working with a single-image or multi-image build.
Note
The following instructions do not cover the scenario of multi-image single-core builds.
Building for the application core only
Building for the application core follows the default building process for the nRF Connect SDK. For detailed instructions, refer to the Building an application page.
Building for both the application and PPR core
Building for both the application core and the PPR core differs from the default nRF Connect SDK procedure. Additional configuration is required to enable the PPR core.
This section explains how to build and program both cores, covering separate builds and sysbuild configurations. The PPR core supports two variants:
nrf54h20dk/nrf54h20/cpuppr: PPR runs fromRAM_30(recommended method). The application core image must include thenordic-pprsnippet.nrf54h20dk/nrf54h20/cpuppr/xip: PPR runs from MRAM. The application core image must include thenordic-ppr-xipsnippet.
Standard build
This section explains how to build an application using sysbuild.
Note
Currently, the documentation does not provide specific instructions for building an application image using sysbuild to incorporate the PPR core as a sub-image. The only documented scenario involves building the PPR as the main image and the application as a sub-image.
To complete the build, do the following:
This option automatically programs the PPR core with dedicated bootstrapping firmware.
To build and flash both images, run the following command to perform a pristine build:
west build -p -b nrf54h20dk/nrf54h20/cpuppr
west flash
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.
For more details, see how to configure Kconfig.
To build and flash both images, run the following command to perform a pristine build:
west build -p -b nrf54h20dk/nrf54h20/cpuppr -- -DSB_CONFIG_VPR_LAUNCHER=n
west flash
Separate images
You can build and program the application sample and the PPR sample as separate images using either nRF Connect for VS Code or the command line. Refer to nRF Util documentation for instructions on using nRF Util. Depending on the method you select, complete the following steps:
Open nRF Connect for VS Code.
Complete the steps listed on the How to build an application page in the nRF Connect for VS Code documentation.
Build the application image by configuring the following options:
Set the Board target to
nrf54h20dk/nrf54h20/cpuapp.Select either the
nordic-pprornordic-ppr-xipsnippet, depending on the PPR image target.Set System build to No sysbuild.
For more information, see Providing CMake options.
Build the PPR image by configuring the following options:
Set the Board target to
nrf54h20dk/nrf54h20/cpuppr(recommended) ornrf54h20dk/nrf54h20/cpuppr/xip.Set System build to No sysbuild.
For more information, see Providing CMake options.
Start the toolchain environment in a terminal window.
Build the application core image, and based on your build target, include the appropriate snippet:
west build -p -b nrf54h20dk/nrf54h20/cpuapp -S nordic-ppr --no-sysbuildProgram the application core image by running the
west flashcommand without –erase.west flashBuild the PPR core image:
west build -p -b nrf54h20dk/nrf54h20/cpuppr --no-sysbuildYou can customize the command for additional options by adding build parameters.
Once the PPR core image is successfully built, program it by running the
west flashcommand without –erase.west flash