wiki:expansion/on-board-wireless

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_DATA03GPIO3_IO09 - must be driven high to enable WiFi functionality (handled by kernel)
    • BT_REG_ON - NAND_DATA02GPIO3_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 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:

~# 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.

Sample output from iw command showing capabilities: CollapsibleStart(EXPAND HERE)

root@jammy-venice:~# iw list
Wiphy phy0
        wiphy index: 0
        max # scan SSIDs: 10
        max scan IEs length: 2048 bytes
        max # sched scan SSIDs: 0
        max # match sets: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports roaming.
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP-128 (00-0f-ac:4)
                * CMAC (00-0f-ac:6)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * P2P-client
                 * P2P-GO
                 * P2P-device
        Band 1:
                Capabilities: 0x1020
                        HT20
                        Static SM Power Save
                        RX HT20 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 16 usec (0x07)
                HT TX/RX MCS rate indexes supported: 0-7
                Bitrates (non-HT):
                        * 1.0 Mbps
                        * 2.0 Mbps (short preamble supported)
                        * 5.5 Mbps (short preamble supported)
                        * 11.0 Mbps (short preamble supported)
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)
                        * 2457 MHz [10] (20.0 dBm)
                        * 2462 MHz [11] (20.0 dBm)
                        * 2467 MHz [12] (disabled)
                        * 2472 MHz [13] (disabled)
                        * 2484 MHz [14] (disabled)
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * start_ap
                 * join_ibss
                 * set_pmksa
                 * del_pmksa
                 * flush_pmksa
                 * remain_on_channel
                 * frame
                 * set_wiphy_netns
                 * set_channel
                 * start_p2p_device
                 * connect
                 * disconnect
                 * crit_protocol_start
                 * crit_protocol_stop
                 * update_connect_params
        software interface modes (can always be added):
        valid interface combinations:
                 * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-G
O } <= 1,
                   total <= 3, #channels <= 2
                 * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P
-device } <= 1,
                   total <= 4, #channels <= 1
        Device supports scan flush.
        max # scan plans: 1
        max scan plan interval: -1
        max scan plan iterations: 0
        Supported TX frame types:
                 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0x
a0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0x
b0 0xc0 0xd0 0xe0 0xf0
                 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90
 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa
0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90
 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
        Supported RX frame types:
                 * managed: 0x40 0xd0
                 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * P2P-client: 0x40 0xd0
                 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * P2P-device: 0x40 0xd0
        Supported extended features:
                * [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
                * [ 4WAY_HANDSHAKE_STA_PSK ]: 4-way handshake with PSK in statio
n mode
                * [ 4WAY_HANDSHAKE_STA_1X ]: 4-way handshake with 802.1X in stat
ion mode
                * [ SAE_OFFLOAD ]: SAE offload support

CollapsibleEnd

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:

[    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

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:

Module Certifications

The module itself has some certifications, but often an 'entire' solution must be certified which includes the antenna, power supply, etc

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_5GPIO1_IO05 - must be driven high to enable WiFi functionality (handled by kernel)
    • BT_REG_ON - PAD_GPIO_2GPIO1_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:

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 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:

~# 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:

[    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:

[    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):
      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 <unistd.h>' and '#include <sys/uio.h>' to the top of the two c files
      make
      cp brcm_patchram_plus /usr/local/bin
      cd ..
      
    • OpenWrt (cross-compile on host):
      # 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:
    # 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 <btmac from ping>
    
Last modified 10 months ago Last modified on 06/09/2023 05:47:32 PM
Note: See TracWiki for help on using the wiki.