[[PageOutline]] = Laird Sterling-LWB 2.4GHz Wifi / Bluetooth module (450-0148) The Laird Connectivity Sterling-LWB 450-0148 is a IEEE 802.11 b/g/n !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 - for SDIO based !WiFi * 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] [=#hardware] == Board Specific Details * 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) [=#firmware] == Firmware Firmware is needed for device functionality and it is loaded by the drivers. Several files are needed and depend on your regulatory domain: {{{#!bash apt install unzip wget http://dev.gateworks.com/images/firmware/sterling-lwb/480-0079.zip unzip 480-0079.zip unzip 480-0079-6.0.0.121.zip tar xvf 480-0079.tar.bz2 mkdir -p /lib/firmware/brcm cp -ra lib/firmware/brcm/* /lib/firmware/brcm ln -sf 4343w.hcd /lib/firmware/brcm/BCM43430A1.hcd }}} - 480-0079.zip - FCC firmware: - 480-0080.zip - ETSI firmware - 480-0116.zip - Giteki firmware [=#drivers] == Drivers [=#wifi] === !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 root@bionic-armhf:~# 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 root@bionic-armhf:~# dmesg | grep brcm root@bionic-armhf:~# 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 }}} [=#bluetooth] === 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 }}} It is not entirely clear what the benefits are of the BCM43430A1.hcd firmware over the firmware already inside the part. If the firmware is not found, the HCI interface is still registered with the kernel and appears to work. 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 }}} [=#os] == 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): - BT HCI: works - !WiFi: client mode works, AP untested * !OpenWrt master (Linux 4.19) - BT HCI: works - !WiFi: works * !OpenWrt 16.02 (Linux 4.4) - BT HCI: works (need provide cross-compiled brcm_patchram_plus) - !WiFi: **does not work - brcmfmac from this kernel will crash**