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 |
---|---|---|---|
PCA10095 |
|
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 theExternalZephyrProject_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:
Connect to the kit with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.
Reset the kit.
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_cpuappFor 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