works Version 0.22.11-t88, tested on FreeBSD 15.1-RELEASE-p7. Source: spagu/freebsd-rpi-wifi.
Boards and chips
| Board | Chip | Bands | Status |
|---|---|---|---|
| Pi 4 Model B Rev 1.4 | CYW43455 | 2.4 + 5 GHz | tested |
| Pi 5 Model B (UEFI firmware v0.3) | CYW43455 | 2.4 + 5 GHz | tested |
| Pi Zero 2 W Rev 1.0 | 43430 family | 2.4 GHz | tested |
| Other Pi 4 revisions, Pi 400, CM4, Pi 3 B+/A+, CM5, Pi 500 | CYW43455 / 43456 | expected to work, report wanted | |
| Pi 3 Model B | needs a board profile first |
The module creates the net80211 device cywfm0; a wlan0 goes on top of it as with any other FreeBSD wireless card. It speaks SDIO through its own layer on the classic MMC stack, so kernels built with options MMCCAM are not supported.
Option A: prepare a fresh SD card
The tools/prepare-card.sh script copies the module, firmware and network settings onto a card freshly written with the FreeBSD image.
Write the FreeBSD 15.1 RPI image to the card (see Before starting).
From a FreeBSD computer, mount both partitions and run the script. The board then joins the network on first boot.
mkdir -p /mnt/fat /mnt/root mount -t msdosfs /dev/da0s1 /mnt/fat mount /dev/da0s2a /mnt/root tools/prepare-card.sh -b zero2w -m /mnt/fat -r /mnt/root -s "network name" -c GB umount /mnt/fat /mnt/rootUse
-b pi4or-b pi5for the other boards and the two-letter country code after-c.From Windows the PowerShell version can only reach the FAT partition:
powershell -ExecutionPolicy Bypass -File tools\prepare-card.ps1 -Board pi4 -Drive E: -Ssid "network name" -Country GBBoot the board, log in once and finish the install with
sh /boot/efi/cywfm/install.sh.
Option B: install on a running board
This needs /usr/src/sys on the board.
Pi Zero 2 W only: remove
dtoverlay=mmcfromconfig.txtand reboot. That overlay switches the Wi-Fi bus off.Install the firmware into
/boot/firmwareand build the module:make install-firmware # Zero 2 W: tools/fetch-firmware.sh -i -c 43436s # Pi 5: tools/fetch-firmware.sh -i -b raspberrypi,5-model-b make module make loadThe firmware files (
brcmfmac43455-sdio.*,brcmfmac43456-sdio.*,brcmfmac43436s-sdio.*) are vendor binaries under the Cypress/Synaptics licence. The repository fetches them; it does not ship them.Bring the interface up by hand:
ifconfig wlan0 create wlandev cywfm0 wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf dhclient wlan0Make it permanent.
make installcopies the module to/boot/modulesand runskldxref. Then add to/etc/rc.conf:kld_list="cywfm" wlans_cywfm0="wlan0" create_args_wlan0="country XX" ifconfig_wlan0="WPA DHCP"Load it from
kld_list, not fromloader.conf. A module the loader brings in before the SDIO controller is ready logs "loaded at boot, bring-up skipped" and does nothing. Keep/etc/wpa_supplicant.confat mode 0600.
To remove it again: sysrc -x wlans_cywfm0 ifconfig_wlan0 create_args_wlan0 and sysrc kld_list-=cywfm.
Is it working?
sysctl hw.cywfm.stage # "net80211" means the radio is up
dmesg | grep cywfm:
ifconfig wlan0
wpa_cli status
What it can do
- Station mode with WPA2-PSK and open networks, 802.11w (management frame protection).
- Access point mode with
hostapd. - Monitor mode with radiotap headers (
hw.cywfm.monitor). - Firmware offloads: ARP, IPv6 neighbour discovery, packet filters, keepalive.
- Automatic recovery after a firmware crash (
hw.cywfm.recover, 0 to 10 restarts). kldunloadandkldloadwithout a reboot.
What it cannot do (yet)
- WPA3-SAE: net80211 has no external authentication for FullMAC drivers. A write-up for the FreeBSD wireless list is drafted (see Upstream reports).
- Wi-Fi Direct (P2P), scheduled scans, wake on wireless.
- 5 GHz on the Zero 2 W: its radio has no 5 GHz.
- On the Pi 4 and Pi 5 the first join after loading often fails and the retry succeeds. Each load restarts the firmware's 802.11 sequence counter, so the first authentication frame is almost always number 38 with the Retry bit set. An access point that saw number 38 last time stays quiet, and the result is a neat ok/fail/ok/fail pattern. Two attempted fixes did not change it.
- Untested: AP with a client on the Pi 4, 40/80 MHz and DFS channels for the AP, several virtual interfaces at once.
Tunables
Set them in /boot/loader.conf as hw.cywfm.<name>="value". The full list (more than 60) is in docs/sysctl.md and the cywfm(4) man page. The ones most often changed:
| Name | What it does |
|---|---|
country | Regulatory country code |
pm | Power save on or off |
irq_fix | Pi 4 shared-interrupt workaround (on by default, see below) |
bus_hs | High-speed SDIO bus |
mfp | 802.11w management frame protection |
recover | How many times to restart after a fatal firmware fault |
debug | Extra logging, for example hw.cywfm.debug="1" |
A bug in the Pi 4 kernel
On the Pi 4 the Wi-Fi SDIO controller and the SD card controller share one interrupt line. If the Wi-Fi controller interrupts while the SD card is in the middle of a DMA write, the SD driver loses its "buffer ready" event. The board keeps answering ping for 9 to 10 seconds and then reboots. That is a FreeBSD kernel bug, not a driver bug, so cywfm patches the sdhci_bcm method table at runtime (irq_fix) until the kernel is fixed. The kernel patch and the report are on the Kernel bugs page.
Two smaller surprises from the same board: the Pi 4's radio reports the SDIO card ID of a 43430 (0xa9a6), so the driver reads the chip ID register instead, which says 0x4345 rev 6. And make -j4 on a Pi 4 once killed the compiler with "illegal instruction". The power supply was sagging, so builds now run with one job.
Report a board
Reports from boards in the "expected to work" row are welcome. Two scripts collect what a report needs:
sh tools/board-report.sh -d dump.txt > report.md
sh tools/self-test.sh -m driver/cywfm.ko > test.md