DTM and radio test build and testing

Hi All!

I am using nrf21540 in my custom board with nrf52833/20 to extend the range. I am trying both NCS and nrf5 sdk. I got examples in both SDKs but facing issues in building the project. Can you please help me in this regard?

1)In Nrf5 SDK facing the following issue.

a) I tried to build the code by defining #define NRF21540_DRIVER_ENABLE 1 in main.c and got the following error.

and same is the case when I build the Radio test example.

2)When I build the example from NCS.DTM or Radio test example then get the cmake file error and missing source file.

3)Will the example from nrf5 SDK will help me to test my custom HW or should I go for the NCS?. Means which one is better? Because I wrote my code in nrf5 SDK.

Thanks in advance!

Parents
  • Hi,

    1.  You have to add the nrf21540 header file. This link show how to do it in Segger embedded studio:
      https://infocenter.nordicsemi.com/topic/ug_gsg_ses/UG/gsg/add_headers_ses.html?cp=1_0_2_6_5_1
      The nrf21540.h file is located in:
      components\drivers_ext\nrf21540
       
    2. The radio_test sample in the nRF connect SDK are dependent on some files form the DTM sample, when creating a new freestanding application in VS code the paths for these files are incorrect as they are relative paths. To fix this you must change these lines in the CMakeList.txt file to the absolute paths for these files from the DTM sample:
      # Application sources
      target_sources_ifdef(CONFIG_FEM app
      			PRIVATE ../../bluetooth/direct_test_mode/src/fem/fem.c)
      target_sources_ifdef(CONFIG_NRF21540_FEM app
      			PRIVATE ../../bluetooth/direct_test_mode/src/fem/nrf21540.c)
      target_sources_ifdef(CONFIG_GENERIC_FEM app
      			PRIVATE ../../bluetooth/direct_test_mode/src/fem/generic_fem.c)
      zephyr_include_directories(../../bluetooth/direct_test_mode/src/fem/)


       
    3. It's recommended to use the DTM and radio_test samples from NCS as these have a more complete support for the nRF21540.

     

    Best regards,

    Bendik

Reply
  • Hi,

    1.  You have to add the nrf21540 header file. This link show how to do it in Segger embedded studio:
      https://infocenter.nordicsemi.com/topic/ug_gsg_ses/UG/gsg/add_headers_ses.html?cp=1_0_2_6_5_1
      The nrf21540.h file is located in:
      components\drivers_ext\nrf21540
       
    2. The radio_test sample in the nRF connect SDK are dependent on some files form the DTM sample, when creating a new freestanding application in VS code the paths for these files are incorrect as they are relative paths. To fix this you must change these lines in the CMakeList.txt file to the absolute paths for these files from the DTM sample:
      # Application sources
      target_sources_ifdef(CONFIG_FEM app
      			PRIVATE ../../bluetooth/direct_test_mode/src/fem/fem.c)
      target_sources_ifdef(CONFIG_NRF21540_FEM app
      			PRIVATE ../../bluetooth/direct_test_mode/src/fem/nrf21540.c)
      target_sources_ifdef(CONFIG_GENERIC_FEM app
      			PRIVATE ../../bluetooth/direct_test_mode/src/fem/generic_fem.c)
      zephyr_include_directories(../../bluetooth/direct_test_mode/src/fem/)


       
    3. It's recommended to use the DTM and radio_test samples from NCS as these have a more complete support for the nRF21540.

     

    Best regards,

    Bendik

