Introduction

This guide provides “from-scratch” guidelines on how to integrate Laird Connectivity’s lrd-11 software releases for our 60-series radios with NXPs Yocto environment.

In this example, we’ll integrate the ST60-2230C radio with the NXP iMX8Mplus-LPDDR4 DVK.

Table 1: ST60 variants

Part Number Form Factor WLAN BT
ST60-2230C M.2 2230 SDIO UART
ST60-2230C-SS M.2 2230 SDIO SDIO
ST60-2230C-P M.2 2230 PCIE UART
ST60-2230C-PU M.2 2230 SDIO USB
ST60-2230C-U M.2 2230 USB UART
ST60-2230C-UU M.2 2230 USB USB
ST60-SIPT 13 x14mm System in Package see datasheet for strapping options see datasheet for strapping options

Requirements

  • iMX8MP DVK (or other platform with E-key M.2 interface with respective interfaces for WLAN and BT. See Table 1)

  • One of above mentioned ST60 M.2 cards or 60-SIPT DVK.

  • Linux Development PC with Internet access for Yocto build environment.

  • Terminal software for console access to target platform.

Building Initial Linux Image

On your Linux development PC, install the Yocto build environment for your desired target for your desired kernel version.

In this guide, we’ll be using:

NXP i.MX Yocto Project User's Guide Rev. (IMXLXYOCTOUG) LF6.1.36_2.1.0 — 29 September 2023

https://www.nxp.com/docs/en/user-guide/IMX_YOCTO_PROJECT_USERS_GUIDE.pdf

Note: On the build PC in this guide Ubuntu 20.04 was used as the Linux distribution.

Build the first image for your target by following the instructions in the in above mentioned user guide.

Figure 1: Successful initialization of repo

Figure 2: Setup of distribution

Figure 3: Start building the Linux image

Figure 4: Successful build

