Linux driver for the nRF70 series Wi-Fi SoC family from Nordic Semiconductor. The driver is based on the nRF Connect SDK and is compatible with the Linux SPI framework.
This driver is a reference implementation and is not intended for production use. It is provided as-is and is not supported by Nordic Semiconductor ASA. It can be used in any Linux environment to evaluate the nRF70 series Wi-Fi SoC family.
The driver supports the following nRF70 series Wi-Fi SoCs:
The driver supports the following features:
The driver can be used with any Linux based products, but it is tested on a Raspberry Pi4B running the Ubuntu 22.04 LTS operating system. Support for other Linux distributions is not part of the scope of this project.
The following hardware is required to run the driver:
Note: The Interposer board is not included in the nRF7002 or nRF7001 Evaluation Kit and will need to be manufactured separately. The reference board design files for the same can be found
here
.
The following software is required to run the driver:
5.15.0-1037-raspi
Linux kernelThe following dependencies are required to build the driver, install them using apt
:
west
device-tree-compiler
build-essential
wpa_supplicant
wpa_supplicant
version is 2.10
or newerwpa_passphrase
iw
To get the latest version of the driver clone the repository using west
:
west init -m git@github.com:NordicPlayground/nrf70-linux-driver.git --mr main
If you have downloaded a released version of the driver in a zipped format, do the following after unzipping the folder:
west init -l .
Update west projects
west update
Build the driver
make clean all
nRF70 driver has feature flags to enable/disable certain features. These flags can be controlled via the command line arguments to the make
command. The following flags are available:
Flag | Description | Default |
---|---|---|
MODE |
Supported modes are STA and RADIO-TEST |
STA |
LOW_POWER |
Enable low power mode | 0 |
make clean all MODE=STA LOW_POWER=1
Ensure that the nrf_wifi_fmac_sta.ko
and dts/nrf70_rpi_interposer.dtbo
files are generated.
Load the DTS overlay
a. Permanent loading: Configure the Raspberry Pi4B to load the DTS overlay at boot time (Recommended for production)
sudo cp dts/nrf70_rpi_interposer.dtbo /boot/firmware/overlays/
# Update config.txt
sudo vim /boot/firmware/config.txt
# Add below line at the end of the file
dtoverlay=nrf70_rpi_interposer
sudo reboot
b. Runtime loading: Load the DTS overlay at runtime (Helpful for development)
sudo dtoverlay dts/nrf70_rpi_interposer.dtbo
Note 1: Using this procedure, the DTS overlay must be loaded every time the Raspberry Pi4B is rebooted.
Note 2: Using this procedure, in the dmesg
ignore the warnings OF: overlay: WARNING: memory leak will occur if overlay removed, property: ******
, these are expected as we are dynamically loading the DTS.
Load the driver
sudo insmod nrf_wifi_fmac_sta.ko
Note 1: Using this procedure, the driver must be loaded every time the Raspberry Pi4B is rebooted.
Note 2: Using this procedure, in the dmesg
ignore the warnings nrf_wifi_fmac_sta: loading out-of-tree module taints kernel
, these are expected as we are loading a out-of-tree module.
Verify that the driver is loaded
lsmod | grep nrf_wifi_fmac_sta
Verify network interfaces
ip link show
The driver should create a new network interface called nrf_wifi
.
Verify Wi-Fi interface using iw
iw dev nrf_wifi info
Check the kernel log for driver output
dmesg
wpa_passphrase <SSID> <PASSWORD> > wpa_supplicant.conf
sudo wpa_supplicant -i nrf_wifi -c wpa_supplicant.conf -B
iw dev nrf_wifi link
sudo dhclient nrf_wifi
ip addr show nrf_wifi
ping -I nrf_wifi google.com
sudo killall wpa_supplicant
iw dev nrf_wifi link
sudo rmmod nrf_wifi_fmac_sta
sudo killall wpa_supplicant
sudo wpa_supplicant -i nrf_wifi -c wpa_supplicant.conf -dd -f /tmp/wpa_supplicant.log
/tmp/wpa_supplicant.log
file along with configuration file wpa_supplicant.conf
for debugging purposes.dmesg
dmesg > dmesg.log
cat /var/log/kern.log* > kern.log
The procedure to collect sniffer logs is outside the scope of this document as it depends heavily on the environment and the sniffer used.
RADIO-TEST mode is used to characterize TX/RX functionalities of RPU with different test sets.
To build the driver with RADIO-TEST mode
make clean all MODE=RADIO-TEST LOW_POWER=1
Ensure that the rf_wifi_fmac_radio_test.ko
and dts/nrf70_rpi_interposer.dtbo
files are generated.
Load the driver
sudo insmod nrf_wifi_fmac_radio_test.ko
The commands used for radio test can be found here
.
To set different test parameters debugfs
is used
For nRF70 Series device to transmit 10000 packets (TX transmit count) with the required modulation, TX power and channel (e.g. 11g, 54 Mbps, channel 11):
# echo init=11 > /sys/kernel/debug/nrf/wifi/conf # echo tx_pkt_tput_mode=0 > /sys/kernel/debug/nrf/wifi/conf # echo tx_pkt_rate=54 > /sys/kernel/debug/nrf/wifi/conf # echo tx_pkt_len=1024 > /sys/kernel/debug/nrf/wifi/conf # echo tx_pkt_gap=100 > /sys/kernel/debug/nrf/wifi/conf # echo tx_pkt_num=10000 > /sys/kernel/debug/nrf/wifi/conf # echo tx=1 > /sys/kernel/debug/nrf/wifi/conf
Once set check the configuration settings in
/sys/kernel/debug/nrf/wifi/conf
. Typically the configuration will be as below# cat /sys/kernel/debug/nrf/wifi/conf ************* Configured Parameters *********** phy_calib_rxdc = 1 phy_calib_txdc = 1 phy_calib_txpow = 0 phy_calib_rxiq = 1 phy_calib_txiq = 1 he_ltf = 2 he_gi = 2 tx_pkt_tput_mode = 0 tx_pkt_sgi = 0 tx_pkt_preamble = 1 tx_pkt_mcs = 0 tx_pkt_rate = 54 tx_pkt_gap = 100 tx_pkt_num = 10000 tx_pkt_len = 1024 tx_power = 30 ru_tone = 26 ru_index = 1 rx_capture_length = 0 rx_lna_gain = 0 rx_bb_gain = 0 tx_tone_freq = 0 xo_val = 38 init = 11 tx = 0 rx = 0 tx_pkt_cw = 15 reg_domain = 00 bypass_reg_domain = 0
To view the test results
# cat /sys/kernel/debug/nrf/wifi/stats
Typically the results will be as below after running the test.
# cat /sys/kernel/debug/nrf/wifi/stats
************* PHY STATS ***********
rssi_avg = -64 dBm
ofdm_crc32_pass_cnt=5140
ofdm_crc32_fail_cnt=3952
dsss_crc32_pass_cnt=31786
dsss_crc32_fail_cnt=2265
Target Wake Time (TWT) feature is not supported yet.
Intermittent issues when running UDP/TCP throughputs:
Sometimes below warning is observed in the dmesg
NOHZ tick-stop error: Non-RCU local softirq work is pending, handler #08!!!