Using an alternative WIFI card (LWB5+)

Hi everyone,

I had an early-ish Librem5 evergreen with the Redpine wifi card, which stopped working after one year. I wanted to buy the new SparkLan card but from where I live the shipping fee would have been 3x the price of the card.

So instead I bought a LWB5+ M.2 SDIO wifi card on Mouser as a replacement. On paper, all that was needed was putting the firmware files (see here) in /lib/firmware/brcm/ and trigger the kill switches to initiate the firmware boot.

I was faced instead with this error when using dmesg | grep brcm:

brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50

This led me to this FAQ answer which points to an unfulfilled/misconfigured external 32khz crystal oscillator.

I found that the firmware has an NVRAM configuration file, and it seems that the parameter boardflags3 is related to the crystal oscillator, so I modified it by changing randomly the value from 0x48202100 to 0x40202100 and the firmware was able to boot, and I got WIFI on the Librem5 with it directly!!

My issue now is that I have this error:

ieee80211 phy13: brcmf_cfg80211_set_rekey_data: gtk_key_info iovar failed: ret=-52

which seems to say that the value I put is incorrect (also it is the same when I put random values or comment out boardflags3), so I fear I merely bypassed the check for an oscillator by putting an incorrect value…

Since it seems the oscillator is needed for power saving features, and the Librem5 clearly has one according to the schematics, does anyone know how I can put a correct parameter and/or debug this? I tried using the same value as the NVRAM config for the Redpine card but it is the same outcome.

Thanks,

7 Likes

@dos may be able to help you.

Thanks @FranklyFlawless! Actually I got an answer from @angus.ainslie, WIFI cards that need an external oscillator are not supported on the Librem5.

Having the WIFI working with an alternative card is already great for me. I will try to document this process on the wiki so people can test other cards

6 Likes

Got bluetooth working now thanks to @dos !

What I had to do was edit /lib/udev/rules.d/85-librem5-brcmfmac.rules to change the value ATTRS{device} to 0x4373.

3 Likes

If you are having issues gaining permissions from Purism to edit the Community Wiki, feel free to pass on any proposed changes so I can do so on your behalf.

2 Likes

Sure, if you can add this information to the wiki it would be great, I was not authorized yet

1 Like