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

  • I was thinking of having another try with multicore this weekend and see how it goes. My current sysbuild based solution lost its mcuboot when integrating things together and I wasn't sure how to solve that. I was thinking of getting multicore example and building BT on top of that with MCUboots images and then see if that would give me any clues why my current solution doesn't work. Multicore Hello Worlds example works just fine so I need to figure out where things break if they do. Software is funky stuff in such way that roughly right is not good enough.

  • Hi,

    There has been some fixes and updates to sysbuild in the version of Zephyr that is in v2.5.0 of the nRF Connect SDK, so it might work better than when you tried it previously. I think sysbuild is the more future-proof and "official" way to solve this.

    SvenDufva said:
    My current sysbuild based solution lost its mcuboot when integrating things together and I wasn't sure how to solve that.

    I experienced the same if I just added CONFIG_BOOTLOADER_MCUBOOT=y to prj.conf in the multicore hello world sample.
    To get MCUboot included in the project I had to add a config file for sysbuild, sysbuild.conf and add SB_CONFIG_BOOTLOADER_MCUBOOT=y.
    Please try adding this file and let me know if it solves the problem.

    Best regards,
    Marte

  • I got things to build but not to work. There are several issues pending issues (like getting MCUboot key pointed to the right file) but the biggest one is that BT spits our runtime error.

    SEGGER J-Link (unknown) V1.0, SN=1050793521
    Process: JLink.exe
    *** Booting nRF Connect SDK v2.5.0 ***
    [00:00:00.020,751] <wrn> bt_hci_core: opcode 0x0c33 status 0x11
    Bluetooth init failed (err -5)

    I put the code into public repo at https://github.com/mjaakkol/multicore Hopefully, I can figure out with help how to make this minimal end-to-end sample. Anybody should feel to comment and add pull requests to get this to work.

  • Hi,

    I saw the same when building the official Bluetooth samples with sysbuild as well, but it seemed to only happen when I tried to flash both domains together with  west flash. Flashing multiple domains built with sysbuild is experimental, so I recommend flashing the domains separately instead, that worked better for me.

    west flash --domain netcore

    west flash --domain multicore

    Best regards,
    Marte

  • Hi,

    The your folder structure is very clear and understandable. I got the same err -5 as yours.

    Did you find the solution?

    best regards

Related