nrf21540 radio test for nrf52820

Hi All!

I am using nrf5 SDK 17.0.1 and using a radio test example to extend the range of nrf52833/20. Able to compile the example for nrf52833(pca10100).

Now the issue is that I migrated the code as per the instruction on nordic semi docs from pca10100 to pca10100e for nrf52820.

I am getting the following errors as mentioned in the image.

multiple definitions of `UARTE0_UART0_IRQHandler'; 

I disabled the Uart_enable in sdkconfig.h. Although the error removes but the controller is stuck and unable to run from the main.

I also attached the .emproject file where I tried to port the code from nrf52833 to nrf52820

<!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>

Can you please help in this regard? thanks in advance.

Regards,

Parents
  • Hi,

    You should be able to solve this by setting UART_LEGACY_SUPPORT to 0 in sdk_config.h.

    With that, and this modified SES project file (from pca10100) I get the radio test project to build for nRF52820:

    <!DOCTYPE CrossStudio_Project_File>
    <solution Name="radio_test_pca10100" target="8" version="2">
      <project Name="radio_test_pca10100">
        <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="8192"
          arm_linker_process_stack_size="0"
          arm_linker_stack_size="8192"
          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_user_include_directories="../../../config;../../../../../../components;../../../../../../components/boards;../../../../../../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;"
          c_preprocessor_definitions="APP_TIMER_V2;APP_TIMER_V2_RTC1_ENABLED;BOARD_PCA10100;BSP_DEFINES_ONLY;CONFIG_GPIO_AS_PINRESET;FLOAT_ABI_HARD;INITIALIZE_USER_SECTIONS;NO_VTOR_CONFIG;NRF52820_XXAA;"
          debug_target_connection="J-Link"
          gcc_entry_point="Reset_Handler"
          macros="CMSIS_CONFIG_TOOL=../../../../../../external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar"
          debug_register_definition_file="../../../../../../modules/nrfx/mdk/nrf52820.svd"
          debug_start_from_entry_point_symbol="No"
          gcc_debugging_level="Level 3"      linker_output_format="hex"
          linker_printf_width_precision_supported="Yes"
          linker_printf_fmt_level="long"
          linker_scanf_fmt_level="long"
          linker_section_placement_file="flash_placement.xml"
          linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x80000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x8000;FLASH_START=0x0;FLASH_SIZE=0x40000;RAM_START=0x20000000;RAM_SIZE=0x8000"
          
          linker_section_placements_segments="FLASH1 RX 0x0 0x80000;RAM1 RWX 0x20000000 0x8000"
          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_fifo/nrf_atfifo.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" />
        </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>
      </project>
      <configuration Name="Release"
        c_preprocessor_definitions="NDEBUG"
        link_time_optimization="No"    gcc_optimization_level="Optimize For Size" />
      <configuration Name="Debug"
        c_preprocessor_definitions="DEBUG; DEBUG_NRF"
        gcc_optimization_level="None"/>
    
    </solution>
    

  • Hi  

    Thank you so much for the response!

    Yes, I just tried UART_LEGACY_SUPPORT to 0 . After that error was removed but the controller was unable to run means no messages on uart send and receive and when I tried to debug it goes to the undefined state instead of starting from main.

    After that, I replaced SES file which you sent, then got many errors like 

    "'NRF21540_PDN_PIN' undeclared (first use in this function)" 

    means pca10112 is replaced by pca10100.

    Thanks in advance for the help!

  • Hi,

    I see. I do not have a board with nrf21540 right now, so I did not actually run the code. I assume you are testing on custom HW as you based your code on the pca10100 project? It might be that you would be better off using the PCA10112 project in SDK 17.1.0, as that is for the nRF21540 DK. In that case you would have to do similar changes as we have discussed before, and also change the SPIM instance configured in sdk_config.h, as the nRF52820 do not have SPIM3 (it only have 2 SPI masters).

    PS: An alternative could be to use radio test from the nRF Connect SDK. There the build system handles different boards/IC etc more automatically.

Reply
  • Hi,

    I see. I do not have a board with nrf21540 right now, so I did not actually run the code. I assume you are testing on custom HW as you based your code on the pca10100 project? It might be that you would be better off using the PCA10112 project in SDK 17.1.0, as that is for the nRF21540 DK. In that case you would have to do similar changes as we have discussed before, and also change the SPIM instance configured in sdk_config.h, as the nRF52820 do not have SPIM3 (it only have 2 SPI masters).

    PS: An alternative could be to use radio test from the nRF Connect SDK. There the build system handles different boards/IC etc more automatically.

Children
Related