nRF5340 multi image build APP + NET core

Hello!

I need to create the following kind of application to nRF5340:

  • APP core: various peripherals (modem, I2C ICs etc) + business logic;
  • NET core:
    • BLE stack (from BLE beacon to more sophisticated solutions);
    • my custom code;

I've spent some time investigating both Zephyr and NRF multicore/child image samples, but none of them covered my needs.

To start with a small leap, I tried to refactor zephyr/samples/hello_world to compile to APP and NET cores with a single command, to have a merged hex and finally to print some text on both cores. I've followed the nrf/samples/nrf5340/multicore sample, but aci dir never gets executed, so the child image is never compiled.

I've attached the modified hello_world. The command was west build -b nrf5340dk_nrf5340_cpuapp

(I've seen in some samples the child_image directory holding config fragments for the child image. It's again not appropriate to me, because I want to be able to specify the config with full path, like it's possible for APP core with the -DCONF=... CMake option).

Please help me implementing a one-command-buildable multi-image hello world for APP+NET ;)

Thanks, regards,

5584.hello_world_multicore.zip


Here's my second attempt based on this page:

doesn't find CPUNET domain, but nrf5340dk_nrf5340_cpuapp board dir features one...

2845.hello_world2.zip

  • Hi,

    It can also be done using Zephyr modules, as described in Adding a child image using Zephyr modules.

    Best regards,
    Marte

  • Did you folks ever got this sorted out? I'm trying to add custom netcore (starting with hci_rpmsg sample) into my application and I'm in a world of hurt trying to get it working. I got the same pm_config.h issue where it looked like the file was generated under hci_rpmsg module but not under netcore and thus failing). I tried few other approaches but always something stopped working.

    It would be great if somebody could share minimal boilerplate for getting this working with BT. 

  • I've finally solved this, but I believe it's not the elegant Nordic-recommended way. I got fed up struggling with multi images, child images and their configuration.

    In our project both the app and net cores have an MCUBoot followed by our app. Luckily MCUboot compilation can easily be enabled in menuconfig, and it's just working without any hacking. Furthermore, custom MCUboot and Zephry kernel configurations can also be specified as config files, so we don't have to rely on "config fragments" (which sometimes drives me crazy), easier to overview, we don't have to dig in the build directory for the generated final configs. In scenario config I could simply enable BLE too, NCS build system did all the required tricks. My original intent was to have a merged.hex containing all the images for APP and NET core, but I failed. Now I have separate hex files for APP and NET cores, but it turned out it's not a problem. By the way, they could be merged with mergehex or whatever, but I don't care...

    The point is: I couldn't make it with the above recommended "add_child_image" magic, but have finally found a tradeoff.

  • Thanks for the update. I very much appreciate Nordic way of being willing to address the questions on individual project bases but stuff like this has been asked several times so the basic first answer for those should be to point standalone example that does exactly this. Basic app core hello world with BT support and netcore with sufficient enablers. There are good standalone examples of hci_rpmsg but it is non-obvious what's the best way to integrate those two worlds together in the latest SDK.

    Let's see if Nordic folks respond and provide some additional information as there might be some example or new guidance since you first asked the question.

  • Hi,

    My experience is that multi image builds can be a bit buggy when it comes to hosting custom images for netcore or bootloaders. Asking our developers about previously have often granted the answer that Sysbuild will fix these issues. 

    So while it is not ideal, I think that the two easiest ways to have custom code running on the network core are:

    1. Wait until sysbuild support into the nRF Connect SDK is complete, and then use sysbuild. There is already some support for it in the Multicore Hello World application.
    2. Make changes to the nRF Connect SDK as described previously, to integrate the new child image into the project as if it were hci_rpmsg (or other images)

    Best regards,
    Marte

Related