ST60-2230C-P on i.MX 8M Plus EVK - Yocto Integration

This tutorial shows how to get the ST60-2230C-P m.2 board working on the i.MX 8M Plus board using Yocto.

Required Items

Setup

  • Set the i.MX 8M Plus board to boot off SD Card

    Boot Switches

  • Install the ST-2230C-P on the i.MX 8M Plus

    i.MX 8M Plus bottom

  • Power and serial console locations on i.MX 8M Plus EVK

    i.MX 8M Plus top

Select a release

Find the latest Yocto Kirkstone release here: https://source.codeaurora.org/external/imx/imx-manifest/log/?h=imx-linux-kirkstone. At the time of this writing: imx-5.15.32-2.0.0.xml.

mkdir ~/projects/imx8mp-st60-2230c-p
cd ~/projects/imx8mp-st60-2230c-p
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-kirkstone -m imx-5.15.32-2.0.0.xml

repo sync

Setup Build configuration

DISTRO=fsl-imx-wayland MACHINE=imx8mpevk source imx-setup-release.sh -b build-imx8-st60-2230c-p

To re-source this directory later use the following:

. setup-environment build-imx8-st60-2230c-p

Setup the Yocto Meta Layer

cd ../sources

#clone the Laird meta layer for yocto
git clone https://github.com/LairdCP/meta-summit-radio

cd meta-summit-radio/meta-summit-radio/recipes-packages/images

Note: for Yocto projects 3.3 (Hardknott) and earlier you would enter this command:
cd meta-summit-radio/meta-summit-radio-pre-3.4/recipes-packages/images

#copy the bitbake recipe example
cp sample-image-st60.bb my-st60-2230c-p.bb

Edit the bitbake recipe my-st60-2230c-p.bb

  • change sterling60-firmware-sdio-sdio to sterling60-firmware-pcie-uart
IMAGE_INSTALL += "\
        iproute2 \
        rng-tools \
        ca-certificates \
        tzdata \
        alsa-utils \
        htop \
        ethtool \
        iperf3 \
        tcpdump \
        iw \
        kernel-module-st60-backports-summit \
        sterling60-firmware-pcie-uart \
        sterling-supplicant-st60 \
        summit-networkmanager-st60 \
        summit-networkmanager-st60-nmcli \
        "

Go back to the project folder

cd ~/projects/imx8mp-st60-2230c-p

Edit conf/bblayers.conf

  • add the meta-summit-radio layer to the bblayers.conf
BBLAYERS += "${BSPDIR}/sources/meta-summit-radio/meta-summit-radio"

Note: for Yocto projects 3.3 (Hardknott) and earlier you would enter this:
BBLAYERS += "${BSPDIR}/sources/meta-summit-radio/meta-summit-radio-pre-3.4"

Edit the conf/local.conf

  • add the wpa-supplicant preferred provider, BBMASK, and wireless-regdb
PREFERRED_PROVIDER_wpa-supplicant = "sterling-supplicant" 
PREFERRED_PROVIDER_wpa-supplicant-cli = "sterling-supplicant" 
PREFERRED_PROVIDER_wpa-supplicant-passphrase = "sterling-supplicant" 

BBMASK += " \ 
    meta-summit-radio/meta-summit-radio/recipes-packages/openssl \ 
    meta-summit-radio/meta-summit-radio/recipes-packages/.*/.*openssl10.* \ 
    "

PREFERRED_RPROVIDER_wireless-regdb-static = "sterling60-firmware-pcie-uart" 

Note: for Yocto projects 3.3 (Hardknott) and earlier you would enter this:
PREFERRED_PROVIDER_wpa-supplicant = "sterling-supplicant" 
PREFERRED_PROVIDER_wpa-supplicant-cli = "sterling-supplicant" 
PREFERRED_PROVIDER_wpa-supplicant-passphrase = "sterling-supplicant" 

BBMASK += " \ 
    meta-laird-cp/meta-summit-radio-pre-3.4/recipes-packages/openssl \ 
    meta-laird-cp/meta-summit-radio-pre-3.4/recipes-packages/.*/.*openssl10.* \ 
    "