Placing Yocto Layer into Build Environment and setting it up

  1. The Yocto Layer can be found here:

    https://github.com/LairdCP/meta-summit-radio/tree/master

  2. Place the Laird Yocto Layer into the “sources” directory of your Yocto build environment:

    alex@vmware:~/Projects/yocto/imx-6.1.36-2.1.0/sources$ git clone https://github.com/LairdCP/meta-summit-radio.git
    Cloning into 'meta-summit-radio'...
    remote: Enumerating objects: 1658, done.
    remote: Counting objects: 100% (123/123), done.
    remote: Compressing objects: 100% (37/37), done.
    remote: Total 1658 (delta 90), reused 99 (delta 84), pack-reused 1535
    Receiving objects: 100% (1658/1658), 267.85 KiB | 4.62 MiB/s, done.
    Resolving deltas: 100% (1046/1046), done.
    	
    alex@vmware:~/Projects/yocto/imx-6.1.36-2.1.0/sources $ ls
    base meta-browser meta-freescale meta-freescale-distro
    meta-nxp-demo-experience meta-qt6 meta-summit-radio
    meta-virtualization meta-arm meta-clang meta-freescale-3rdparty
    meta-imx meta-openembedded meta-security meta-timesys poky
    
    alex@vmware:~/Projects/yocto/imx-6.1.36-2.1.0/sources$ cd meta-summit-radio
    	
    alex@vmware:~/Projects/yocto/imx-6.1.36-2.1.0/sources/meta-summit-radio$ git checkout lrd-11.39.0.x
    	
    alex@vmware:~/Projects/yocto/imx-6.1.36-2.1.0/sources/meta-summit-radio$ ls
    	
    COPYING.MIT meta-summit-radio meta-summit-radio-pre-3.4
    radio-stack-4550-hashes.inc radio-stack-60-hashes.inc
    radio-stack-lwb-hashes.inc README tools
    

    Note: Please consult the README file in the default tree of the meta-summit-radio layer as of which branch to check out as the latest release. In above example “lrd-11.39.0.x” was used.

  3. Adapt kernel config

    alex@vmware:~/Projects/yocto/imx-6.1.36-2.1.0/build_imX8mp$ bitbake -c menuconfig virtual/kernel
    

    Now make the following changes to the default linux-imx kernel config

    Note: Follow the path or make use of the / search mechanism in menuconfig to find the respective symbols.

    To allow backports to replace the inherent Bluetooth and Wireless (Wifi) drivers:

    Networking support --->
    < > Bluetooth
    	
    Networking support ---> Wireless
    <M> cfg80211
    

    Note: <M> is required due to a change in kernel 5.19. The main kernel config, as of 5.19, now requires that cfg80211 be included so that the networking core layer is able to support an external cfg80211 module.

    To add in necessary cryptographic addition:

    Cryptographic API ---> CRCs (cyclic redundancy checks) --->
    <*> CRC32
    Device Driver ---> PCI Support
    [*] PCI Express Advanced Error Reporting support
    

    To avoid a long delay at boot time:

    Device drivers --> Generic Driver options --> Firmware loader -->
    [ ] Enable the firmware sysfs fallback mechanism
    Device Drivers ---> DMA Engine support --->
    <M> i.MX **S**DMA support
    
  4. Include the Laird meta-summit-radio layer in your bblayers.conf file in the “conf” directory of your Yocto build environment:

    BBLAYERS = " \
    	
        ${BSPDIR}/sources/poky/meta \
        ${BSPDIR}/sources/poky/meta-poky \
        \
        ${BSPDIR}/sources/meta-openembedded/meta-oe \
        ${BSPDIR}/sources/meta-openembedded/meta-multimedia \
        ${BSPDIR}/sources/meta-openembedded/meta-python \
        \
        ${BSPDIR}/sources/meta-freescale \
        ${BSPDIR}/sources/meta-freescale-3rdparty \
        ${BSPDIR}/sources/meta-freescale-distro \
        ${BSPDIR}/sources/meta-summit-radio/meta-summit-radio \
    "
    
  5. Modify the local.conf file in the “conf” directory of your Yocto build environment to include the required packages. At the end of the file add:

     CORE_IMAGE_EXTRA_INSTALL += "\
     packagegroup-tools-bluetooth \
     packagegroup-fsl-tools-audio \
     pulseaudio \
     firmware-imx-sdma-imx7d \
     kernel-module-imx-sdma \
     hostapd \
     ethtool \
     iperf3 \
     tcpdump \
     iw \
     kernel-module-60-backports-summit \
     60-radio-firmware-sdio-uart \
     bt-uart-scripts \
     summit-supplicant-60 \
     summit-supplicant-libs-60 \
     adaptive-ww \
     summit-networkmanager-60 \
     summit-networkmanager-60-nmcli \
     "
    
     PREFERRED_RPROVIDER_wpa-supplicant = "summit-supplicant-60"
     PREFERRED_RPROVIDER_wpa-supplicant-cli = "summit-supplicant-60"
     PREFERRED_RPROVIDER_wpa-supplicant-passphrase = "summit-supplicant-60"
    
     PREFERRED_RPROVIDER_wireless-regdb-static = "60-radio-firmware-sdio-uart"
    
     BT_SERIAL_PORT="/dev/ttymxc0"
    

    Note: Entries between CORE_IMAGE_EXTRA_INSTALL += "\ and kernel-module-60-backports-summit \ are optional but recommended for a good user experience.

  6. Make device tree change to remove the serdev setting for UART1 to allow for serial interface “/dev/ttymxc0” to be created and re-compile the kernel

    in file

    /home/alex/Projects/yocto/6.1.36_2.1.0/build/tmp/work-shared/imx8mp-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mp-evk.dts
    

    remove the lines in red and the blank line above in the UART1 node in the device tree:

    &uart1 { /* BT */
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart1>;
        assigned-clocks = <&clk IMX8MP_CLK_UART1>;
        assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_80M>;
        fsl,uart-has-rtscts;
        status = "okay";
    
        bluetooth {
            compatible = "nxp,88w8997-bt";
        };
    };
    

    and recompile the kernel

    bitbake linux-imx -f -c compile
    

    Note: these changes are not permanent and need to be re-done after a clean build.

  7. Build core-image-minimal image

    bitbake core-image-base
    

    Figure 5: successful build

  8. Program a SD card with the newly generated image including kernel and root file system.

    alex@vmware:~/Projects/yocto/imx-6.1.36-2.1.0/build_imX8mp/tmp/deploy/images/imx8mp-lpddr4-evk\$ zstd -d core-image-base-imx8mp-lpddr4-evk-20231102140058.rootfs.wic.zst
    core-image-base-imx8mp-lpddr4-evk-20231102140058.rootfs.wic.zst:
    939092992 bytes
    	
    alex@vmware:~/Projects/yocto/imx-6.1.36-2.1.0/build_imX8mp/tmp/deploy/images/imx8mp-lpddr4-evk\$ ls \*.wic
    core-image-base-imx8mp-lpddr4-evk-20231102140058.rootfs.wic
    	
    sudo dd if= core-image-base-imx8mp-lpddr4-evk-20231102140058.rootfs.wic
    of=/dev/mmcblk0 bs=1M
    
  9. Change Device Tree blob in U-Boot to enable SDIO.

    When booting for the first time wait for the

    Hit any key to stop autoboot: 3
    

    message in the console window and hit a key. Then at the u-boot prompt:

    u-boot=> pri fdtfile <enter>
    fdtfile=imx8mp-evk-revb4.dtb
    u-boot=> setenv fdtfile imx8mp-evk-usdhc1-m2.dtb <enter>
    u-boot=> saveenv <enter>
    Saving Environment to MMC... Writing to MMC(1)... OK
    u-boot=> pri fdtfile <enter>
    fdtfile=imx8mp-evk-usdhc1-m2.dtb
    u-boot=> boot <enter>
    

Verifying functionality

After boot-up enter user name “root” and issue below commands to observe the presence of the Wifi and the Bluetooth interface.

imx8mp-lpddr4-evk login: root
root@imx8mp-lpddr4-evk:~# iw dev
phy#0
	Interface wlan0
		ifindex 5
		wdev 0x1
		addr c0:ee:40:62:30:ec
		type managed
		txpower 20.00 dBm

root@imx8mp-lpddr4-evk:~# bluetoothctl power on
[CHG] Controller C0:EE:40:62:30:EF Class: 0x00200000
Changing power on succeeded

Now, available board tools can be used to operate Wifi and Bluetooth.