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

  • 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?

  • Similar to what Anthony suggested, I have this build sequence:

    - Zephyr kernel

    - mcuboot

    - hci_rpmsg

    - my_net_core image -> This is where the build stops

    - Everything else

    I have been playing around with the build order and still have the same issue with pm_config.h, not sure what else I have to do.

    I am wondering if this is related to this other issue with mcuboot, which is still not solved yet: devzone.nordicsemi.com/.../nrf5340-mcuboot-build-pm_config-h-not-found

  • I do not use mcuboot so I do not know how it might affect the build sequence.

    You could try removing mcuboot.. Also I have not tried including both hci_rpmsg and a custom net core image either. If you are trying to use Bluetooth + a custom netcore image that might be a source of problems.

    You might want to open a separate issue so the developers at Nordic can provide better support.  

  • Got it now, the net core we are using is basically a copy of the the hci_rpmsg, the only difference is that it is out of the SDK folder structure (I will call that net_core).

    So what I did was to just remove hci_rpmsg from the parent image build since the net_core provides the same features as they are the same. To do this I added the line below to the parent config file:

    CONFIG_HCI_RPMSG_BUILD_STRATEGY_SKIP_BUILD=y

    With that, the build completes successfully and now I have our net_core as a child image.

    Thanks a lot for all the information in this thread!

  • Hi,
    I would like to test your solution using the hci_rpmsg as a child image. Can you explain better how to set up CHILD_IMAGE_PATH ? Is is the path to ncs sample project folder, or is it a copy of that folder into the parent application folder ?

  • Hey Gabriele,

    If you are trying to not use the ncs sample project, then this should not be the path to specify in CHILD_IMAGE_PATH.

    In my case, the CHILD_IMAGE_PATH is the path to the folder containing the project that I want to use as a child image instead of hci_rpmsg; that project is outside the ncs sample folder structure and I believe can be located anywhere in your computer. 

    Regards

Reply
  • Hey Gabriele,

    If you are trying to not use the ncs sample project, then this should not be the path to specify in CHILD_IMAGE_PATH.

    In my case, the CHILD_IMAGE_PATH is the path to the folder containing the project that I want to use as a child image instead of hci_rpmsg; that project is outside the ncs sample folder structure and I believe can be located anywhere in your computer. 

    Regards

Children
No Data
Related