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.

2 Likes

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'

I think wifi broke with the update to the 6.1 kernels in OpenWRT in the Snapshots. I'm using a CM4 board too (The dfrobot routerboard.)

If I copy in firmware from my Raspi-OS install I see this in dmesg:

 dmesg | grep brcmfmac
[    5.413814] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    5.422691] usbcore: registered new interface driver brcmfmac
[    5.428526] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.bin failed with error -2
[    5.440800] brcmfmac mmc1:0001:1: Falling back to sysfs fallback for: brcm/brcmfmac43455-sdio.raspberrypi,4-compute-module.bin
[    5.622887] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Jul 29 2022 02:15:20 version 7.45.250 (70e9766 CY) FWID 01-e53e306b
[    9.802240] brcmfmac mmc1:0001:1 phy0-ap0: renamed from wlan0

But iw phy looks like it is giving the right information:

iw phy
Wiphy phy0
        wiphy index: 0
        max # scan SSIDs: 10
        max scan IEs length: 2048 bytes
        max # sched scan SSIDs: 16
        max # match sets: 16
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * P2P-client
                 * P2P-GO
                 * P2P-device
        Band 1:
                Capabilities: 0x1022
                        HT20/HT40
                        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
                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)
        Band 2:
                Capabilities: 0x1062
                        HT20/HT40
                        Static SM Power Save
                        RX HT20 SGI
                        RX HT40 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
                VHT Capabilities (0x00001020):
                        Max MPDU length: 3895
                        Supported Channel Width: neither 160 nor 80+80
                        short GI (80 MHz)
                        SU Beamformee
                VHT RX MCS set:
                        1 streams: MCS 0-9
                        2 streams: not supported
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT RX highest supported: 0 Mbps
                VHT TX MCS set:
                        1 streams: MCS 0-9
                        2 streams: not supported
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT TX highest supported: 0 Mbps
                VHT extended NSS: not supported
                Frequencies:
                        * 5170 MHz [34] (20.0 dBm)
                        * 5180 MHz [36] (20.0 dBm)
                        * 5190 MHz [38] (20.0 dBm)
                        * 5200 MHz [40] (20.0 dBm)
                        * 5210 MHz [42] (20.0 dBm)
                        * 5220 MHz [44] (20.0 dBm)
                        * 5230 MHz [46] (20.0 dBm)
                        * 5240 MHz [48] (20.0 dBm)
                        * 5260 MHz [52] (20.0 dBm) (radar detection)
                        * 5280 MHz [56] (20.0 dBm) (radar detection)
                        * 5300 MHz [60] (20.0 dBm) (radar detection)
                        * 5320 MHz [64] (20.0 dBm) (radar detection)
                        * 5500 MHz [100] (20.0 dBm) (radar detection)
                        * 5520 MHz [104] (20.0 dBm) (radar detection)
                        * 5540 MHz [108] (20.0 dBm) (radar detection)
                        * 5560 MHz [112] (20.0 dBm) (radar detection)
                        * 5580 MHz [116] (20.0 dBm) (radar detection)
                        * 5600 MHz [120] (20.0 dBm) (radar detection)
                        * 5620 MHz [124] (20.0 dBm) (radar detection)
                        * 5640 MHz [128] (20.0 dBm) (radar detection)
                        * 5660 MHz [132] (20.0 dBm) (radar detection)
                        * 5680 MHz [136] (20.0 dBm) (radar detection)
                        * 5700 MHz [140] (20.0 dBm) (radar detection)
                        * 5720 MHz [144] (20.0 dBm) (radar detection)
                        * 5745 MHz [149] (20.0 dBm)
                        * 5765 MHz [153] (20.0 dBm)
                        * 5785 MHz [157] (20.0 dBm)
                        * 5805 MHz [161] (20.0 dBm)
                        * 5825 MHz [165] (20.0 dBm)
        valid interface combinations:
                 * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
                   total <= 3, #channels <= 2
                 * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
                   total <= 4, #channels <= 1
        max # scan plans: 1
        max scan plan interval: 508
        max scan plan iterations: 0
        Supported extended features:
                * [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
                * [ DFS_OFFLOAD ]: DFS offload

And yet I can't create a wifi network. I can set a wifi network to use the 2.4ghz network, but OpenWRT automatically changes the network to 5Ghz, channel 36, and even then, it doesn't actually come up.

Im actually tryin to get my wifi working on a CM4 with DFRobot hat its a great setup and has worked well for as long as I've had it but I'd like to be able to connect directly to the CM4's wifi if/when needed.

I can actually connect to the CM4 wireless but its not getting an IP address from the DHCP from the LAN.

OpenWrt 22.03.3 r20028-43d71ad93e / LuCI openwrt-22.03 branch git-22.361.69894-438c598

Network Configuration:

config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'

config globals 'globals'

config interface 'lan'
option proto 'static'
option netmask '255.255.255.0'
option device 'eth1'
option ipaddr '192.168.1.1'
list dns '192.168.1.4'

config interface 'wan'
option device 'eth0'
option proto 'dhcp'
option type 'bridge'

config interface 'wlan'
option proto 'none'
option device 'radio0.network1'

Wireless Configuration:

config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
option band '5g'
option htmode 'VHT80'
option channel 'auto'
option cell_density '0'

config wifi-iface 'default_radio0'
option device 'radio0'
option ssid 'OpenWrt'
option encryption 'psk2'
option key 'PASSWORD'
option mode 'ap'
option network 'lan wlan'

DHCP Configuration:

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option leasetime '12h'
        option dhcpv4 'server'
        option start '50'
        option limit '200'
        list dhcp_option '6,192.168.1.4'
        option force '1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'
        list ra_flags 'none'