How to adapt the Radio Test sample to nRF52840 dongle?

Hi  Nordic

i would like to adapt radio test sample to nRF52840 dongle from based on pca10056.

can you help to check below steps are correct?

1- Followed  the the instruction :  nRF52840 Dongle Programming Tutorial - Getting Started - nRF5 SDK guides - Nordic DevZone (nordicsemi.com),

2-  added below UART pins definition into pca11059.h, for example

#define RX_PIN_NUMBER NRF_GPIO_PIN_MAP(1,1)
#define TX_PIN_NUMBER NRF_GPIO_PIN_MAP(1,2)
#define CTS_PIN_NUMBER NRF_GPIO_PIN_MAP(1,4)
#define RTS_PIN_NUMBER NRF_GPIO_PIN_MAP(1,7) 

3- Programming and use p1.1 and p1.2 for uart communiction.

//

SDK : nRF5_SDK_17.1.0_ddde560\examples\peripheral\radio_test\pca10056

SEGGER Embedded Studio for ARM 7.12a

Thanks.

Parents
  • Hi,

    I recommend using the Radio test sample in nRF Connect SDK instead of nRF5 SDK. For the nRF52840 Dongle, you must use USB instead of UART or solder on a serial interface connection on the dongle for UART. The recommendation is to use USB.
    However, modifying an example to use USB and support the dongle is much simpler in nRF Connect SDK than in nRF5 SDK.

    I have added support for the dongle in the nRF Connect SDK radio test sample to show you how it can be done there. radio_test_dongle.zip

    I added two files, nrf52840dongle_nrf52840.conf, and boards/nrf52840dongle_nrf52840.overlay, and made some changes to CMakeLists.txt and main.c:

    diff --git a/samples/peripheral/radio_test/CMakeLists.txt b/samples/peripheral/radio_test/CMakeLists.txt
    index 971270d4d..ea52c3c13 100644
    --- a/samples/peripheral/radio_test/CMakeLists.txt
    +++ b/samples/peripheral/radio_test/CMakeLists.txt
    @@ -29,6 +29,10 @@ if (CONFIG_RADIO_TEST_USB)
       set(remote_shell_CONF_FILE ${CMAKE_CURRENT_LIST_DIR}/conf/remote_shell/prj_usb.conf)
     endif()
     
    +if (${BOARD} STREQUAL "nrf52840dongle_nrf52840")
    +  list(set CONF_FILE "nrf52840dongle_nrf52840.conf")
    +endif()
    +
     find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
     project(NONE)
    

    diff --git a/samples/peripheral/radio_test/src/main.c b/samples/peripheral/radio_test/src/main.c
    index ed81fe871..4668df027 100644
    --- a/samples/peripheral/radio_test/src/main.c
    +++ b/samples/peripheral/radio_test/src/main.c
    @@ -8,6 +8,10 @@
     #include <zephyr/drivers/clock_control.h>
     #include <zephyr/drivers/clock_control/nrf_clock_control.h>
     
    +#if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_shell_uart), zephyr_cdc_acm_uart)
    +#include <zephyr/usb/usb_device.h>
    +#endif
    +
     static void clock_init(void)
     {
            int err;
    @@ -42,6 +46,14 @@ static void clock_init(void)
     
     void main(void)
     {
    +       #if DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_shell_uart), zephyr_cdc_acm_uart)
    +       int ret;
    +       ret = usb_enable(NULL);
    +       if (ret != 0) {
    +               printk("Failed to enable USB\n");
    +               return;
    +       }
    +       #endif
            printk("Starting Radio Test example\n");
     
            clock_init();
    

    For more information on the nRF Connect SDK, please see nRF Connect SDK - Getting started.

    Best regards,
    Marte

  • Hi

    Thanks for your quikly reply.

    1. I deleted the "raido test " and unziped the radio_test_dongle.zip to new  "radio_test”  to the foolder C:\ncs\v2.3.0\nrf\samples\peripheral 

    2. Then follow to the  How to build an application - nRF Connect for VS Code  to create a new application:

    3.i added  "C:/ncs/v2.3.0/zephyr/include/zephyr/**" to  c_cpp_properties.json to solve "Include *.h" issue :

    4. Added build Configuration:

    5. Add "rsource "$srctree/../nrf/samples/bluetooth/direct_test_mode/src/fem/Kconfig"" to Kconfig file to sove the issue:

    6.Another issue happened:

    Can you help to check which wrong configure i have make?

    Thanks.

Reply Children
Related