PREFERRED_RPROVIDER_wireless-regdb-static = "sterling60-firmware-pcie-uart"

Note: the PREFERRED_RPROVIDER_wireless-regdb-static needs to be set to the firmware version used.

Configure the kernel

bitbake -c menuconfig virtual/kernel

Once in the Linux kernel menuconfig:

  • deselect Device Drivers -> Network device support -> Wireless LAN

    Kernel Menuconfig - Wireless LAN

  • deselect Networking support -> Bluetooth subsystem support
  • deselect Networking support -> Wireless

    Kernel Menuconfig - Networking

Building the image

bitbake my-st60-2230c-p

Flash image to SD Card

There are a couple ways to do flash the SD card image by far the easiest is to use balenaEtcher which works on Windows, Linux, and MacOS.

The SD card image will end up tmp/deploy/images/imx8mpevk/

travis@travis:~/projects/build-imx8-st60-2230c-p/tmp/deploy/images/imx8mpevk

$ ll my-st60-2230c-p*
-rw-rw-r-- 2 travis travis     3673 Sep 10 13:23 my-st60-2230c-p.env
-rw-r--r-- 2 travis travis    50291 Sep 10 13:23 my-st60-2230c-p-imx8mpevk-20210910165812.rootfs.manifest
-rw-r--r-- 2 travis travis 70295031 Sep 10 13:23 my-st60-2230c-p-imx8mpevk-20210910165812.rootfs.tar.bz2
-rw-r--r-- 2 travis travis     4142 Sep 10 13:23 my-st60-2230c-p-imx8mpevk-20210910165812.rootfs.wic.bmap
-rw-r--r-- 2 travis travis 80963806 Sep 10 13:23 my-st60-2230c-p-imx8mpevk-20210910165812.rootfs.wic.bz2
-rw-r--r-- 2 travis travis   580282 Sep 10 13:23 my-st60-2230c-p-imx8mpevk-20210910165812.testdata.json
lrwxrwxrwx 2 travis travis       56 Sep 10 13:23 my-st60-2230c-p-imx8mpevk.manifest -> my-st60-2230c-p-imx8mpevk-20210910165812.rootfs.manifest
lrwxrwxrwx 2 travis travis       55 Sep 10 13:23 my-st60-2230c-p-imx8mpevk.tar.bz2 -> my-st60-2230c-p-imx8mpevk-20210910165812.rootfs.tar.bz2
lrwxrwxrwx 2 travis travis       54 Sep 10 13:23 my-st60-2230c-p-imx8mpevk.testdata.json -> my-st60-2230c-p-imx8mpevk-20210910165812.testdata.json
lrwxrwxrwx 2 travis travis       56 Sep 10 13:23 my-st60-2230c-p-imx8mpevk.wic.bmap -> my-st60-2230c-p-imx8mpevk-20210910165812.rootfs.wic.bmap
lrwxrwxrwx 2 travis travis       55 Sep 10 13:23 my-st60-2230c-p-imx8mpevk.wic.bz2 -> my-st60-2230c-p-imx8mpevk-20210910165812.rootfs.wic.bz2
-rw-rw-r-- 2 travis travis      961 Sep 10 13:23 my-st60-2230c-p-imx-imx-boot-bootpart.wks

Flash the file ending in wic.bz2 to a microSD card. Once the flashing is done and ejected from the PC then install the microSD card into the i.MX 8M Plus EVK and turn on.

Connect to the console

The i.MX 8M Plus EVK has a USB micro B serial console port when connected to the PC. When the USB micro B cable is connected it will show up as 4 COM ports of which the 3rd COM port in the series ends up being the Linux serial console.

Connect to this port at 115200, N, 8, 1 and login as root with no password.

Checking boot for ST60-2230 device

During boot or checking dmesg we can see:

  • Backports module is loaded
  • phy0 firmware download completed
