Sona NX611 Yocto Integration
Introduction
This guide covers hardware and software setup for implementing our Sona NX611 Series Wi-Fi 6 module in Yocto Linux. The Sona NX611 is offered in four form factors: the SIP module, the M.2 1216 module, M.2 1218 and the M.2 2230 module. Since the M.2 2230 is a pluggable edge-connector module, it’s easier to integrate for evaluation. This guide assumes integration of the M.2 2230 module.
Table 1: Sona NX611 variants
| Form Factor | Wi-Fi | BT | Part Numbers |
|---|---|---|---|
| SIP | SDIO | UART | 453-00155 (2 RF trace pins) |
| SIP | SDIO | UART | 453-00156 (1 RF trace pin) |
| M.2 1216 | SDIO | UART | 453-00157 (2 RF connectors) |
| M.2 1216 | SDIO | UART | 453-00158 (1 RF connector) |
| M.2 1218 | SDIO | UART | 453-00160 (Chip antenna) |
| M.2 2230 | SDIO | UART | 453-00166 (2 RF connectors) |
| M.2 2230 | SDIO | UART | 453-00165 (1 RF connector) |
Requirement
- iMX8MP EVK (or any platform which has an M.2 interface with SDIO)
- Sona NX611 SDIO M.2 2230 card (either 453-00165 or 453-00166)
- Sona NX611 release package
- Development PC with Yocto build environment
- Terminal software for console message dump
- AP/Router which is able to support 2.4G/5GHz band
Yocto Integration: Build Environment Setup
-
Modify the bblayers.conf under imx-yacto-bsp/build/conf as below:
BBLAYERS = " \ ${BSPDIR}/sources/poky/meta \ ${BSPDIR}/sources/poky/meta-yocto \ ${BSPDIR}/sources/meta-openembedded/meta-oe \ ${BSPDIR}/sources/meta-openembedded/meta-multimedia \ ${BSPDIR}/sources/meta-fsl-arm \ ${BSPDIR}/sources/meta-fsl-arm-extra \ ${BSPDIR}/sources/meta-fsl-demos \ ${BSPDIR}/sources/meta-summit-radio-lrd-13.24.0.x/meta-summit-radio \ -
Change kernel config and rebuild kernel:
cd ~/imx-yacto-bsp/ source setup-environment build/ bitbake -c menuconfig virtual/kernelKernel Configuration Modification:
Wi-Fi: Set cfg80211 to ‘m’ instead of build-in.
Networking support --> Wireless *< m > cfg80211*Disable the firmware sysfs fallback mechanism.
Device drivers --> Generic Driver options --> Firmware loader *[ ] Enable the firmware sysfs fallback mechanism*BT: Disable networking support for Bluetooth:
Networking support --> *< > Bluetooth*In iMX8M platform, to integrate BT via UART, you may need to set “i.MX SDMA support” to M as kernel module instead of built-in. In newer i.MX BSP, the built-in module may be initialized before root file system loading and cause SDMA initialization failure.
Device drivers --> DMA Engine support --> *[ m ] i.MX SDMA support* -
Integrate Wi-Fi functionality
Add the following packages in IMAGE_INSTALL in local.conf under imx-yacto-bsp/build/conf.
IMAGE_INSTALL:append = "\ wireless-regdb \ kernel-module-nx-backports \ summit-supplicant \ summit-networkmanager \ summit-networkmanager-nmcli \ " PREFERRED_PROVIDER_wpa-supplicant = "summit-supplicant" PREFERRED_PROVIDER_wpa-supplicant-cli = "summit-supplicant" PREFERRED_PROVIDER_wireless-regdb-static = "wireless-regdb"As the firmware package, there are four options depends on the way to download BT firmware and the module itself.
(1) Loading BT firmware by serdev driver: This driver supports in native from 4.14 kernel.
Module: M.2 1216, M.2 2230, SIP modules
IMAGE_INSTALL:append = "nx61x-firmware-1216-serdev"Module: M.2 1218 module
IMAGE_INSTALL:append = "nx61x-firmware-1218-serdev"(2) Loading BT firmware by btattach manually:
Module: M.2 1216, M.2 2230, SIP modules
IMAGE_INSTALL:append = "nx61x-firmware-1216-btattach"Module: M.2 1218 module
IMAGE_INSTALL:append = "nx61x-firmware-1218-btattach"Device tree modification is also required on the iMX8MP EVK for compatibility with the NX611 SDIO interface. The SDIO bus signal strength may need to reduce from the default value to improve signal integrity to get better performance result. The following is an example of device tree modification in the iMX8MP EVK: imx8mp-evk-usdhc1-m2.dts.
&iomuxc { pinctrl_usdhc1: usdhc1grp { fsl,pins = < MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK 0x190 MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD 0x1d0 MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0 0x1d0 MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1 0x1d0 MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2 0x1d0 MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3 0x1d0 MX8MP_IOMUXC_SD1_DATA4__GPIO2_IO06 0x10 >; }; pinctrl_usdhc1_100mhz: usdhc1-100mhzgrp { fsl,pins = < MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK 0x190 MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD 0x1d0 MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0 0x1d0 MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1 0x1d0 MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2 0x1d0 MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3 0x1d0 MX8MP_IOMUXC_SD1_DATA4__GPIO2_IO06 0x10 >; }; pinctrl_usdhc1_200mhz: usdhc1-200mhzgrp { fsl,pins = < MX8MP_IOMUXC_SD1_CLK__USDHC1_CLK 0x190 MX8MP_IOMUXC_SD1_CMD__USDHC1_CMD 0x1d0 MX8MP_IOMUXC_SD1_DATA0__USDHC1_DATA0 0x1d0 MX8MP_IOMUXC_SD1_DATA1__USDHC1_DATA1 0x1d0 MX8MP_IOMUXC_SD1_DATA2__USDHC1_DATA2 0x1d0 MX8MP_IOMUXC_SD1_DATA3__USDHC1_DATA3 0x1d0 MX8MP_IOMUXC_SD1_DATA4__GPIO2_IO06 0x10 >; }; }; -
Integrate BT functionality
Additional packages may be needed to add imx-sdma kernel module/firmware and packagegroup-tools-bluetooth in IMAGE_INSTALL in local.conf under imx-yacto-bsp/build:
IMAGE_INSTALL:append = “\ packagegroup-tools-bluetooth \ kernel-module-imx-sdma \ firmare-imx-sdma-imx7d \ "Hardware handshaking is required on the Bluetooth UART. Check if the UART port in use is configured with CTS/RTS handshaking enabled. The UART interface on the M.2 slot is uart1 (ttymxc0) on the iMX8MP EVK. The iMX8MP EVK device tree enables handshaking by default on uart1.
&uart1 { pinctrl-names = “default”; … fsl,uart-has-ctsrts; status = “okay”; };(1) Loading BT firmware by serdev driver: This driver supports in native from 4.14 kernel. If use serdev to load BT firmware, need btnxpuart.ko (available with kernel version 4.12 and higher). This mechanism is configured in the device tree Imx8mp-evk.dts
&uart1 { … bluetooth { compatible = "nxp,88w8987-bt"; fw-init-baudrate = <3000000>; }; … };(2) Loading BT firmware by btattach:
The traditional btattach implementation for BT serial interface may be used for BT support.
Upon successfully loading the firmware by the Wi-Fi driver, btattach may be issued.
/usr/bin/btattach -B /dev/ttymxc0 -P h4 -S 3000000 2>&1 > /dev/null& -
Build core-image-minimal image:
bitbake core-image-minimal -
Program the SD card with the whole image including kernel and root file system:
sudo dd if=xxxx.wic of=/dev/mmcblk0 bs=1M -
By default, the dtb file, imx8mp-evk.dtb, is only to enable PCIE interface. To enable the SDIO bus, you need to use imx8mp-evk-usdhc-m2.dtb instead.
Wi-Fi: Configuring the Supplicant or NetworkManager
There are three device driver modes able to set in NX611., STA, uAP and WiFi-Direct.
This can be set by the configuration file in the device, /lib/firmware/nxp/wifi_prod_serdev_params.conf
It's a bitwise setting, Bit 0: STA, Bit 1: uAP, Bit 2: WIFIDIRECT.
Also driver debug level can be set as well in this file.
The following is the setting to enable STA mode only.
SDIW612 = {
...
#Interfaces: Bit 0: STA, Bit 1: uAP, Bit 2: WIFIDIRECT
drv_mode=1
#Debug Level
drvdbg=7
...
} Wi-Fi connection can be configured either by NetworkManager or sdcsupp supplicant.
Configuration with NetworkManager
Here is an example to set up a connection with a WPA3-SAE network using NetworkManager.
nmcli conn add con-name NETGEAR84-5G ifname wlan0 type wifi ssid NETGEAR22-5G 802-11-wireless-security.key-mgmt sae 802-11-wireless-security.psk miles123 Configuration with sdcsupp
You can also use the supplicant (sdcsupp) directly with a configuration file.
sdcsupp -Dnl80211 -c /etc/wpa_supplicant.conf -i wlan0 -B -dddddd
/etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
update_config=1
sae_groups=19
sae_pwe=2
network={
ssid="NETGEAR84-5G"
key_mgmt=SAE
sae_password="miles123"
ieee80211w=2
} More Information
For more documentation on the Sona NX611, see the Sona NX611 Series Product Page.
Setting the NX611 Regulatory Domain
To set the regulatory domain in the Sona NX611, you will need the MFG package from the Ezurio FAE or support teams. You may need to provide your support contact in Ezurio two pieces of information: The toolchain and backports versions you use. Visit http://www.ezurio.com/contact to contact us.
In the latest release the the time of this writing (13.24.0.20), six options are supported:
- mfg611-aarch64-13.24.0.20
- mfg611-arm-eabi-13.24.0.20
- mfg611-arm-eabihf-13.24.0.20
- mfg611-powerpc64-e5500-13.24.0.20
- mfg611-x86_64-13.24.0.20
- mfg611-x86-13.24.0.20
Integration
There are two options to integrate the MFG package into your system:
-
Manually install the MFG package:
Once you get the MFG package, decompress the package:
tar jxvf mfg611-aarch64-13.24.0.20.tar.bz2Run
mfg611-aarch64-13.24.0.20.sh install, which will install the MFG tools and firmware into your host platform. -
Build into image by yocto recipe:
To build the MFG package into your image, you'll need to add the following into your recipe:
IMAGE_INSTALL:append = “summit-mfg611"Then create a folder named release under ${BSPDIR}, and copy the MFG package mfg611-aarch64-13.24.0.20.tar.bz2 into this folder.
lmu_611
After you integrate the MFG package, you can find a tool called lmu_611 under the /use/bin folder in your host platform.
After you execute lmu_611, the following will be displayed:
root@imx8mp-lpddr4-evk:/usr/bin# ./lmu_611
Syntax (v13.24.0.20):
lmu <-option> [argument]:
options
-i <interface> -> Interface
-r [<region> | <CC>] -> Domain
Example:
To set the regulatory domain to US.
lmu -i wlan0 -r US
Regulatory Domains Supported:
FCC, ETSI, IC, RCM, WW
Country Codes Supported for SIP/1216:
AU, CA, US
'ETSI' should be used for the following countries:
AT, BE, BG, CY, CZ, DE, DK, EE, ES, FI
FR, GB, GR, HR, HU, IE, IT, LT, LU, LV
MT, NL, PL, PT, RO, SE, SI, SK
Failed to set regulatory domain . To set the regulatory domain (e.g. US), use the following command:
root@imx8mp-lpddr4-evk:/usr/bin# ./lmu_611 -i wlan0 -r US
Writing regulatory domain...
Regulatory domain US successfully set.
You must reboot for changes to take effect. Reboot the device for the changes to take effect.
/filters:background_color(white)/2024-10/Sona%20NX611%20-%20Family2.png)