Sample description

The Wi-Fi Radio test sample demonstrates how to configure the Wi-Fi radio in a specific mode and then test its performance. The sample provides a set of predefined commands that allow you to configure the radio in the following modes:

  • Modulated carrier TX

  • Modulated carrier RX

The sample also shows how to program the user region of FICR parameters on the development kit using a set of predefined commands.

Requirements

The sample supports the following development kit:

Hardware platforms

PCA

Board name

Build target

nRF7002 DK

PCA10143

nrf7002dk_nrf5340

nrf7002dk_nrf5340_cpuapp

Overview

To run the tests, connect to the development kit through the serial port and send shell commands. Zephyr’s Shell module is used to handle the commands.

You can start running wifi_radio_test subcommands to set up and control the radio. See Wi-Fi radio test subcommands for a list of available subcommands.

In the Modulated carrier RX mode, you can use the get_stats subcommand to display the statistics. See Wi-Fi radio test statistics for a list of available statistics.

You can use wifi_radio_ficr_prog subcommands to read or write OTP registers. See Wi-Fi radio FICR subcommands for a list of available subcommands.

Note

All the FICR registers are stored in the one-time programmable (OTP) memory. Consequently, the write commands are destructive, and once written, the contents of the OTP registers cannot be reprogrammed.

Building and running

This sample can be found under samples/wifi/radio_test in the nRF Connect SDK folder structure.

To build the sample with Visual Studio Code, follow the steps listed on the How to build an application page in the nRF Connect for VS Code extension documentation. See Building and programming an application for other building and programming scenarios and Testing and debugging an application for general information about testing and debugging in the nRF Connect SDK.

Currently, the following configurations are supported:

  • 7002 DK + QSPI

  • 7002 EK + SPIM

To build for the nRF7002 DK, use the nrf7002dk_nrf5340_cpuapp build target. The following is an example of the CLI command:

west build -b nrf7002dk_nrf5340_cpuapp

To build for the nRF7002 EK and nRF5340 DK, use the nrf5340dk_nrf5340_cpuapp build target with the SHIELD CMake option set to nrf7002_ek. The following is an example of the CLI command:

west build -b nrf5340dk_nrf5340_cpuapp -- -DSHIELD=nrf7002_ek

See also Providing CMake options for instructions on how to provide CMake options.

Testing

After programming the sample to your development kit, complete the following steps to test it:

  1. Connect the kit to the computer using a USB cable. The kit is assigned a COM port (Windows) or ttyACM device (Linux), which is visible in the Device Manager.

  2. Connect to the kit with a terminal emulator (for example, PuTTY). See How to connect with PuTTY for the required settings.

  3. Test the sample either by configuring the Wi-Fi radio or by programming the FICR parameters:

    • To display the current configuration, use the following command:

      wifi_radio_test show_config
      

      The sample shows the following output:

      ************* Configured Parameters ***********
      rf_params = 00 00 00 00 00 00 2C 00 00 00 00 00 00 00 00 30 20 30 20 20 20 30 30 30 00 00 00 00 50 EC 00 00 00 00 00 00 00 00 00 00 00 00
      tx_pkt_tput_mode = 0
      tx_pkt_sgi = 0
      tx_pkt_preamble = 0
      tx_pkt_mcs = -1
      tx_pkt_rate = -1
      tx_pkt_gap = 200
      phy_calib_rxdc = 1
      phy_calib_txdc = 1
      phy_calib_txpow = 1
      phy_calib_rxiq = 1
      phy_calib_txiq = 1
      chnl_primary = 1
      tx_pkt_num = -1
      tx_pkt_len = 1400
      tx_power = 0
      he_ltf = 0
      he_gi = 0
      tx = 0
      rx = 0
      
    • To run a continuous Orthogonal frequency-division multiplexing (OFDM) TX traffic sequence with the following configuration:

      • Channel: 14

      • Frame duration: 5484 us

      • Inter-frame gap: 4200 us

      Execute the following sequence of commands:

      wifi_radio_test rx 0
      wifi_radio_test tx 0
      wifi_radio_test tx_pkt_tput_mode 0
      wifi_radio_test tx_pkt_len 4095
      wifi_radio_test chnl_primary 14
      wifi_radio_test tx_pkt_rate 6
      wifi_radio_test tx_power 0
      wifi_radio_test tx_pkt_gap 4200
      wifi_radio_test tx 1
      
    • To run a continuous Direct-sequence spread spectrum (DSSS) TX traffic sequence with the following configuration:

      • Channel: 1

      • Frame duration: 8500 us

      • Inter-frame gap: 8600 us

      Execute the following sequence of commands:

      wifi_radio_test rx 0
      wifi_radio_test tx 0
      wifi_radio_test tx_pkt_tput_mode 0
      wifi_radio_test tx_pkt_len 1024
      wifi_radio_test chnl_primary 1
      wifi_radio_test tx_pkt_rate 1
      wifi_radio_test tx_power 0
      wifi_radio_test tx_pkt_gap 8600
      wifi_radio_test tx 1
      

    See Wi-Fi radio test subcommands for a list of available subcommands.

    Note

    • For regulatory certification, it is advisable to run the TX streams in Legacy OFDM or DSSS modes only (wifi_radio_test tx_pkt_tput_mode 0).

    • The frame duration can be calculated using the formula:

      D = ((L * 8) / R ) + P
      

      where the following parameters are used:

      • D - Frame duration (us)

      • L - Frame length (bytes)

      • R - Data rate (Mbps)

      • P - PHY overhead duration (us) (Values: 24 us - Legacy OFDM, 192 us - DSSS)

Dependencies

This sample uses the following Zephyr library:

  • Shell:

    • include/shell/shell.h