root@imx8mpevk:~# dmesg | grep -e backport -e "ieee80211 " -e Laird
[    5.529086] Loading modules backported from Summit Linux version LRD-REL-8.6.0.12-0-gd89840b36573
[    5.541965] Backport generated by backports.git v8.6.0.12
[    5.779436] <<Ezurio 60 Series Wireless Network Driver version 8.6.0.12-P39-20190123>>
[    5.810138] ieee80211 phy0: card->iobase0 = 00000000170530df
[    5.810157] ieee80211 phy0: card->iobase1 = 00000000735a0c32
[    5.812962] ieee80211 phy0: priv->pcmd_buf = 000000005f25e08f  priv->pphys_cmd_buf = 00000000ebdb9fc9
[    5.812971] ieee80211 phy0: mwl_tx_init() called: ctype=3
[    5.824326] ieee80211 phy0: TX ring: allocating 640 bytes
[    5.835121] ieee80211 phy0: TX ring: - base: 0000000077ddae7e, pbase: 0x0:c4001000,len: 280
[    5.915996] ieee80211 phy0: lrdmwl: found firmware image <lrdmwl/88W8997_pcie.bin>
[    5.946685] ieee80211 phy0: Starting fw download
[    6.757759] ieee80211 phy0: FwSize = 367340 downloaded Size = 367340
[    8.876178] ieee80211 phy0: fw download complete
[    8.888190] ieee80211 phy0: lrdmwl_pcie: pci_enable_msi failed -22
[    8.897883] ieee80211 phy0: OTP data len = 0
[    8.902719] ieee80211 phy0: Adjusting combo 0's number of supported interfaces to 2
[    8.916466] ieee80211 phy0: mwl_reg_notifier set=0 core 00
[    8.917813] ieee80211 phy0: Sending regulatory hint for 00
[    8.917871] ieee80211 phy0: mwl_reg_notifier set=1 driver 00
[    8.917889] ieee80211 phy0: Radio Type ST60 (0x0)
[    8.940422] ieee80211 phy0: Num mac 2 : OTP Version (2)
[    8.958206] ieee80211 phy0: Firmware version: 5.4.41.5
[    8.968199] ieee80211 phy0: Firmware OTP region: ff, country: 00
[    8.974259] ieee80211 phy0: Deep Sleep is disabled
[    8.979114] ieee80211 phy0: 2G enabled, 5G enabled
[    8.983955] ieee80211 phy0: 2 TX antennas, 2 RX antennas. (00000003)/(00000003)
[    9.022264] ieee80211 phy0: WMM Turbo=1
[   13.684830] ieee80211 phy0: mwl_reg_notifier set=1 country element US

Testing WiFi

Checking WiFi interface and setup a network connection

# check phy0 interface is avaliable
root@imx8mpevk:~# iw dev
phy#0
        Interface wlan0
                ifindex 5
                wdev 0x1
                addr c0:ee:40:62:95:30
                type managed
                txpower 20.00 dBm


# add network connection in NetworkManager
nmcli con add con-name "test" ifname wlan0 type wifi ssid "test-network" wifi-sec.key-mgmt wpa-psk wifi-sec.psk "password1" 

# connect to "test" network listed in NetworkManager
nmcli c u "test"

# connection information using: iw wlan0 station dump
root@imx8mpevk:~# iw wlan0 station dump
Station 38:94:ed:0f:d5:07 (on wlan0)
        inactive time:  4044 ms
        rx bytes:       1346474
        rx packets:     5748
        tx bytes:       4378
        tx packets:     44
        tx retries:     0
        tx failed:      0
        beacon loss:    0
        beacon rx:      2742
        rx drop misc:   13
        signal:         -26 dBm
        signal avg:     -27 dBm
        beacon signal avg:      -26 dBm
        tx bitrate:     650.0 MBit/s VHT-MCS 7 80MHz short GI VHT-NSS 2
        tx duration:    0 us
        rx bitrate:     866.7 MBit/s VHT-MCS 9 80MHz short GI VHT-NSS 2
        rx duration:    0 us
        authorized:     yes
        authenticated:  yes
        associated:     yes
        preamble:       long
        WMM/WME:        yes
        MFP:            yes
        TDLS peer:      no
        DTIM period:    3
        beacon interval:100
        short slot time:yes
        connected time: 284 seconds

