Testing nRF5340 DK + nRF21540 EK using ncs 2.7 with child Image

Hello,

I want to test nRF21540 EK with a nRF5340 DK.

I am using ncs 2.7, and don't want to use sys build. I want to use child image/ hci_ipc

I modified ncs/zephyr/samples/bluetooth/beacon sample to include hci_ipc_prj.conf file for MPSL Configurations for TX Gain setting and such as follows:

I also modified the nrf5340dk board files to configure nRf21540 FEM for SPI+GPIO as follows:

I connected the nRf21540 EK to nRF5340.

Build command issued is:

nrfutil toolchain-manager launch --ncs-version v2.7.0 west build -- --pristine -b nrf5340dk/nrf5340/cpuapp ./ncs/zephyr/samples/bluetooth/beacon_nrf21540/

nrfutil toolchain-manager launch --ncs-version v2.7.0 west flash

I was expecting to see build/hci_ipc/ folder with build/hci_ipc/zephyr/.config file with all MPSL settings, but I do not see the file.

When I test the build as well, I see beaconing happening from nRf5340 DK itself and nRf21540 is not being used at all by netcore. 

What do I do to get the MPSL settings in .config file in hci_ipc build and to actually get nRf21540 be controlled by netcore of nRF5340?

Above file changes can be used to replicate the issue/behavior.

Thanks,
Dhara

  • Hi Dhara,

    In v2.7.0 you must specify that you do not want to use sysbuild when building applications that are located inside your west workspace. You can do this by adding --no-sysbuild to the build command:

    west build -b nrf5340dk/nrf5340/cpuapp --no-sysbuild

    The recommended method of including the nRF21540 EK is by providing it as a CMake option in the command with -DSHIELD=nrf21540ek. You do not need to add it to devicetree manually when adding it as a CMake option. Please see Developing with the nRF21540 EK for more information.

    Please note that parent-child image is deprecated in v2.7.0, and sysbuild is the recommended method.

    Best regards,
    Marte

  • Hi Marte,

    A) parent-child image with modified device tree files:

    Ok yes I tried with --no-sysbuild.

    I was also adding the hci_ipc_prj.conf to app image Cmaklists instead of net image cmakelists file. 

    I added it to samples/zephyr/bluetooth/hci_ipc, as the beacon sample was using this for netcore image.

    Then it showed me the hci_ipc/zephyr/.config file with correct MPSL settings and such as per the document.

    But when I test, I see error in hci_core.c file at below location, and there is no beaconing.


    err = bt_dev.drv->open();
    if (err) {
    LOG_ERR("HCI driver open failed (%d)", err);
    return err;
    }

    We need to move to using sysbuild but for now we are still using parent-child image and I need to control nRF21540 using multi-image build.

    B) parent-child image with -DSHIELD=nrf21540ek

    Since above did not work for some reason, I tried without device tree changes, only with the CMAKE option of  -DSHIELD=nrf21540ek

    I did see beaconing and no error, but looked like the advertising was coming from nRF5340 antenna itself and the nRf21540 was totally unused.

    I was expecting TX_EN to go high every 100 ms or so (adv interval) but that did not happen. SPI_SCK also remained low the whole time.

    C) sysbuild with -DSHIELD=nrf21540ek

    Again I see same result as in B and no effect of using the nRf21540 EK.

    D) sysbuild with -- -DSHIELD=nrf21540ek_fwd -Dhci_ipc_SHIELD=nrf21540ek

    As per Developing with the nRF21540 EK need above config for multicore soc like nrf5340.

    Again I see same result as in B and no effect of using the nRf21540 EK.

    Questions:

    1. Will the -- -DSHIELD=nrf21540ek_fwd -Dhci_ipc_SHIELD=nrf21540ek also work with multi-image builds?

    2. I ultimately want to use nRf21540 chip on our custom board. So we will not be using nRf21540 EK as is, but will need modified config. In this case, the device tree changes will still be needed right?

    Not sure what to do next to get the nRF21540 to work.

Related