WiFi doesn't work on Raspberry Pi CM4 with Cypress 43456

I'm building a custom image of OpenWRT to support the Waveshare Dual Ethernet 4G/5G Box, and my full build process is documented here: https://github.com/geerlingguy/pi-router

The issue where I'm debugging this specifically is over on GitHub: Get onboard Raspberry Pi CM4 WiFi module working.

I'm building from the latest source, and can confirm the proper brcm firmware file is in place:

root@OpenWrt:/lib/firmware/brcm# ls
brcmfmac43143.bin                                    brcmfmac43455-sdio.clm_blob
brcmfmac43236b.bin                                   brcmfmac43455-sdio.raspberrypi,4-compute-module.txt
brcmfmac43455-sdio.bin                               brcmfmac43455-sdio.raspberrypi,4-model-b.txt

In the past, I used to run into this issue: Raspberry Pi CM4 wifi not working - #8 by geerlingguy β€” but that seems to be resolved.

None of the wireless/wifi commands seem to show anything:

root@OpenWrt:~# iw reg get
global
country 00: DFS-UNSET
	(755 - 928 @ 2), (N/A, 20), (N/A), PASSIVE-SCAN
	(2402 - 2472 @ 40), (N/A, 20), (N/A)
	(2457 - 2482 @ 20), (N/A, 20), (N/A), AUTO-BW, PASSIVE-SCAN
	(2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM, PASSIVE-SCAN
	(5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW
	(5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
	(5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, PASSIVE-SCAN
	(5735 - 5835 @ 80), (N/A, 20), (N/A), PASSIVE-SCAN
	(57240 - 63720 @ 2160), (N/A, 0), (N/A)

root@OpenWrt:~# wifi status
{
	
}

root@OpenWrt:~# uci show wireless
root@OpenWrt:~# 

I do see the following error in the dmesg log:

[    6.307836] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43456-sdio.raspberrypi,4-compute-module.bin failed with error -2
[    6.320167] brcmfmac mmc1:0001:1: Falling back to sysfs fallback for: brcm/brcmfmac43456-sdio.raspberrypi,4-compute-module.bin
[    7.887907] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43456-sdio.bin failed with error -2
[    7.897693] brcmfmac mmc1:0001:1: Falling back to sysfs fallback for: brcm/brcmfmac43456-sdio.bin
[   11.367451] usbcore: registered new interface driver brcmfmac
[   12.378410] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50

Is there any way to debug this?

Interestingly, I thought all CM4s came with the Cypress 43455 WiFi chip. But it looks like the one I'm using (a 4GB Lite module) may have a Cypress 43456 chip... which is the same as the one in the Pi 400. And the firmware blob for that file is not present...

If I boot into Raspberry Pi OS:

pi@waveshare:~ $ dmesg | grep brcmfmac
[    8.397884] brcmfmac: F1 signature read @0x18000000=0x15294345
[    8.408768] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[    8.410016] usbcore: registered new interface driver brcmfmac
[    8.411611] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43456-sdio.raspberrypi,4-compute-module.bin failed with error -2
[    8.631519] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[    8.631690] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[    8.645283] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/9 wl0: May 14 2020 17:26:08 version 7.84.17.1 (r871554) FWID 01-3d9e1d87
[   14.099173] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled

And the Pi OS firmware directory contains:

$ ls /lib/firmware/brcm/brcmfmac43456*
/lib/firmware/brcm/brcmfmac43456-sdio.bin
/lib/firmware/brcm/brcmfmac43456-sdio.clm_blob
/lib/firmware/brcm/brcmfmac43456-sdio.txt

So maybe if I just copy those files over to the build, it should work... going to try that out next.

That worked. I'm now seeing the Wireless interface in LuCI, and the wireless radio shows up when I run wifi status:

root@OpenWrt:~# wifi status
{
	"radio0": {
		"up": false,
		"pending": false,
		"autostart": true,
		"disabled": true,
		"retry_setup_failed": false,
		"config": {
			"path": "platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1",
			"channel": "36",
			"band": "5g",
			"htmode": "VHT80",
			"disabled": true
		},
		"interfaces": [
			{
				"section": "default_radio0",
				"config": {
					"mode": "ap",
					"ssid": "OpenWrt",
					"encryption": "none",
					"network": [
						"lan"
					],
					"mode": "ap"
				},
				"vlans": [
					
				],
				"stations": [
					
				]
			}
		]
	}
}

So next question: what needs to be done to get the three files added to OpenWRT?

/lib/firmware/brcm/brcmfmac43456-sdio.bin
/lib/firmware/brcm/brcmfmac43456-sdio.clm_blob
/lib/firmware/brcm/brcmfmac43456-sdio.txt

It seems like this would enable support for all CM4s (apparently some can have the 43456 chip in them), as well as the Pi 400 (which might not work currently?).

Edit: There's one other possibility. I have one of the pre-release CM4s on hand (don't know if it's this one)β€”it could be that just this one CM4 has a 43456, and all the rest in production are 43455. Not sure.

1 Like

It looks like your radio0 config is disabled: "disabled": true

vi /etc/config/wireless -> set option disabled '1' to option disabled '0'
Hit 'esc' :wq 'enter'