| 1 | [[PageOutline]] |
| 2 | |
| 3 | = Laird Sterling-LWB 2.4GHz Wifi / Bluetooth module (450-0148) |
| 4 | 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. |
| 5 | |
| 6 | == Module Details |
| 7 | The Sterling-LWB 450-0148 module: |
| 8 | * BCM43430 - for SDIO based !WiFi |
| 9 | * 1x U.FL antenna shared between !WiFi and Bluetooth |
| 10 | * WL_REG_ON pin must be driven high to enable !WiFi functionality |
| 11 | * BT_REG_ON pin must be driven high to enable Bluetooth functionality |
| 12 | * UART bus provides Bluetooth |
| 13 | * SDIO bus provides !WiFi |
| 14 | |
| 15 | References: |
| 16 | * [http://dev.gateworks.com/datasheets/sterling-lwb.pdf Datasheet] |
| 17 | * https://www.lairdconnect.com/wireless-modules/wifi-modules-bluetooth/sterling-lwb |
| 18 | |
| 19 | == Board Specific Details |
| 20 | * GW5910 |
| 21 | * WL_REG_ON - PAD_GPIO_5__GPIO1_IO05 - driven high by reg_wl in Kernel to enable !WiFi functionality |
| 22 | * BT_REG_ON - PAD_GPIO_2__GPIO1_IO02 - driven high by reg_bt in Kernel to enable Bluetooth functionality |
| 23 | * UART4 (/dev/ttymxc3) is the Bluetooth UART |
| 24 | * 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) |
| 25 | |
| 26 | == Firmware |
| 27 | Firmware is needed for device functionality and it is loaded by the drivers. Several files are needed and depend on your regulatory domain: |
| 28 | {{{#!bash |
| 29 | apt install unzip |
| 30 | wget http://dev.gateworks.com/images/firmware/sterling-lwb/480-0079.zip |
| 31 | unzip 480-0079.zip |
| 32 | unzip 480-0079-6.0.0.121.zip |
| 33 | tar xvf 480-0079.tar.bz2 |
| 34 | mkdir -p /lib/firmware/brcm |
| 35 | cp -ra lib/firmware/brcm/* /lib/firmware/brcm |
| 36 | }}} |
| 37 | - 480-0079.zip - FCC firmware: |
| 38 | - 480-0080.zip - ETSI firmware |
| 39 | - 480-0116.zip - Giteki firmware |
| 40 | |
| 41 | == Drivers |
| 42 | |
| 43 | === !WiFi |
| 44 | |
| 45 | ==== Mainline kernel |
| 46 | The SDIO !WiFi functionality is supported by the mainline {{{brcmfmac}}} (Full MAC) driveri n Linux 4.1+ |
| 47 | |
| 48 | kernel drivers: |
| 49 | - CONFIG_CFG80211 / CONFIG_WLAN / CONFIG_NETDEVICES / CONFIG_WLAN_VENDOR_BROADCOM |
| 50 | - CONFIG_BRCMUTIL (brcmutil.ko) (selected when you enable BRCMFMAC) |
| 51 | - CONFIG_BRCMFMAC (brcmfmac.ko) |
| 52 | - CONFIG_BRCMFMAC_SDIO=y (static; selects BRCMFMAC_PROTO_BCDC and FW_LOADER) |
| 53 | |
| 54 | On the Gateworks 4.20 kernel these are all enabled and you see the following: |
| 55 | {{{#!bash |
| 56 | root@bionic-armhf:~# dmesg | grep mmc0 |
| 57 | [ 9.146576] mmc0: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA |
| 58 | [ 9.184003] mmc0: queuing unknown CIS tuple 0x80 (2 bytes) |
| 59 | [ 9.191715] mmc0: queuing unknown CIS tuple 0x80 (3 bytes) |
| 60 | [ 9.199259] mmc0: queuing unknown CIS tuple 0x80 (3 bytes) |
| 61 | [ 9.216072] mmc0: queuing unknown CIS tuple 0x80 (7 bytes) |
| 62 | [ 9.345290] mmc0: new high speed SDIO card at address 0001 |
| 63 | |
| 64 | root@bionic-armhf:~# dmesg | grep brcm |
| 65 | root@bionic-armhf:~# dmesg | grep brcm |
| 66 | [ 16.537056] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1 |
| 67 | [ 16.546999] usbcore: registered new interface driver brcmfmac |
| 68 | [ 16.717595] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1 |
| 69 | [ 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 |
| 70 | }}} |
| 71 | |
| 72 | |
| 73 | |
| 74 | ==== LSR out-of-tree Linux backports driver |
| 75 | LSR has driver downloads in the form of linux backports as well as firmware binaries on the [https://www.lsr.com/embedded-wireless-modules/wifi-plus-bluetooth-module/sterling-lwb#product-software Product Page] |
| 76 | |
| 77 | They have a linux backports driver with source tarballs on their site. I'm not clear what kernels it supports but it appears that 930-0075.zip which I used here supports up to 4.14. |
| 78 | |
| 79 | It appears they have a github account with more up-to-date driver backport releases: |
| 80 | - https://github.com/LairdCP/Sterling-60-Release-Packages/releases |
| 81 | |
| 82 | Building out-of-tree LAIRD Linux backports !WiFi drivers (930-0075.zip): |
| 83 | {{{#!bash |
| 84 | wget http://dev.gateworks.com/images/firmware/sterling-lwb/930-0075.zip |
| 85 | unzip 930-0075.zip |
| 86 | tar xvf backports-laird-6.0.0.121.tar.bz2 |
| 87 | cd laird-backport-6.0.0.121/ |
| 88 | export CROSS_COMPILE=<prefix of cross toolchain in path> |
| 89 | export KLIB_BUILD=<directory of kernel build> |
| 90 | export ARCH="arm" |
| 91 | #make defconfig-lwb-etsi # config for ETSI |
| 92 | #make defconfig-lwb-jp # config for Giteki |
| 93 | make defconfig-lwb-fcc # conifg for FCC |
| 94 | make |
| 95 | }}} |
| 96 | - results in brcmfmac.ko brcmutil.ko cfg80211.ko |
| 97 | - these likely only work when used with a kernel that has support for brcmfmac disabled |
| 98 | |
| 99 | |
| 100 | |
| 101 | === Bluetooth |
| 102 | You will need the {{{brcm_patchram_plus}}} utility to load a firmware at runtime. |
| 103 | |
| 104 | Building: |
| 105 | * Ubuntu (on target): |
| 106 | {{{#!bash |
| 107 | wget https://github.com/LairdCP/brcm_patchram/archive/brcm_patchram_plus_1.1.tar.gz |
| 108 | tar xvf brcm_patchram_plus_1.1.tar.gz |
| 109 | cd brcm_patchram-brcm_patchram_plus_1.1 |
| 110 | apt install build-essential libbluetooth-dev |
| 111 | # add '#include <unistd.h>' and '#include <sys/uio.h>' to the top of the two c files |
| 112 | make |
| 113 | cp brcm_patchram_plus brcm_patchram_plus_usb /usr/local/bin |
| 114 | cd .. |
| 115 | }}} |
| 116 | * !OpenWrt (cross-compile on host): |
| 117 | {{{#!bash |
| 118 | # setup OpenWrt toolchain env |
| 119 | TOOLCHAIN_DIR=/opt/openwrt/16.02-imx6 |
| 120 | TOOLCHAIN=toolchain-arm_cortex-a9+neon_gcc-5.2.0_musl-1.1.12_eabi |
| 121 | PATH=$PATH:$TOOLCHAIN_DIR/$TOOLCHAIN/bin |
| 122 | export STAGING_DIR=$TOOLCHAIN_DIR |
| 123 | arm-openwrt-linux-gcc -I$TOOLCHAIN_DIR/$TOOLCHAIN/ brcm_patchram_plus.c -o brcm_patchram_plus |
| 124 | }}} |
| 125 | |
| 126 | |
| 127 | Bringing up Bluetooth: |
| 128 | {{{#!bash |
| 129 | # load firmware |
| 130 | brcm_patchram_plus -d \ |
| 131 | --patchram lib/firmware/brcm/4343w.hcd \ |
| 132 | --enable_hci --no2bytes --tosleep 1000 /dev/ttymxc3 & |
| 133 | # hci should now be there |
| 134 | hciconfig |
| 135 | # bring up interface |
| 136 | hciconfig hci0 up |
| 137 | # scan |
| 138 | hcitool scan |
| 139 | # ping |
| 140 | l2ping -c 3 <btmac from ping> |
| 141 | }}} |
| 142 | |
| 143 | |
| 144 | |
| 145 | == OS Support |
| 146 | The following notes pertain to support in various OS BSPs (Note that in all cases firmware and drivers are needed as noted above): |
| 147 | * Ubuntu with Gateworks 4.20 kernel (should also work in mainline kernel): |
| 148 | - BT HCI: works |
| 149 | - SDIO !WiFi: client mode works, AP untested |
| 150 | * !OpenWrt master (Linux 4.19) |
| 151 | - BT HCI: works |
| 152 | - SDIO !WiFi: works |
| 153 | * !OpenWrt 16.02 (Linux 4.4) |
| 154 | - BT HCI: works (need provide cross-compiled brcm_patchram_plus) |
| 155 | - SDIO !WiFi: **does not work - brcmfmac from this kernel will crash** |