nRF5340: Multicore application
You can use this sample to see how to build an application on the network core as a child image from the sample source files.
The sample supports the following development kits:
The sample demonstrates how to build a multicore application with the
add_child_image CMake macro.
For general information about multi-image builds, see Multi-image builds.
When building any multi-image application, the build system in the nRF Connect SDK adds the child images based on the options selected for the parent image.
This sample shows how to inform the build system about dedicated sources for the child image (in the
The sample comes with the following additional files:
aci/CMakeLists.txt- This file is used to add the child image and contains the
zephyr/module.yml- This file contains information about the location of the
CMakeLists.txtfile that invokes
add_child_imagethat is required for the build system.
Kconfig- Custom file that allows to add child image only for the application core. Additionally, it enables options required by the multi-image build.
Both the application and network cores use the same
main.c that prints the name of the DK on which the application is programmed.
This sample can be found under
samples/nrf5340/multicore in the nRF Connect SDK folder structure.
See Building and programming an application for information about how to build and program the application and Testing and debugging an application for general information about testing and debugging in the nRF Connect SDK.
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 is similar to the following one:
*** Booting Zephyr OS build v2.7.99-ncs1-2193-gd359a86abf14 *** Hello world from nrf5340dk_nrf5340_cpuapp
For the network core, the output is similar to the following one:
*** Booting Zephyr OS build v2.7.99-ncs1-2193-gd359a86abf14 *** Hello world from nrf5340dk_nrf5340_cpunet