Multicore idle test

The test benchmarks the idle behavior of an application that runs on multiple cores. It uses a system timer as a wake-up source.

Requirements

The test supports the following development kits:

Hardware platforms

PCA

Board name

Board target

nRF5340 DK

PCA10095

nrf5340dk

nrf5340dk/nrf5340/cpuapp

nRF54H20 DK

PCA10175

nrf54h20dk

nrf54h20dk/nrf54h20/cpuapp

Overview

The test demonstrates how to build a multicore idle application with Sysbuild.

When building with sysbuild, the build system adds child images based on the options selected in the project’s additional configuration and build files. This test shows how to inform the build system about dedicated sources for additional images. The test comes with the following additional files:

  • Kconfig.sysbuild - This file is used to add sysbuild Kconfig options that are passed to all the images.

  • sysbuild.cmake - The CMake file adds additional images using the ExternalZephyrProject_Add macro. You can also add the dependencies for the images if required.

Both the application and remote cores use the same main.c that prints the name of the DK on which the application is programmed.

Building and running

This test can be found under tests/benchmarks/multicore/idle in the nRF Connect SDK folder structure.

See Programming an application for information about how to build and program the tests.

The remote board must be specified using SB_CONFIG_REMOTE_BOARD. To build the test, use configuration setups from testcase.yaml using the -T option. See the following examples:

nRF5340 DK

You can build the test for application and network cores as follows:

west build -p -b nrf5340dk/nrf5340/cpuapp -T benchmarks.multicore.idle.nrf5340dk_cpuapp_cpunet .
nRF54H20 DK

You can build the test for application and radio cores as follows:

west build -p -b nrf54h20dk/nrf54h20/cpuapp -T benchmarks.multicore.idle.nrf54h20dk_cpuapp_cpurad .

You can build the test for application and PPR cores as follows:

west build -p -b nrf54h20dk/nrf54h20/cpuapp -T benchmarks.multicore.idle.nrf54h20dk_cpuapp_cpuppr .

Note

Nordic PPR snippet (nordic-ppr) is used in the configuration above to automatically launch PPR core from the application core.

An additional configuration setup is provided to execute code directly from the non-volatile memory (MRAM) on the PPR core. This configuration uses Nordic boot PPR snippet with execution in place (nordic-ppr-xip) and enables CONFIG_XIP on the PPR core. You can build the sample as follows:

west build -p -b nrf54h20dk/nrf54h20/cpuapp -T benchmarks.multicore.idle.nrf54h20dk_cpuapp_cpuppr_xip .

Note

Programming the nRF54H20 SoC can sometimes fail due to conflicts in the resource configuration. This can happen if, for example, an application programmed to the nRF54H20 SoC configured the UICRs for one or more cores in a way that is incompatible with the configuration required by the application you are trying to program on the SoC.

To fix this error and erase the UICR for the application core, run the following command:

nrfutil device recover --core Application

If your sample also uses the radio core, you must also erase the UICRs for the radio core. To erase the UICR for the radio core, run the following command:

nrfutil device recover --core Network

For more information on the command, run:

nrfutil device recover --help

You can then run west flash to program your application.

Testing

After programming the test to your development kit, complete the following steps to test it:

  1. Connect to the kit with a terminal emulator (for example, nRF Connect Serial Terminal). See Testing and optimization for the required settings and steps.

  2. Reset the kit.

  3. Observe the console output for both cores:

    • For the application core, the output should be as follows:

      *** Booting nRF Connect SDK zephyr-v3.5.0-3517-g9458a1aaf744 ***
      Multi-core idle test on nrf5340dk/nrf5340/cpuapp
      Multi-core idle test iteration 0
      Multi-core idle test iteration 1
      ...
      
    • For the remote core, the output should be as follows:

      *** Booting nRF Connect SDK zephyr-v3.5.0-3517-g9458a1aaf744 ***
      Multi-core idle test on nrf5340dk/nrf5340/cpunet
      Multi-core idle test iteration 0
      Multi-core idle test iteration 1
      ...