This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to test direct_test_mode with nrf21540 in NCS1.8?

Hello,

NCS1.8.0   Windows10  X64;

i test   v1.8.0\nrf\samples\bluetooth\direct_test_mode, and i want to use nrf21540 model.

i've set CONFIG_NRF21540_FEM=y  and do Project->Run CMake, but nrf21540 is not enabled.

if i forcibly enable it,

got error "DT_N_NODELABEL_nrf_radio_fem_P_spi_if_IDX_0_PH_BUS_P_label" undeclared here (not in a function)

   

thanks

Best Regards

Parents
  • Hi,

    Which board are you building for? If you build for nrf21540dk_nrf52840, CONFIG_NRF21540_FEM will be enabled by default. You do not need to alter the sample in any way.

    The "greyed out" sections in SES are not always correct, and sections which are included may be greyed out.

    To see if CONFIG_NRF21540_FEM is enabled in your build, you can check the build_nrf21540dk_nrf52840/zephyr/config.old file. That file holds the value of your configs.

  • Hello,

    thanks for reply,

    i've choose nrf52840dk_nrf52840, so,it wrong.

    According to your tips,change to nrf21540dk_nrf52840,it ok.

    but i want to use it in nRF5340, no find nrf21540dk_nrf5340_cpuapp.

    if choose nrf5340dk_nrf5340_cpuapp,build error  "error: 'NRF_RADIO' undeclared"

      

    thanks

    Best Regards

  • On the nRF5340, the radio is handled by the network core, so you need to build for nrf5340dk_nrf5340_cpunet.

    There is an .overlay and .conf file for cpunet in the direct_test_mode/boards folder, which will be used automatically.

  • Hello,

    my project use nRF5340+nRF21540,

    and i must use 128MHz, whit codes " nrfx_clock_divider_set(NRF_CLOCK_DOMAIN_HFCLK, NRF_CLOCK_HFCLK_DIV_1);"

    so i must choose nrf5340dk_nrf5340_cpuapp.

    is it means  that i can only use 64MHz(nrf5340dk_nrf5340_cpunet) or give up nRF21540?

      

    thanks

    Best Regards

  • You can have 128MHz on the application core, while using nRF21540, but the radio is handled by the network core. The application core can send hci commands to the network core.

    Maybe you can give me a bit more information about what you are trying to achieve, so I can better understand?

  • Hello,

    thanks for reply,

    my project use nRF5340+nRF21540,

    need use 128MHz for audio encode, and nRF21540 for long rang.

    In the future periodic_adv+periodic_sync for Low quality audio.

    as zip codes,is my test,i do not know how to use 21540 send/recv data.

    nrf21540_test.zip

      

    thanks

    Best Regards

  • Ok, what you are looking to do is possible. You are using a nrf5340dk board like this, correct?

    https://www.nordicsemi.com/Products/Development-hardware/nRF5340-DK

    Looks like the board files are not set up for the nRF21540, but I'm going to try to get you the files needed to do that.

Reply Children
  • Hello,

    thanks for reply,

    yes,i'm using nRF5340-DK with nRF21540 Evaluation Kit.

    i will waiting for you.

    thanks

    Best Regards

  • Hi again, turns out this is pretty simple. You just need to add the nrf21540 evaluation kit as a SHIELD when building. For a multi-image build that builds hci_rpmsg for the network core, you would use:

    west build -b nrf5340dk_nrf5340_cpuapp -- -D SHIELD=nrf21540_ek -D hci_rpmsg_SHIELD=nrf21540_ek

    No other changes are needed. If you build the images for the cores separately, this needs to be done for both images.

  • Hi,

    thanks for reply,

    VS Code,error

      

    thanks

    Best Regards

  • The direct_test_mode sample uses the radio and can therefore only be built for cpunet. If you want to use the direct_test_mode sample, while having access to the 128Mhz clock, you need something like a firmware on the application core which makes use of the 128Mhz clock and communicates with a modified direct_test_mode sample on the network core.

    That would just be for direct_test_mode testing. For the real project, you would probably just write a program for the application core which does the audio encode, and hci_rpmsg or another protocol sample on the network core.

Related