Raspberry Pi 5๐
Introduction๐
The PAN9028 requires a fairly powerful host processor that executes the low-level Wi-Fiยฎ and Bluetoothยฎ drivers as well as some high-level Wi-Fi application software and a Bluetooth stack.
As an evaluation platform you can use the Raspberry Pi 5.
It does not have an on-board M.2 Key E slot for the PAN9028 M.2 device, but an additional SDIO interface and other peripherals can be enabled on the 40-pin expansion header.
To bring the PAN9028 M.2 device and the Raspberry Pi 5 together, you can use the M.2 to Raspberry Pi Adapter.
This guide shows you how to evaluate a Panasonic PAN9028 M.2 device on a Raspberry Pi 5 with the help of the M.2 to Raspberry Pi Adapter. But you have to be aware that only the basic bring-up is explained, not any advanced usage.
Hardware Modifications๐
You have to do some hardware modification to the PAN9028 M.2 device before you can use it together with the Raspberry Pi 5.
The following requirements must be met:
- You have a PAN9028 M.2 device.
SDIO and IO Reference Voltages๐
The interfaces on the 40-pin expansion header of the Raspberry Pi 5 operate with 3.3 V signal level, while the PAN9028 M.2 device operates with 1.8 V instead.
Because of this you have to modify the PAN9028 M.2 device as explained in Hardware Modifications in order to change the SDIO and IO reference voltages to 3.3 V.
Note
A signal level of 3.3 V limits the SDIO clock speed to 50 MHz, which also limits the maximum achievable data rate severely.
For further information please refer to the module product specification at
Host System Assembly๐
The following requirements must be met:
-
You have a Raspberry Pi 5 (host system).
-
You have a M.2 to Raspberry Pi Adapter.
-
You have a modified PAN9028 M.2 device.
You have to do the following steps to assemble the system.
-
Mount the PAN9028 M.2 device 3 onto the M.2 to Raspberry Pi Adapter 2 as explained in First Steps.
-
Mount the M.2 to Raspberry Pi Adapter 2 onto the 40-pin expansion header of the Raspberry Pi 5 1.
-
Power the M.2 to Raspberry Pi Adapter through the USB-C connector 4, otherwise the adapter is non-functional.
Host System Setup๐
Initial Bring-Up๐
You have to follow the Getting Started guide to bring up your Raspberry Pi 5.
The guide assumes that you use a recent version of Raspberry Pi OS based on Debian version 12 ("bookworm").
Network Connectivity๐
You have to make sure that the Raspberry Pi 5 is on the same network as your development system, because you need to interact with your host system and maybe transfer files to it in later steps.
You have to check and remember the IP address of your host system for later use.
-
On your host system, retrieve the current network configuration for the on-board Ethernet port in a Terminal window.
ip addr show eth0
The output should look something like this:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff inet 192.168.187.100/24 brd 192.168.187.255 scope global dynamic noprefixroute eth0 valid_lft 86089sec preferred_lft 86089sec inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link noprefixroute valid_lft forever preferred_lft forever
The IP address of your host system is 192.168.187.100
Host System IP Address
For this host system the IP address is 192.168.187.100, but it may be different for yours.
In any case you have to use this IP address to communicate with your host system for the remainder of this document.
To check if your Raspberry Pi 5 has Internet connectivity execute the following steps.
-
Use the
ping
command.ping -n -c 2 8.8.8.8
The output should look something like this:
Pinging 8.8.8.8 with 32 bytes of data: Reply from 8.8.8.8: bytes=32 time=19ms TTL=116 Reply from 8.8.8.8: bytes=32 time=17ms TTL=116 [...]
Your Raspberry Pi 5 has Internet connectivity.
Host System Remote Access
If you do not have any application for the SSH protocol yet, you can try the OpenSSH protocol suite.
It also includes tools for remote file operations like ssh
and scp
.
At the end of this process you should have a fully working system you can remotely log into.
Host System Configuration๐
The following requirements must be met:
-
You have brought up your Raspberry Pi 5 as explained in Host System Setup.
-
You can access your Raspberry Pi 5 remotely.
Enable Peripheral Interfaces๐
You have to modify the boot configuration of your system in order to enable additional peripheral interfaces on the 40-pin expansion header.
-
Add the following entries to the end of the configuration file
config.txt
using thenano
editor.sudo nano /boot/firmware/config.txt
config.txtdtoverlay=disable-wifi-pi5 dtoverlay=disable-bt-pi5 dtoverlay=sdio-pi5,poll_once=off dtoverlay=uart0-pi5,ctsrts dtoverlay=i2c1-pi5 dtoverlay=spi0-1cs,cs0_pin=8 dtoverlay=pca953x,tca6408 gpio=7=op,dh
The on-board Wi-Fi and Bluetooth are disabled, a UART interface is enabled on the expansion header with flow-control enabled, additional SDIO, I2C and SPI interfaces on the expansion header and support for I2C GPIO expanders is enabled, a GPIO is configured for application control.
Disable System Services๐
The Raspberry Pi OS runs some system services that integrate the on-board Wi-Fi and Bluetooth connectivity into the system and also automate certain tasks and behaviors.
During the evaluation of the PAN9028 module this is can create problems, so you have to change your system configuration to avoid this.
-
Mask certain system services to prevent them from running.
sudo systemctl mask wpa_supplicant sudo systemctl mask hciuart sudo systemctl mask ModemManager
Rename Conflicting Drivers๐
The Linux kernel of the Raspberry Pi OS comes with pre-compiled drivers that conflict with the official device drivers that you install in a later step.
One way to resolve this conflict is to rename the existing drivers.
-
Rename the conflicting Wi-Fi drivers.
cd /lib/modules/$(uname -r)/kernel/drivers/net/wireless/marvell/mwifiex sudo mv mwifiex.ko.xz mwifiex.ko.xz.bak sudo mv mwifiex_sdio.ko.xz mwifiex_sdio.ko.xz.bak
-
Rename the conflicting Bluetooth drivers.
cd /lib/modules/$(uname -r)/kernel/drivers/bluetooth sudo mv btmrvl_sdio.ko.xz btmrvl_sdio.ko.xz.bak sudo mv btmrvl.ko.xz btmrvl.ko.xz.bak
System Reboot
You have to reboot the host system for these changes to take effect.
sudo reboot
Host System Software Installation๐
Compile the Device Driver๐
You have to retrieve and compile the driver for the PAN9028 module.
-
Clone the driver repository from NXP's GitHub space.
cd ~ git clone https://github.com/nxp-imx/mwifiex.git
-
Check out the specific branch that matches the running kernel most closely.
cd ~/mwifiex/ git checkout lf-6.6.23_2.0.0
-
Compile the driver.
cd ~/mwifiex make CROSS_COMPILE= KERNELDIR=/lib/modules/$(uname -r)/build -j4 build
-
Create a global driver directory and copy the driver.
sudo mkdir -p /lib/modules/$(uname -r)/extra cd ~/mwifiex sudo cp mlan.ko moal.ko /lib/modules/$(uname -r)/extra
Install the Firmware๐
You have to download and install the firmware for the PAN9028 module.
-
Create the destination directory for the firmware and configuration files.
sudo mkdir -p /lib/firmware/nxp/
-
Clone the firmware repository from NXP's GitHub space.
cd ~ git clone https://github.com/nxp-imx/imx-firmware.git cd imx-firmware/ git checkout lf-6.6.23_2.0.0
-
Copy the firmware to the global firmware directory.
cd ~/imx-firmware sudo cp nxp/FwImage_8987/sdiouart8987_combo_v0.bin /lib/firmware/nxp/
-
Copy the configuration file
wifi_mod_para.conf
to the global firmware directory.cd ~/imx-firmware sudo cp nxp/wifi_mod_para.conf /lib/firmware/nxp/
Wi-Fi๐
Bring Up๐
The newly compiled device drivers are not loaded into the Linux kernel automatically, you have to manually load them into the kernel prior to operation.
-
Make sure that Linux kernel module dependency database is up-to-date.
sudo depmod -a
-
Load the modules into the Linux kernel.
sudo modprobe mlan sudo modprobe moal mod_para=nxp/wifi_mod_para.conf
-
Check the Linux kernel log.
sudo dmesg
The output should look something like this:
[ 541.095842] fw_name=nxp/sdiouart8987_combo_v0.bin [ 541.100571] SDIO: max_segs=128 max_seg_size=65536 [ 541.105295] rx_work=1 cpu_num=4 [ 541.108445] Enable moal_recv_amsdu_packet [ 541.108451] Attach mlan adapter operations.card_type is 0x105. [ 541.108767] wlan: Enable TX SG mode [ 541.108770] wlan: Enable RX SG mode [ 541.109583] Request firmware: nxp/sdiouart8987_combo_v0.bin [ 541.383340] Wlan: FW download over, firmwarelen=625084 downloaded 615980 [ 542.321457] WLAN FW is active [ 542.324435] on_time is 541839042441 [ 543.398906] VDLL image: len=9104 [ 543.399654] fw_cap_info=0x181d6f03, dev_cap_mask=0xffffffff [ 543.399661] max_p2p_conn = 8, max_sta_conn = 8 [ 543.399896] SDIO rx aggr: 1 block_size=512 [ 543.399907] wlan: Enable RX SG mode [ 543.399909] mpa_rx_buf_size=65280 [...] [ 543.408951] call regulatory_set_wiphy_regd US [ 543.408976] ForceRegionRule is set in the on-chip OTP memory [ 543.413376] 11D: Error setting domain info in FW [...] [ 543.414984] Register NXP 802.11 Adapter mlan0 [ 543.422141] Register NXP 802.11 Adapter uap0 [...] [ 543.437884] Register NXP 802.11 Adapter wfd0 [ 543.443263] wlan: version = SD8987----16.92.21.p119.3-MM6X16437.p21-GPL-(FP92) [ 543.451664] Set REG 0x80002328: 0x13d57 slew_rate=3 [ 543.468394] uap0: Skip change virtual intf type on uap: from 3 to 2
Note
If you can't see that the PAN9028 M.2 device was detected, press the reset button 6 button of the M.2 to Raspberry Pi Adapter briefly once.
This resets the PAN9028 module, but also triggers the detection in the Linux kernel again.
You can now check the functionality of the driver.
-
Use the
ip
command to verify that themlan0
network interface for the PAN9028 is now available.ip addr show mlan0
The output should look something like this:
3: mlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000 link/ether 34:32:e6:xx:xx:xx brd ff:ff:ff:ff:ff:ff
Usage๐
You have to follow these steps to check if Wi-Fi is functional.
-
Bring up the Wi-Fi interface.
sudo ip link set dev mlan0 up
-
Execute a Wi-Fi scan.
sudo iw dev mlan0 scan
You can see that nearby Wi-Fi networks are discovered successfully.
Bluetooth๐
The following requirements must be met:
- You have successfully brought up the Wi-Fi portion as explained in Wi-Fi.
Bring Up๐
You have to follow these steps to bring up the Bluetooth interface.
-
Initialize the Bluetooth interface.
sudo hciattach /dev/ttyAMA0 any 3000000 flow
The output should look something like this:
Device setup complete
-
Bring up the Bluetooth interface.
sudo hciconfig hci0 up
Usage๐
You have to follow these steps to check if Bluetooth is functional.
-
Execute a Bluetooth scan.
bluetoothctl scan on
You can see that nearby Bluetooth devices that are advertising are discovered successfully.
Appendix๐
The PAN9028 module has a couple of special function pins that are routed to the 40-pin expansion header as follows.
Raspberry Pi | M.2 Specification | PAN9028 | Description |
---|---|---|---|
GPIO 5 | W_DISABLE1# | PDn | Power Down |
GPIO 6 | W_DISABLE#2 | IND_RST_BT | Bluetooth reset |
GPIO 4 | SDIO_RST# | IND_RST_WL | Wi-Fi reset |
You can manually control the special function pins using the pinctrl
tool. For example:
-
Apply GND to GPIO 5 to signal power down to the module.
pinctrl set 5 op pu dl
-
Apply VCC to GPIO 5 to enable the module again.
pinctrl set 5 op pu dh