Checking WiFi performance

To check WiFi performance use iPerf3. The setup used for the test below included a Linux Ubuntu PC connected via Gigabit Ethernet to a consumer router that supports WiFi6. This allows data to flow from the i.MX 8M Plus EVK via WiFi to the router then via Gigabit Ethernet to the Linux Ubuntu PC. The test below uses the Linux Ubuntu PC as the server and the i.MX 8M Plus EVK as the client.

# Server side setup
$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
# Client side setup

root@imx8mpevk:~# iperf3 -c 192.168.1.11
Connecting to host 192.168.1.11, port 5201
[  5] local 192.168.1.58 port 34302 connected to 192.168.1.11 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  42.0 MBytes   352 Mbits/sec    0   2.00 MBytes
[  5]   1.00-2.00   sec  57.5 MBytes   482 Mbits/sec    0   3.08 MBytes
[  5]   2.00-3.00   sec  53.8 MBytes   451 Mbits/sec    0   3.08 MBytes
[  5]   3.00-4.00   sec  56.2 MBytes   472 Mbits/sec    0   3.08 MBytes
[  5]   4.00-5.00   sec  55.0 MBytes   461 Mbits/sec    0   3.08 MBytes
[  5]   5.00-6.00   sec  56.2 MBytes   472 Mbits/sec    0   3.08 MBytes
[  5]   6.00-7.00   sec  57.5 MBytes   482 Mbits/sec    0   3.08 MBytes
[  5]   7.00-8.00   sec  56.2 MBytes   472 Mbits/sec    0   3.08 MBytes
[  5]   8.00-9.00   sec  56.2 MBytes   472 Mbits/sec    0   3.08 MBytes
[  5]   9.00-10.00  sec  56.2 MBytes   472 Mbits/sec    0   3.08 MBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   547 MBytes   459 Mbits/sec    0             sender
[  5]   0.00-10.01  sec   545 MBytes   457 Mbits/sec                  receiver

iperf Done.

*Note WiFi performance will vary based on RF environment, implementation, etc.

Testing Bluetooth

Example of Bluetooth attaching and scanning

btattach -B /dev/ttymxc0 -P h4 -S 3000000 &
[1] 418
Attaching Primary controller to /dev/ttymxc0
[  428.159652] Bluetooth: HCI UART driver ver 2.3
[  428.164128] Bluetooth: HCI UART protocol H4 registered
Switched line discipline from 0 to 15
Device index 0 attached
root@imx8mpevk:~# [  428.279133] Bluetooth: RFCOMM TTY layer initialized
[  428.284061] Bluetooth: RFCOMM socket layer initialized
[  428.289285] Bluetooth: RFCOMM ver 1.11


root@imx8mpevk:~# bluetoothctl
Agent registered
[bluetooth]# power on
[CHG] Controller C0:EE:40:62:95:33 Class: 0x00200000
Changing power on succeeded
[CHG] Controller C0:EE:40:62:95:33 Powered: yes
[bluetooth]# scan on
Discovery started
[CHG] Controller C0:EE:40:62:95:33 Discovering: yes
[NEW] Device 84:2A:FD:29:6F:FB 84-2A-FD-29-6F-FB
[NEW] Device 50:32:37:9A:81:FD 50-32-37-9A-81-FD
[NEW] Device 74:2A:FE:16:E0:E3 74-2A-FE-16-E0-E3
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -86
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -76
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -88
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -76
[CHG] Device 74:2A:FE:16:E0:E3 RSSI: -72
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -85
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -76
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -88
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -75
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -87
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -76
[CHG] Device 74:2A:FE:16:E0:E3 RSSI: -88
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -67
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -76
[CHG] Device 84:2A:FD:29:6F:FB RSSI: -88
[bluetooth]#

Additional Information and Support