This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF5340 Multi-Image example configuration help

I am working on a project that is being ported from the nRF52840 to the nRF5340 and the once unified radio and app codebase needs to be split to the app CPU and network CPU.

The problem I am facing is I don't quite understand how to create a multi image project and the examples provided by nrf_connect dont seme to have a multi image example.

All I see are options when selecting the example for app cpu or net cpu which look to configure the device tree  for that CPU but I don't see any for multi image projects.

When reading the documentation for the radio_test example I see that the app CPU needs to be flashed with the empty_app_core project but I would like to include this project as a parent to the radio_test child project.

Is there any examples on how to do this?

Parents
  • Hello,

    I didn't get the mutlig image build to to work with the radio test example even though 'empty_app_core' is defined as a child image in \nrf\samples\CMakelists.txt. I need to investigate this a bit more and get back to you.

    That said, there are mulitple examples of multi image projects in NCS. The BLE projects do for instance include the 'HCI_rpsmg' sample as a child image when you build for the app core. Have you tried that?

    Best regards,

    Vidar

Reply
  • Hello,

    I didn't get the mutlig image build to to work with the radio test example even though 'empty_app_core' is defined as a child image in \nrf\samples\CMakelists.txt. I need to investigate this a bit more and get back to you.

    That said, there are mulitple examples of multi image projects in NCS. The BLE projects do for instance include the 'HCI_rpsmg' sample as a child image when you build for the app core. Have you tried that?

    Best regards,

    Vidar

Children
  • Hi,

    What I meant was to make empty_app_core, or any main core project the parent and when built would also build the child project to combine into one to flash.

    I tried some of the BLE projects and I see that HCI_rpsmg is a child image which I will look into more. I'm still new to this new SDK so it will take some getting used to.

  • Hello,

    Taking another look at this problem, I have made the following modifications.

    In my project root Kconfig I have the following entry

    module=CHILD_NET
    source "${ZEPHYR_BASE}/../nrf/subsys/partition_manager/Kconfig.template.build_strategy_domain"
    

    copied from ncs/nrf/subsys/partition_manager/Kconfig:73

    Then in my project root CMakeLists.txt I have the following

    set(NETCORE_IMAGE "child_net")
    set(NETCORE_IMAGE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/net")
    message("Adding ${NETCORE_IMAGE} firmware as child image")
    
    add_child_image(
      NAME ${NETCORE_IMAGE}
      SOURCE_DIR ${NETCORE_IMAGE_PATH}
      DOMAIN CPUNET
      BOARD ${CONFIG_DOMAIN_CPUNET_BOARD})

    which was copied from ncs/nrf/samples/CMakeLists.txt

    When I run west build --pristine -b nrf5340dk_nrf5340_cpuapp I get the following error

    fatal error: pm_config.h: No such file or directory
       38 | #include <pm_config.h>
          |          ^~~~~~~~~~~~~
    compilation terminated.

    How to I fix this?

  • Hello,

    I tried with NCS v1.5.1 now, and I managed to build "empty app core" as a child image to the radio test example just by adding 'CONFIG_NCS_SAMPLE_EMPTY_APP_CORE_CHILD_IMAGE=y' to the boards/nrf5340dk_nrf5340_cpunet.conf overlay. I don't recall what the problem I encountered earlier was, but seems to be working now at least.

    But to answer your question, the "pm_config.h: No such file or directory" error indicates that the partition manager is not being enabled in your build (CONFIG_PARTITION_MANAGER_ENABLED). You may create a new config setting similiar to NCS_SAMPLE_EMPTY_APP_CORE_CHILD_IMAGE in nrf\samples\Kconfig which selects the PARTION_MANAGER_ENABLED symbol.

    PARTITION_MANAGER_ENABLED enabled by NCS_SAMPLE_EMPTY_APP_CORE_CHILD_IMAGE:

  • Thanks, I was able to get it working by adding a new entry for my child image in nrf\samples\Kconfig and nrf\samples\CMakeLists.txt with the directory path pointing out of tree. This worked for building a net image as a child to the app image and for building an app image as a child to the net image.

    Still not sure why adding the same entry to the app project's CMakeLists.txt and Kconfig does not achieve the same results but for now it will have to do.

  • Hi Anthony, can you please share with us what you edit in your files, and exact path to them. It is very hard to understand how to create multi-image for nrf5340 from their documentation, especially for beginners.

    I think many would be thankful.

Related