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 serial port. Serial ports are referred to as COM ports on Windows, /dev/ttyACM devices on Linux, and /dev/tty devices on macOS. To list Nordic Semiconductor devices connected to your computer together with their serial ports, open a terminal and run the nrfutil device list command. Alternatively, check your operating system’s device manager or its equivalent.

  2. Connect to the kit with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.

  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 ***********
      
      tx_pkt_tput_mode = 0
      tx_pkt_sgi = 0
      tx_pkt_preamble = 0
      tx_pkt_mcs = 0
      tx_pkt_rate = 6
      tx_pkt_gap = 0
      phy_calib_rxdc = 1
      phy_calib_txdc = 1
      phy_calib_txpow = 0
      phy_calib_rxiq = 1
      phy_calib_txiq = 1
      tx_pkt_num = -1
      tx_pkt_len = 1400
      tx_power = 30
      he_ltf = 2
      he_gi = 2
      xo_val = 42
      init = 1
      tx = 0
      rx = 0
      tx_tone_freq = 0
      rx_lna_gain = 0
      rx_bb_gain = 0
      rx_capture_length = 0
      wlan_ant_switch_ctrl = 0
      tx_pkt_cw = 15
      reg_domain = 00
      bypass_reg_domain = 0
      ru_tone = 26
      ru_index = 1
      
    • To run a continuous Orthogonal frequency-division multiplexing (OFDM) TX traffic sequence with the following configuration:

      • Channel: 11

      • Frame duration: 2708 µs

      • Inter-frame gap: 4200 µs

      Execute the following sequence of commands:

      wifi_radio_test init 11
      wifi_radio_test bypass_reg_domain 1
      wifi_radio_test tx_pkt_rate 12
      wifi_radio_test tx_pkt_len 4000
      wifi_radio_test tx_power 4
      wifi_radio_test tx_pkt_gap 4200
      wifi_radio_test tx 1
      
    • To run a continuous OFDM TX traffic sequence with the following configuration:

      • Channel: 1

      • Frame duration: 2708 µs

      • Inter-frame gap: 4200 µs

      • Edge backoff: 3 dB

      • Antenna gain: 2 dB

      Execute the following sequence of commands:

      wifi_radio_test init 1
      wifi_radio_test tx_pkt_rate 12
      wifi_radio_test tx_pkt_len 4000
      wifi_radio_test tx_power 10
      wifi_radio_test tx_pkt_gap 4200
      wifi_radio_test set_edge_bo 3
      wifi_radio_test set_ant_gain 2
      wifi_radio_test tx 1
      

    Note

    Edge backoff and antenna gain are configured in the Kconfig file. To overwrite these backoffs with user-specified backoffs, use the set_edge_bo and set_ant_gain commands. These backoffs are applied only when the bypass_reg_domain is set to 0.

    • To run a continuous Direct-sequence spread spectrum (DSSS) TX traffic sequence with the following configuration:

      • Channel: 14

      • Frame duration: 8500 µs

      • Inter-frame gap: 8600 µs

      Execute the following sequence of commands:

      wifi_radio_test init 14
      wifi_radio_test bypass_reg_domain 1
      wifi_radio_test tx_pkt_preamble 0
      wifi_radio_test tx_pkt_rate 1
      wifi_radio_test tx_pkt_len 1024
      wifi_radio_test tx_power 10
      wifi_radio_test tx_pkt_gap 8600
      wifi_radio_test tx 1
      

    See 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 (µs)

      • L - Frame length (bytes)

      • R - Data rate (Mbps)

      • P - PHY overhead duration (µs) (values: 20 µs - Legacy OFDM, 192 µs - DSSS)

    • To run a RX test with the following configuration:

      • Channel: 11

      Execute the following sequence of commands:

      wifi_radio_test init 11
      wifi_radio_test rx 1
      

    Note

    After executing the above command sequence, start sending packets from a signal generator.

    • To stop receiving packets, use the following command:

      wifi_radio_test rx 0
      

    Note

    The above command should be executed only after the signal generator has completed transmitting packets.

    • To get rx stats, use the following command:

      wifi_radio_test get_stats
      

      The sample below shows the output obtained after feeding 1000 DSSS packets:

      ************* PHY STATS ***********
      rssi_avg = -45 dBm
      ofdm_crc32_pass_cnt=0
      ofdm_crc32_fail_cnt=0
      dsss_crc32_pass_cnt=1000
      dsss_crc32_fail_cnt=0
      

      The sample below shows the output obtained after feeding 1000 OFDM packets:

      ************* PHY STATS ***********
      rssi_avg = -47 dBm
      ofdm_crc32_pass_cnt=1000
      ofdm_crc32_fail_cnt=0
      dsss_crc32_pass_cnt=0
      dsss_crc32_fail_cnt=0
      
    • To transmit a continuous tone with the following configuration:

      • Channel: 144

      • TX power: 10 dBm

      • Tone frequency: 2 MHz

      Execute the following sequence of commands:

      wifi_radio_test init 144
      wifi_radio_test tx_power 10
      wifi_radio_test tx_tone_freq 2
      wifi_radio_test tx_tone 1
      
    • To stop ongoing transmission of a continuous tone, use the following command:

      wifi_radio_test tx_tone 0
      

      Note

      Use wifi_radio_test tx_tone 0 only if the command issued before this is wifi_radio_test tx_tone 1.

    • To enable DPD hardware block, use the following command:

      wifi_radio_test dpd 1
      
    • To disable DPD hardware block, use the following command:

      wifi_radio_test dpd 0
      

    Note

    DPD command can be used only during tone transmission. For TX packet transmission, control of DPD hardware is taken care by firmware.

    • To read chip temperature in degree Celsius, execute the following sequence of commands:

      wifi_radio_test get_temperature
      

      The sample shows the following output:

      wifi_nrf: Temperature reading success:
      wifi_nrf: The temperature is = 21 degree Celsius
      
    • To measure RF RSSI status with the following configuration:

      • Channel: 144

      Execute the following sequence of commands:

      wifi_radio_test init 144
      wifi_radio_test get_rf_rssi
      

      The sample shows the following output:

      wifi_nrf: RF RSSI value is = 0
      

    Note

    RF RSSI Status is a 3-bit indicator. The higher the value of RF RSSI is, the higher is the level of saturation (non-linearity) at the LNA output.

    • To compute the optimal XO value with the following configuration:

      • Channel: 64

      Execute the following sequence of commands:

      wifi_radio_test init 64
      wifi_radio_test compute_optimal_xo_val
      

      The sample shows the following output:

      wifi_nrf: Best XO value is = 43
      

    Note

    • This test requires a DUT to be connected with VSG using cabled setup. VSG should be continuously generating 0.5 MHz tone.

    • For channel 64, set the VSG frequency to 5320.5 MHz. Set the signal power level between -40 dBm and -50 dBm.

    • To capture ADC samples with fixed RX gain with the following configuration:

      • Channel: 144

      • LNA gain: 2

      • BB gain: 10

      • Capture length: 64

      Execute the following sequence of commands:

      wifi_radio_test init 144
      wifi_radio_test rx_lna_gain 2
      wifi_radio_test rx_bb_gain 10
      wifi_radio_test rx_capture_length 64
      wifi_radio_test rx_cap 0
      

      The sample shows the following output:

      ************* RX capture data ***********
      E84FE4
      EC4F74
      F34F24
      FBCF04
      ......
      ......
      ......
      F6C1B4
      EEC178
      E94114
      

    Note

    • This test requires a DUT to be connected with VSG using cabled setup. VSG should be continuously transmitting a tone or packets.

    • Set the signal power level between -35 dBm and -45 dBm to get non saturated samples. In the example, capture is taken for 64 samples. Each complex sample is of 24 bits.

    • The captured samples will vary from run to run.

    • To capture baseband samples with fixed RX gain with the following configuration:

      • Channel: 144

      • LNA gain: 2

      • BB gain: 10

      • Capture length: 64

      Execute the following sequence of commands:

      wifi_radio_test init 144
      wifi_radio_test rx_lna_gain 2
      wifi_radio_test rx_bb_gain 10
      wifi_radio_test rx_capture_length 64
      wifi_radio_test rx_cap 1
      

      The sample shows the following output:

      ************* RX capture data ***********
      E940F0
      E8EFE7
      F3FF29
      03CF27
      ......
      ......
      ......
      0DAF9B
      115097
      08A178
      

    Note

    • This test requires a DUT to be connected with VSG using cabled setup. VSG should be continuously transmitting a tone or packets.

    • Set the signal power level between -35 dBm and -45 dBm to get non saturated samples.

    • In the example, capture is taken for 64 samples. Each complex sample is of 24 bits.

    • The captured samples will vary from run to run.

    • To capture AGC adjusted baseband samples after WLAN packet detection with the following configuration:

      • Channel: 144

      • Capture length: 64

      Execute the following sequence of commands:

      wifi_radio_test init 144
      wifi_radio_test rx_capture_length 64
      wifi_radio_test rx_capture_timeout 10
      wifi_radio_test rx_cap 2
      

      The sample shows the following output:

      ************* RX capture data ***********
      062058
      F8A31F
      E9A05D
      E800B9
      ......
      ......
      ......
      EA5FE4
      FDDF45
      07CF3D
      

      Packet detection does not take place in a clean RF environment, producing the following output:

      ************* Packet detection failed ***********
      

    Note

    • This test requires a DUT to be connected with VSG using cabled setup. VSG should be continuously transmitting WLAN packets.

    • Set the desired signal power.

    • The capture is taken for 64 samples. Each complex sample is of 24 bits. The captured samples will vary from run to run.

    • The capture is taken after WLAN packet detection, so it will not have the first few samples in the first WLAN packet.

    • Smaller packets should be used so that multiple packets can be seen in the capture.

    • Packet detection does not take place in a clean RF environment.

    • The command will time out if no packets are detected within set timeout period.

    • To set a regulatory domain with the following configuration:

      • Regulatory domain: US

      Execute the following command:

      wifi_radio_test reg_domain US
      

      The sample shows the following output:

      wifi_radio_test show_config
      reg_domain = US
      

    Note

    The default regulatory domain is 00 (world regulatory).

    • To bypass regulatory domain, set bypass_reg_domain to 1 using the following command:

      wifi_radio_test bypass_reg_domain 1
      

      The sample shows the following output:

      wifi_radio_test show_config
      reg_domain = US
      bypass_reg_domain = 1
      

    Note

    Bypass regulatory domain is false by default.

    If bypass_reg_domain is 0, then TX power of the channel will be configured to the minimum value of the user configured TX power value and maximum power supported in the configured regulatory domain.

    You can calculate the TX power when tx_power command is issued, by using the following formula:

    \[\begin{aligned} \text{TX power} = \min \left(P_{\text{rt}} , P_{\text{reg}} \right) - \text{AntGain} - \text{EdgeBackoff} \end{aligned}\]
    • \(P_\text{reg}\) is the applicable regulatory power limit, as described in Operating with regulatory support.

    • \(P_\text{rt}\) is the power set via the tx_power command when using Radio Test sample, as described in Radio test subcommands.

    • AntGain is the compensation for the antenna gain in the TX direction, as described in Antenna gain compensation. AntGain can be set to 0 using wifi_radio_test set_ant_gain command.

    • EdgeBackoff is the backoff applied to band edge channels, as described in Band edge compensation. EdgeBackoff can be set to 0 using wifi_radio_test set_edge_bo command.

    Note

    If bypass_reg_domain is 1, then user configured TX power value will be set overriding current configured regulatory domain maximum TX power for the channel.

    You can calculate the TX power when bypass_reg_domain is 1 and the tx_power command is issued, by using the following formula:

    \[\begin{aligned} \text{TX power} = P_{\text{rt}} - \text{EdgeBackoff} \end{aligned}\]
    • To achieve expected TX power EdgeBackoff should be set to 0 before issuing tx_power command.

    To calculate the TX power without issuing tx_power command, see TX power calculation.

    • To read battery voltage in volts, execute the following sequence of commands:

      wifi_radio_test get_voltage
      

      The sample shows the following output:

      wifi_nrf: The battery voltage is = 3.55000 Volt