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

Yocto Integration: Build Environment Setup

  1. 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 \
    
  2. Change kernel config and rebuild kernel:
         cd ~/imx-yacto-bsp/
         source setup-environment build/
         bitbake -c menuconfig virtual/kernel
    

    ** Kernel 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*
    
  3. 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
             >;
         };
     };
    
  4. 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&
    
  5. Build core-image-minimal image:

         bitbake core-image-minimal
    
  6. Program the SD card with the whole image including kernel and root file system:

         sudo dd if=xxxx.wic of=/dev/mmcblk0 bs=1M
    
  7. 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.