Multicore Hello World application

The sample demonstrates how to build the Hello World application for the multicore SoC. The sample adds a remote image as a child image from the sample source files.

Requirements

The sample supports the following development kits:

Hardware platforms

PCA

Board name

Build target

nRF5340 DK

PCA10095

nrf5340dk_nrf5340

nrf5340dk_nrf5340_cpuapp

Overview

The sample demonstrates how to build a multicore Hello World application with the Sysbuild (System build). When building with Zephyr Sysbuild, the build system adds child images based on the options selected in the project’s additional configuration and build files. This sample shows how to inform the build system about dedicated sources for additional images. The sample comes with the following additional files:

  • Kconfig.sysbuild - This file is used to add Sysbuild configuration that is passed to all the images. SB_CONFIG is the prefix for sysbuild’s Kconfig options.

  • 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 sample can be found under samples/multicore/hello_world in the nRF Connect SDK folder structure.

To build the sample, you need to add the --sysbuild argument to the west build command to build and flash all the cores:

west build -b build_target --sysbuild

This way, code for all the cores will be compiled, and the west flash command will program them.

The west flash command flashes all the cores by default. If you want to flash only one core, you have to add the --domain argument:

west flash --domain hello_world

To build the sample with Visual Studio Code, follow the steps listed on the How to build an application page in the nRF Connect for VS Code extension documentation. See Building and programming an application for other building and programming scenarios and Testing and debugging an application for general information about testing and debugging in the nRF Connect SDK.

Testing

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

  1. Connect to the kit with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.

  2. Reset the kit.

  3. Observe the console output for both cores:

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

      *** Booting Zephyr OS build v2.7.99-ncs1-2193-gd359a86abf14  ***
      Hello world from nrf5340dk_nrf5340_cpuapp
      
    • For the network core, the output should be as follows:

      *** Booting Zephyr OS build v2.7.99-ncs1-2193-gd359a86abf14  ***
      Hello world from nrf5340dk_nrf5340_cpunet