[[PageOutline]] [=#sterling-lwb5plus] = Laird Sterling-LWB5+ 2.4/5.8GHz Wifi / Bluetooth module The Laird Connectivity Sterling-LWB5+ is a Wifi5 (IEEE 802.11ac) !WiFi radio with Bluetooth 5.2 Low Energy support. == Module Details The Sterling-LWB5+ 453-00046 module: * CYW4373E chip * 1x MHF4 antenna shared between !WiFi and Bluetooth * WL_REG_ON pin must be driven high to enable !WiFi functionality * BT_REG_ON pin must be driven high to enable Bluetooth functionality * UART bus provides Bluetooth * SDIO bus provides !WiFi == Board Specific Details The Sterling-LWB5+ is installed on the following Gateworks boards: * GW7400 * WL_REG_ON - NAND_DATA03__GPIO3_IO09 - must be driven high to enable !WiFi functionality (handled by kernel) * BT_REG_ON - NAND_DATA02__GPIO3_IO08 - must be driven high to enable Bluetooth functionality (handled by kernel) * UART3 (/dev/ttymxc2) is the Bluetooth UART * SDHC1 (/dev/mmc0) is the SDIO !WiFi bus * GW7300-D+ (replaced the Sterling LWB on previous revisions) * WL_REG_ON - GPIO1_IO05_GPIO1_IO5 - must be driven high to enable !WiFi functionality (handled by kernel) * BT_REG_ON - GPIO1_IO03_GPIO1_IO3 - must be driven high to enable Bluetooth functionality (handled by kernel) * UART3 (/dev/ttymxc2) is the Bluetooth UART * SDHC1 (/dev/mmc0) is the SDIO !WiFi bus == OS Support The following notes pertain to support in various OS BSPs (Note that in all cases firmware and drivers are needed as noted above): * Ubuntu with Gateworks kernel (should also work in mainline kernel): - Bluetooth HCI fully supported - !WiFi client and AP fully supported == Firmware Firmware is needed for both !WiFi device and bluetooth functionality and is loaded by the drivers. **Note:** The script used in debootstrap for creating our Ubuntu prebuilt images installs the linux-firmware package before this driver is downloaded and extracted. When "apt-get update" is ran it will overwrite the 3rd party driver causing an error when the Laird modules are loaded. Reference [https://github.com/Gateworks/ubuntu-rootfs/blob/master/ubuntu-rootfs.sh this link]. == Drivers === !WiFi The SDIO !WiFi functionality is supported by the mainline {{{brcmfmac}}} (Full MAC) driver present in Linux 4.1+ kernel drivers: - CONFIG_CFG80211 / CONFIG_WLAN / CONFIG_NETDEVICES / CONFIG_WLAN_VENDOR_BROADCOM - CONFIG_BRCMUTIL (brcmutil.ko) (selected when you enable BRCMFMAC) - CONFIG_BRCMFMAC (brcmfmac.ko) - CONFIG_BRCMFMAC_SDIO=y (static; selects BRCMFMAC_PROTO_BCDC and FW_LOADER) On the Gateworks kernels these are all enabled and you see the following: {{{#!bash ~# dmesg | grep mmc0 root@jammy-venice:~# dmesg | grep mmc0 [ 1.284402] mmc0: SDHCI controller on 30b40000.mmc [30b40000.mmc] using ADMA [ 1.404929] mmc0: new ultra high speed SDR104 SDIO card at address 0001 [ 9.249611] brcmfmac mmc0:0001:1: Direct firmware load for brcm/brcmfmac4373- sdio.gateworks,imx8mp-gw74xx.bin failed with error -2 [ 9.254288] brcmfmac mmc0:0001:1: Direct firmware load for brcm/brcmfmac4373- sdio.gateworks,imx8mp-gw74xx.txt failed with error -2 ~# dmesg | grep brcm [ 9.238520] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4373-sdio fo r chip BCM4373/0 [ 9.249611] brcmfmac mmc0:0001:1: Direct firmware load for brcm/brcmfmac4373- sdio.gateworks,imx8mp-gw74xx.bin failed with error -2 [ 9.251931] usbcore: registered new interface driver brcmfmac [ 9.254288] brcmfmac mmc0:0001:1: Direct firmware load for brcm/brcmfmac4373- sdio.gateworks,imx8mp-gw74xx.txt failed with error -2 [ 9.284004] Bluetooth: hci0: BCM4373A0 'brcm/BCM4373A0.hcd' Patch [ 11.373370] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4373-sdio fo r chip BCM4373/0 [ 11.388516] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4373/0 wl0: Oct 8 2021 09:44:25 version 13.10.246.261 (4410652 CY) FWID 01-9585ba52 }}} * Note the 'brcmf_fw_alloc_request' failures are normal as the driver attempts to load board-specific firmware first which fails before a generic firmware is loaded If you have the need for software support LAIRD has a driver package on their website that consists of a Linux backports driver with patches as well as patches for wpa_supplicant and hostapd. These are derived from periodic code-drops they get from Cypress and not all of these patches make it upstream. === Bluetooth Bluetooth functionality is provided by a UART based Bluetooth HCI (Host Controller Interface). kernel drivers: * CONFIG_BT (bluetooth support; bt.ko if module) * CONFIG_BT_HCIUART (UART based HCI support; hci_uart.ko if module) * CONFIG_BT_HCIUART_BCM (Broadcom protocol support) If using a Linux 5.0+ kernel the HCI should be brought up {{{/sys/class/bluetooth/hci0}}} and configured via device-tree bindings if there is a node with a compatible string of 'brcm,bcm4330-bt'. If such bindings exist the kernel will attempt to load firmware patches from {{{/lib/firmware/brcm/BCM4373A0.hcd}}}. This looks like the following in kernel log: {{{#!bash [ 8.724500] Bluetooth: Core ver 2.22 [ 8.724601] Bluetooth: HCI device and connection manager initialized [ 8.724617] Bluetooth: HCI socket layer initialized [ 8.724624] Bluetooth: L2CAP socket layer initialized [ 8.724640] Bluetooth: SCO socket layer initialized [ 8.852049] Bluetooth: HCI UART driver ver 2.3 [ 8.852071] Bluetooth: HCI UART protocol H4 registered [ 8.852076] Bluetooth: HCI UART protocol BCSP registered [ 8.867795] Bluetooth: HCI UART protocol LL registered [ 8.867816] Bluetooth: HCI UART protocol ATH3K registered [ 8.867870] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 8.868056] Bluetooth: HCI UART protocol Intel registered [ 8.868227] Bluetooth: HCI UART protocol Broadcom registered [ 8.868290] Bluetooth: HCI UART protocol QCA registered [ 8.868295] Bluetooth: HCI UART protocol AG6XX registered [ 8.868339] Bluetooth: HCI UART protocol Marvell registered [ 9.257710] Bluetooth: hci0: BCM: chip id 135 [ 9.260024] Bluetooth: hci0: BCM: features 0x0f [ 9.282874] Bluetooth: hci0: BCM4373A0 [ 9.282898] Bluetooth: hci0: BCM4373A0 (001.001.025) build 0000 [ 9.284004] Bluetooth: hci0: BCM4373A0 'brcm/BCM4373A0.hcd' Patch [ 10.452359] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 10.452380] Bluetooth: BNEP filters: protocol multicast [ 10.452397] Bluetooth: BNEP socket layer initialized [ 14.250502] Bluetooth: hci0: CYW94373 UART 37.4MHz Class 1 wlbga sLNA-0090 [ 14.250525] Bluetooth: hci0: BCM4373A0 (001.001.025) build 0128 }}} [=#sterling-lwb] = Laird Sterling-LWB 2.4GHz Wifi / Bluetooth module (450-0148) The Laird Connectivity Sterling-LWB 450-0148 is a Wifi4 (IEEE 802.11n) !WiFi radio with BT 2.1+EDR and BLE 4.2 connectivity module with a single external U.FL antenna port. == Module Details The Sterling-LWB 450-0148 module: * BCM43430 chip * 1x U.FL antenna shared between !WiFi and Bluetooth * WL_REG_ON pin must be driven high to enable !WiFi functionality * BT_REG_ON pin must be driven high to enable Bluetooth functionality * UART bus provides Bluetooth * SDIO bus provides !WiFi References: * [http://dev.gateworks.com/datasheets/sterling-lwb.pdf Datasheet] * https://www.lairdconnect.com/wireless-modules/wifi-modules-bluetooth/sterling-lwb == Module Certifications The module itself has some certifications, but often an 'entire' solution must be certified which includes the antenna, power supply, etc * [https://www.lairdconnect.com/wireless-modules/wifi-modules-bluetooth/sterling-lwb-24-ghz-wifi-module Sterling page] * [https://connectivity-staging.s3.us-east-2.amazonaws.com/2019-03/LWBCert.pdf Certification Guide] * [https://www.lairdconnect.com/wireless-modules/wifi-modules-bluetooth/sterling-lwb-24-ghz-wifi-module#certified-antennas Certified Antennas] == Board Specific Details The Sterling-LWB is installed on the following Gateworks boards: * GW7300-A/B/C (replaced with the Sterling LWB on revD+) * WL_REG_ON - GPIO1_IO05_GPIO1_IO5 - must be driven high to enable !WiFi functionality (handled by kernel) * BT_REG_ON - GPIO1_IO03_GPIO1_IO3 - must be driven high to enable Bluetooth functionality (handled by kernel) * UART3 (/dev/ttymxc2) is the Bluetooth UART * SDHC1 (/dev/mmc0) is the SDIO !WiFi bus * GW5910 * WL_REG_ON - PAD_GPIO_5__GPIO1_IO05 - must be driven high to enable !WiFi functionality (handled by kernel) * BT_REG_ON - PAD_GPIO_2__GPIO1_IO02 - must be driven high to enable Bluetooth functionality (handled by kernel) * UART4 (/dev/ttymxc3) is the Bluetooth UART * SDHC2 (/dev/mmcblk0) is the SDIO !WiFi bus (Note that the microSD is on SDHC3 thus appears to the kernel as /dev/mmcblk1 - this must be taken into account if mounting the root filesystem from microSD) == OS Support The following notes pertain to support in various OS BSPs (Note that in all cases firmware and drivers are needed as noted above): * Ubuntu with Gateworks kernel (should also work in mainline kernel): - Bluetooth HCI fully supported - !WiFi client and AP fully supported * Gateworks !OpenWrt 20.06 (Linux 5.4.45) - Bluetooth HCI fully supported - !WiFi client and AP fully supported * Gateworks !OpenWrt 16.02 (Linux 4.4) - Bluetooth HCI fully supported (need provide cross-compiled brcm_patchram_plus) - !WiFi: **does not work - brcmfmac from this kernel will crash** == Firmware Firmware is needed for !WiFi device functionality and it is loaded by the drivers. While firmware is not needed for Bluetooth functionality providing it will provide fixes and additional functionality over what is already programmed into the device. Note that there are different firmware releases depending on your regulatory domain and these are available from LAIRD at https://www.lairdconnect.com/wireless-modules/wi-fi-bt-modules/sterling-lwb Example Firmware Installation: {{{#!bash tar xvf firmware-7.0.0.326.tar.bz2 mkdir -p /lib/firmware/brcm cp -ra lib/firmware/brcm/* /lib/firmware/brcm }}} - 480-0079.zip - FCC firmware: - 480-0080.zip - ETSI firmware - 480-0116.zip - Giteki firmware **Note:** The script used in debootstrap for creating our Ubuntu prebuilt images installs the linux-firmware package before this driver is downloaded and extracted. When "apt-get update" is ran it will overwrite the 3rd party driver causing an error when the Laird modules are loaded. Reference [https://github.com/Gateworks/ubuntu-rootfs/blob/master/ubuntu-rootfs.sh this link]. == Drivers === !WiFi The SDIO !WiFi functionality is supported by the mainline {{{brcmfmac}}} (Full MAC) driver present in Linux 4.1+ kernel drivers: - CONFIG_CFG80211 / CONFIG_WLAN / CONFIG_NETDEVICES / CONFIG_WLAN_VENDOR_BROADCOM - CONFIG_BRCMUTIL (brcmutil.ko) (selected when you enable BRCMFMAC) - CONFIG_BRCMFMAC (brcmfmac.ko) - CONFIG_BRCMFMAC_SDIO=y (static; selects BRCMFMAC_PROTO_BCDC and FW_LOADER) On the Gateworks kernels these are all enabled and you see the following: {{{#!bash ~# dmesg | grep mmc0 [ 9.146576] mmc0: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA [ 9.184003] mmc0: queuing unknown CIS tuple 0x80 (2 bytes) [ 9.191715] mmc0: queuing unknown CIS tuple 0x80 (3 bytes) [ 9.199259] mmc0: queuing unknown CIS tuple 0x80 (3 bytes) [ 9.216072] mmc0: queuing unknown CIS tuple 0x80 (7 bytes) [ 9.345290] mmc0: new high speed SDIO card at address 0001 ~# dmesg | grep brcm ~# dmesg | grep brcm [ 16.537056] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1 [ 16.546999] usbcore: registered new interface driver brcmfmac [ 16.717595] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1 [ 16.742359] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Sep 11 2018 09:22:09 version 7.45.98.65 (r707797 CY) FWID 01-b54727f }}} If you have the need for software support LAIRD has a driver package on their website that consists of a Linux backports driver with patches as well as patches for wpa_supplicant and hostapd. These are derived from periodic code-drops they get from Cypress and not all of these patches make it upstream. === Bluetooth Bluetooth functionality is provided by a UART based Bluetooth HCI (Host Controller Interface). kernel drivers: * CONFIG_BT (bluetooth support; bt.ko if module) * CONFIG_BT_HCIUART (UART based HCI support; hci_uart.ko if module) * CONFIG_BT_HCIUART_BCM (Broadcom protocol support) If using a Linux 5.0+ kernel the HCI should be brought up {{{/sys/class/bluetooth/hci0}}} and configured via device-tree bindings if there is a node with a compatible string of 'brcm,bcm4330-bt'. If such bindings exist the kernel will attempt to load firmware patches from {{{/lib/firmware/brcm/BCM43430A1.hcd}}}. This looks like the following in kernel log: {{{#!bash [ 8.123246] Bluetooth: Core ver 2.22 [ 8.123338] Bluetooth: HCI device and connection manager initialized [ 8.123357] Bluetooth: HCI socket layer initialized [ 8.123373] Bluetooth: L2CAP socket layer initialized [ 8.123388] Bluetooth: SCO socket layer initialized [ 8.191235] Bluetooth: HCI UART driver ver 2.3 [ 8.194993] Bluetooth: HCI UART protocol Broadcom registered [ 8.550960] Bluetooth: hci0: BCM: chip id 94 [ 8.554052] Bluetooth: hci0: BCM: features 0x2e [ 8.577738] Bluetooth: hci0: BCM43430A1 [ 8.577755] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000 [ 8.577899] Bluetooth: hci0: BCM: btbcm_patchram [ 12.044095] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0182 }}} If you see messages regarding 'brcm/BCM43430A1.hcd' not found this means that the patchram firmware could not be located on your filesystem. Note that hci_uart should be compiled as a kernel module if you need to load this firmware: {{{#!bash [ 8.577899] bluetooth hci0: Direct firmware load for brcm/BCM43430A1.hcd failed with error -2 [ 8.577910] Bluetooth: hci0: BCM: Patch brcm/BCM43430A1.hcd not found }}} The benefits of the BCM43430A1.hcd patchram firmware over the firmware already inside the part is that additionally functionality is added over time and security vulnerabilities are resolved. If you have an older kernel or are missing the 'brcm,bcm4330-bt' device-tree binding you can use the {{{brcm_patchram_plus}}} utility to load a firmware via Linux userspace and register the HCI device with the kernel: * Building: - Ubuntu (on target): {{{#!bash wget https://github.com/LairdCP/brcm_patchram/archive/brcm_patchram_plus_1.1.tar.gz tar xvf brcm_patchram_plus_1.1.tar.gz cd brcm_patchram-brcm_patchram_plus_1.1 apt install build-essential libbluetooth-dev # add '#include ' and '#include ' to the top of the two c files make cp brcm_patchram_plus /usr/local/bin cd .. }}} - !OpenWrt (cross-compile on host): {{{#!bash # setup OpenWrt toolchain env TOOLCHAIN_DIR=/opt/openwrt/16.02-imx6 TOOLCHAIN=toolchain-arm_cortex-a9+neon_gcc-5.2.0_musl-1.1.12_eabi PATH=$PATH:$TOOLCHAIN_DIR/$TOOLCHAIN/bin export STAGING_DIR=$TOOLCHAIN_DIR arm-openwrt-linux-gcc -I$TOOLCHAIN_DIR/$TOOLCHAIN/ brcm_patchram_plus.c -o brcm_patchram_plus }}} * Bringing up Bluetooth: {{{#!bash # load firmware and enable the hci over /dev/ttymxc3 brcm_patchram_plus -d \ --patchram lib/firmware/brcm/4343w.hcd \ --enable_hci --no2bytes --tosleep 1000 /dev/ttymxc3 & # hci should now be there hciconfig # bring up interface hciconfig hci0 up # scan hcitool scan # ping l2ping -c 3 }}}