Testing
After programming the sample to your development kit, complete the following steps to test it:
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 listcommand. Alternatively, check your operating system’s device manager or its equivalent.Connect to the kit with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.
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_configThe 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_boandset_ant_gaincommands. These backoffs are applied only when thebypass_reg_domainis set to0.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_statsThe 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 0Note
Use
wifi_radio_test tx_tone 0only if the command issued before this iswifi_radio_test tx_tone 1.To enable DPD hardware block, use the following command:
wifi_radio_test dpd 1To 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_temperatureThe 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 USThe 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_domainto1using the following command:wifi_radio_test bypass_reg_domain 1The 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_domainis0, 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_powercommand 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_powercommand when using Radio Test sample, as described in Radio test subcommands.AntGainis the compensation for the antenna gain in the TX direction, as described in Antenna gain compensation.AntGaincan be set to0usingwifi_radio_test set_ant_gaincommand.EdgeBackoffis the backoff applied to band edge channels, as described in Band edge compensation.EdgeBackoffcan be set to0usingwifi_radio_test set_edge_bocommand.
Note
If
bypass_reg_domainis1, 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_domainis1and thetx_powercommand is issued, by using the following formula:\[\begin{aligned} \text{TX power} = P_{\text{rt}} - \text{EdgeBackoff} \end{aligned}\]To achieve expected TX power
EdgeBackoffshould be set to0before issuingtx_powercommand.
To calculate the TX power without issuing
tx_powercommand, see TX power calculation.To read battery voltage in volts, execute the following sequence of commands:
wifi_radio_test get_voltageThe sample shows the following output:
wifi_nrf: The battery voltage is = 3.55000 Volt
Use the following reference command interface to read or write the OTP params:
wifi_radio_ficr_prog <subcommand> [Offset] [arg1] [arg2] .. [argN]To display all the current FICR values, use the following command:
wifi_radio_ficr_prog otp_read_paramsThe sample shows the following output:
OTP Region is open for R/W REGION_PROTECT0 = 0x50fa50fa REGION_PROTECT1 = 0x50fa50fa REGION_PROTECT2 = 0x50fa50fa REGION_PROTECT3 = 0x50fa50fa MAC0: Reg0 = 0x0036cef0 MAC0: Reg1 = 0x00004a00 MAC0 Addr = f0:ce:36:00:00:4a MAC1 : Reg0 = 0x0036cef0 MAC1 : Reg1 = 0x00004b00 MAC1 Addr = f0:ce:36:00:00:4b CALIB_XO = 0x2c CALIB_MAXPOW2G4 = 0xffffffff CALIB_MAXPOW5G0MCS7 = 0xffffffff CALIB_MAXPOW5G0MCS0 = 0xffffffff REGION_DEFAULTS = 0xfffffff1
To read the status of OTP region, use the following command:
wifi_radio_ficr_prog otp_get_statusThe sample shows the following output:
Checking OTP PROTECT Region...... OTP Region is open for R/W QSPI Keys are not programmed in OTP MAC0 Address is programmed in OTP MAC1 Address is programmed in OTP CALIB_XO is programmed in OTP CALIB_MAXPOW2G4 is not programmed in OTP CALIB_MAXPOW5G0MCS7 is not programmed in OTP CALIB_MAXPOW5G0MCS0 is not programmed in OTP
To write different locations of the OTP and to program MAC0 address to F0:CE:36:00:00:4A, use the following command:
wifi_radio_ficr_prog otp_write_params 0x120 0x0036CEF0 0x4A00The sample shows the following output:
[00:24:25.200,622] <inf> otp_prog: OTP Region is open for R/W [00:24:25.200,653] <inf> otp_prog: [00:24:25.202,575] <inf> otp_prog: Written MAC address 1 [00:24:25.202,575] <inf> otp_prog: mac addr 0 : Reg1 (0x128) = 0x36cef0 [00:24:25.202,575] <inf> otp_prog: mac addr 0 : Reg2 (0x12c) = 0x4a00 [00:24:25.202,606] <inf> otp_prog: Written REGION_DEFAULTS (0x154) : 0xfffffffb [00:24:25.203,002] <inf> otp_prog: Finished Writing OTP params
See FICR programming subcommands for a list of available subcommands.