Children
  • Hi  

    Thank you so much for the reponse! I followed your steps for the nrf5 sdk . And also pasted the header files

    #include "nrf21540_defs.h"
    #include "nrf21540_gpio.h"
    #include "nrf21540_macro.h"
    #include "nrf21540_spi.h"
    #include "nrf21540_types.h"

    #if defined(NRF21540_DRIVER_ENABLE) && (NRF21540_DRIVER_ENABLE == 1)
    #include "nrf21540.h"
    #endif

    in main.c

    after that, i got the following errors.

    Can you please help me in this regard?

    Thanks and regards,

  • Hi 

    When I compiled pca10112 it compiled well without any error!

    Thanks And regards,

  • Hi !

    After i compiled the pca10112 soft device and pca10100(nrf52833) then i need to compile pca10100e(nrf52820) .For nrf52820 i migrated the code from pca10100 as per the instructions of nordic forum.

    I got the following error.

    multiple definitions of `UARTE0_UART0_IRQHandler'; 

    I also attached the .emproject file. Can you please look into it if I missed anything?

    <!DOCTYPE CrossStudio_Project_File>
    <solution Name="radio_test_pca10100e" target="8" version="2">
      <project Name="radio_test_pca10100e">
        <configuration
          Name="Common"
          arm_architecture="v7EM"
          arm_core_type="Cortex-M4"
          arm_endian="Little"
          arm_fp_abi="Soft"
          arm_fpu_type="Soft"
          arm_linker_heap_size="2048"
          arm_linker_process_stack_size="0"
          arm_linker_stack_size="2048"
          arm_linker_treat_warnings_as_errors="No"
          arm_simulator_memory_simulation_parameter="RWX 00000000,00100000,FFFFFFFF;RWX 20000000,00010000,CDCDCDCD"
          arm_target_device_name="nRF52820_xxAA"
          arm_target_interface_type="SWD"
          c_preprocessor_definitions="APP_TIMER_V2;APP_TIMER_V2_RTC1_ENABLED;BOARD_PCA10112;BSP_DEFINES_ONLY;CONFIG_GPIO_AS_PINRESET;FLOAT_ABI_HARD;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;NRF52820_XXAA;NRF21540_DRIVER_ENABLE=1;NRFX_COREDEP_DELAY_US_LOOP_CYCLES=3"
          c_user_include_directories="../../../config;../../../../../../components;../../../../../../components/boards;../../../../../../components/drivers_ext/nrf21540;../../../../../../components/drivers_nrf/nrf_soc_nosd;../../../../../../components/libraries/atomic;../../../../../../components/libraries/atomic_fifo;../../../../../../components/libraries/balloc;../../../../../../components/libraries/bsp;../../../../../../components/libraries/cli;../../../../../../components/libraries/cli/uart;../../../../../../components/libraries/delay;../../../../../../components/libraries/experimental_section_vars;../../../../../../components/libraries/fifo;../../../../../../components/libraries/log;../../../../../../components/libraries/log/src;../../../../../../components/libraries/memobj;../../../../../../components/libraries/mutex;../../../../../../components/libraries/pwr_mgmt;../../../../../../components/libraries/queue;../../../../../../components/libraries/ringbuf;../../../../../../components/libraries/scheduler;../../../../../../components/libraries/sortlist;../../../../../../components/libraries/strerror;../../../../../../components/libraries/timer;../../../../../../components/libraries/uart;../../../../../../components/libraries/util;../../../../../../components/toolchain/cmsis/include;../../..;../../../../../../external/fnmatch;../../../../../../external/fprintf;../../../../../../external/segger_rtt;../../../../../../integration/nrfx;../../../../../../integration/nrfx/legacy;../../../../../../modules/nrfx;../../../../../../modules/nrfx/drivers/include;../../../../../../modules/nrfx/hal;../../../../../../modules/nrfx/mdk;../config"
          debug_register_definition_file="../../../../../../modules/nrfx/mdk/nrf52820.svd"
          debug_start_from_entry_point_symbol="No"
          debug_target_connection="J-Link"
          gcc_debugging_level="Level 3"
          gcc_entry_point="Reset_Handler"
          linker_output_format="hex"
          linker_printf_fmt_level="long"
          linker_printf_width_precision_supported="Yes"
          linker_scanf_fmt_level="long"
          linker_section_placement_file="flash_placement.xml"
          linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x40000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x8000;FLASH_START=0x27000;FLASH_SIZE=0x19000;RAM_START=0x20002ae8;RAM_SIZE=0x5518"
          linker_section_placements_segments="FLASH1 RX 0x0 0x40000;RAM1 RWX 0x20000000 0x8000"
          macros="CMSIS_CONFIG_TOOL=../../../../../../external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar"
          project_directory=""
          project_type="Executable" />
        <folder Name="Segger Startup Files">
          <file file_name="$(StudioDir)/source/thumb_crt0.s" />
        </folder>
        <folder Name="nRF_Log">
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_rtt.c" />
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_serial.c" />
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_backend_uart.c" />
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_default_backends.c" />
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_frontend.c" />
          <file file_name="../../../../../../components/libraries/log/src/nrf_log_str_formatter.c" />
        </folder>
        <folder Name="Board Definition">
          <file file_name="../../../../../../components/boards/boards.c" />
        </folder>
        <folder Name="nRF_Libraries">
          <file file_name="../../../../../../components/libraries/util/app_error.c" />
          <file file_name="../../../../../../components/libraries/util/app_error_handler_gcc.c" />
          <file file_name="../../../../../../components/libraries/util/app_error_weak.c" />
          <file file_name="../../../../../../components/libraries/fifo/app_fifo.c" />
          <file file_name="../../../../../../components/libraries/scheduler/app_scheduler.c" />
          <file file_name="../../../../../../components/libraries/timer/app_timer2.c" />
          <file file_name="../../../../../../components/libraries/uart/app_uart_fifo.c" />
          <file file_name="../../../../../../components/libraries/util/app_util_platform.c" />
          <file file_name="../../../../../../components/libraries/timer/drv_rtc.c" />
          <file file_name="../../../../../../external/fnmatch/fnmatch.c" />
          <file file_name="../../../../../../components/libraries/util/nrf_assert.c" />
          <file file_name="../../../../../../components/libraries/atomic/nrf_atomic.c" />
          <file file_name="../../../../../../components/libraries/balloc/nrf_balloc.c" />
          <file file_name="../../../../../../components/libraries/cli/nrf_cli.c" />
          <file file_name="../../../../../../components/libraries/cli/uart/nrf_cli_uart.c" />
          <file file_name="../../../../../../external/fprintf/nrf_fprintf.c" />
          <file file_name="../../../../../../external/fprintf/nrf_fprintf_format.c" />
          <file file_name="../../../../../../components/libraries/memobj/nrf_memobj.c" />
          <file file_name="../../../../../../components/libraries/pwr_mgmt/nrf_pwr_mgmt.c" />
          <file file_name="../../../../../../components/libraries/queue/nrf_queue.c" />
          <file file_name="../../../../../../components/libraries/ringbuf/nrf_ringbuf.c" />
          <file file_name="../../../../../../components/libraries/experimental_section_vars/nrf_section_iter.c" />
          <file file_name="../../../../../../components/libraries/sortlist/nrf_sortlist.c" />
          <file file_name="../../../../../../components/libraries/strerror/nrf_strerror.c" />
          <file file_name="../../../../../../components/libraries/uart/retarget.c" />
          <file file_name="../../../../../../components/libraries/atomic_fifo/nrf_atfifo.c" />
        </folder>
        <folder Name="nRF_Drivers">
          <file file_name="../../../../../../integration/nrfx/legacy/nrf_drv_clock.c" />
          <file file_name="../../../../../../integration/nrfx/legacy/nrf_drv_uart.c" />
          <file file_name="../../../../../../components/drivers_nrf/nrf_soc_nosd/nrf_nvic.c" />
          <file file_name="../../../../../../components/drivers_nrf/nrf_soc_nosd/nrf_soc.c" />
          <file file_name="../../../../../../modules/nrfx/soc/nrfx_atomic.c" />
          <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_clock.c" />
          <file file_name="../../../../../../modules/nrfx/drivers/src/prs/nrfx_prs.c" />
          <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_timer.c" />
          <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_uart.c" />
          <file file_name="../../../../../../modules/nrfx/drivers/src/nrfx_uarte.c" />
        </folder>
        <folder Name="Application">
          <file file_name="../../../main.c" />
          <file file_name="../../../radio_cmd.c" />
          <file file_name="../../../radio_test.c" />
          <file file_name="../config/sdk_config.h" />
        </folder>
        <folder Name="nRF_Segger_RTT">
          <file file_name="../../../../../../external/segger_rtt/SEGGER_RTT.c" />
          <file file_name="../../../../../../external/segger_rtt/SEGGER_RTT_Syscalls_SES.c" />
          <file file_name="../../../../../../external/segger_rtt/SEGGER_RTT_printf.c" />
        </folder>
        <folder Name="None">
          <file file_name="../../../../../../modules/nrfx/mdk/ses_startup_nrf52820.s" />
          <file file_name="../../../../../../modules/nrfx/mdk/ses_startup_nrf_common.s" />
          <file file_name="../../../../../../modules/nrfx/mdk/system_nrf52820.c" />
        </folder>
        <folder Name="nRF_Drivers_External">
          <file file_name="../../../../../../components/drivers_ext/nrf21540/nrf21540.c" />
          <file file_name="../../../../../../components/drivers_ext/nrf21540/nrf21540_gpio.c" />
          <file file_name="../../../../../../components/drivers_ext/nrf21540/nrf21540_spi.c" />
          <file file_name="../../../../../../components/drivers_ext/nrf21540/nrf21540.h" />
          <file file_name="../../../../../../components/drivers_ext/nrf21540/nrf21540_gpio.h" />
          <file file_name="../../../../../../components/drivers_ext/nrf21540/nrf21540_spi.h" />
        </folder>
      </project>
      <configuration
        Name="Release"
        c_preprocessor_definitions="NDEBUG"
        gcc_optimization_level="Optimize For Size"
        link_time_optimization="No" />
      <configuration
        Name="Debug"
        c_preprocessor_definitions="DEBUG; DEBUG_NRF"
        gcc_optimization_level="None" />
    </solution>
    

    Thanks in Advance!

Related