nrf5340 network core logging

Hi,

I'm running hello world sample on both app & net core in nRF5340 SOC but logging on network core is working as expected. What I'm missing?

Code

#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/logging/log.h>

LOG_MODULE_REGISTER(MAIN_NET, LOG_LEVEL_INF);

int main(void)
{
    while(1) {
        LOG_INF("Hello World! %s\n", CONFIG_BOARD_TARGET);
        k_msleep(1000);
    }

    return 0;
}

Logging 

DK Used: nRF7002DK

Platform: nRF VS Code Extension (v2.8.0)

Expected Output: Continuous logging output from both the cores.

There is no information on network core logging configuration if any in the doc https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/nrf/device_guides/nrf53/logging_nrf5340.html

Looking forward for a solution, Thanks!

Parents
  • Hi,

    You must add the network core image as a custom image in the application project. Lesson 8 exercise 2 – Adding custom image in our nRF Connect SDK Intermediate course on DevAcademy shows how to add a custom image to your project.

    Here is the structure of the files you will need for a simple Hello World application:

    .
    ├── hello_world_appcore
    │   ├── boards
    │   │   └── nrf5340dk_nrf5340_cpuapp.conf
    │   ├── CMakeLists.txt
    │   ├── prj.conf
    │   ├── sample.yaml
    │   ├── src
    │   │   └── main.c
    │   ├── sysbuild.cmake
    │   └── sysbuild.conf
    └── hello_world_netcore
        ├── CMakeLists.txt
        ├── prj.conf
        ├── sample.yaml
        └── src
            └── main.c

    You do not need to do anything special with the net core image, but you need to add the following files to the app core image:

    hello_world_appcore/sysbuild.conf

    SB_CONFIG_PARTITION_MANAGER=n

    hello_world_appcore/sysbuild.cmake

    ExternalZephyrProject_Add(
      APPLICATION hello_world_netcore
      SOURCE_DIR ${APP_DIR}/../hello_world_netcore
      BOARD nrf5340dk/nrf5340/cpunet
    )

    hello_world_appcore/boards/nrf5340dk_nrf5340_cpuapp.conf

    CONFIG_SOC_NRF53_CPUNET_ENABLE=y

    With these files, if you build the app core image, the net core image will automatically be added to the project and built and flashed together with the app core image.

    I have attached a project where I have done the above and included your code so that both cores log periodically. Note that this code is not thoroughly tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.

    hello_world_multicore_nrf5340.zip

    Best regards,
    Marte

  • Thanks  

    Adding network core image to sysbuild works.

    Also, In the custom hardware we are planning to use native nRF5340 USB for logging and DFU functionality. I checked the SOC specification that USB is available to app core so does that means network core can't use it? Is it possible to get the separate logs from both the cores over 2 CDC ACM instances ?

Reply Children
Related