STM32MP157C-DK2 debian wifi struggle

Hello,

I’ve been following the steps for installing debian on the STM32MP157C-dk2 as described here: https://www.digikey.com/eewiki/display/linuxonarm/STM32MP1

This all works very well and as expected with the exception of the wifi module.
I tried quite some things, including adding some of the modules in the linux configuration as described here: stm wlan overview

However it seems this part:

5.2.1 How to verify than the WLAN driver is well probed

  • In dmesg log, check “brcmfmac” logs :

[ 67.306154] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Aug 6 2017 23:19:25 version >7.45.98.30 (r666241 CY) FWID 01-f0b000 [ 67.326146] brcmfmac: brcmf_c_preinit_dcmds: CLM >version = API: 12.2 Data: 7.11.15 Compiler: 1.24.2 ClmImport: 1.24.1 Creation: 2014-05 [ 67.676323] >brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code (0x30 0x30)

Never shows the expected outcome, making me think it doesn’t probe the driver at all. I tried some different versions of the dts in u-boot, but it seems u-boot doesn’t support wifi at all, and the things I tried made no difference.

Could anybody point in a direction?

Are there others with this development kit that did get the wifi to work with debian?

@Micha, sorry I never noticed this board had WiFi (i guess the lack of antenna…)

Let’s try adding some firmware:

wget https://raw.githubusercontent.com/STMicroelectronics/meta-st-stm32mp/thud/recipes-kernel/linux-firmware/linux-firmware/brcmfmac43430-sdio.txt
sudo cp ./brcmfmac43430-sdio.txt /lib/firmware/brcm/

wget https://raw.githubusercontent.com/murata-wireless/cyw-fmac-fw/master/brcmfmac43430-sdio.bin
sudo cp ./brcmfmac43430-sdio.bin /lib/firmware/brcm/

wget https://raw.githubusercontent.com/murata-wireless/cyw-fmac-fw/master/brcmfmac43430-sdio.1DX.clm_blob
sudo cp ./brcmfmac43430-sdio.1DX.clm_blob /lib/firmware/brcm/

Based on https://github.com/STMicroelectronics/meta-st-stm32mp/blob/thud/recipes-connectivity/wifi/wifi-suspend/wifi_brcmfmac_driver.sh

You might still have to modprobe brcmfmac

But i’ll see if i can test it later today…

Regards,

@RobertCNelson Thank you for your elaborate response!

Unfortunately this didn’t do the trick (yet).

I have to mention that I did use a different u-boot implementation for the current image. https://github.com/STMicroelectronics/u-boot uses a different branch as default which implements the required additions described here stm wiki about wlan device tree in contrary to the standard u-boot file for this board.

However, this doesn’t change anything apparently.

On some investigation I learned that the kernel needs to probe the mmc ports on startup and look for a “high speed sdio” device. I think this is where stuff is not working, as the kernel only shows probing the sdhc card on mmc0, and after that moves on and seems to not probe the other mmc ports.

@Micha, Ah darn, okay next we need to patch the kernel dts, here is the ST 4.19 section. (gotta run an errand, but i’ll be back later to test, as i have this board somewhere in my lab at home…)

Regards,

@RobertCNelson I’ve only been messing around with linux kernels since last week. Although I’m getting the hang of it, applying patches like this is still a bit over my head without any instructions.
Could you tell me where to get started?

I manually changed the dts file with the changes. But it still didn’t work, and it still seemed like it doesn’t probe the mmc for the wifi.
I did came across this: stm wiki about sdmmc device-tree (which this site doesn’t let me include directly?) with a reference to stm32mp157c.dtsi which should, according to this file, contain information for other mmc devices, but in my case only contains a reference to sdmmc1, which I believe is the SD card. I would like to edit this file as well, but I’m not entirely sure what I should put in it.
All in all I have the feeling there should be a more straightforward way to do this.

@Micha, some progress, but it’s still not correctly loading the device:

debian@arm:~$ dmesg | grep brcm
[   18.078560] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   18.090565] usbcore: registered new interface driver brcmfmac
[   18.158795] brcmfmac: brcmf_sdiod_ramrw: membytes transfer failed
[   18.170304] brcmfmac: brcmf_sdio_download_nvram: error -22 on writing 632 nvram bytes at 0x0007fd88
[   18.183573] brcmfmac: brcmf_sdio_download_firmware: dongle nvram file download failed

I’ve updated both the kernel repo and the wiki page with the updated patch/directions…

https://www.digikey.com/eewiki/display/linuxonarm/STM32MP1#STM32MP1-WiFi

Regards,

Thanks a bunch! Will see if I get the time to try it out tonight.

Don’t expect to, but I’ll see if I can help finding out how to get it working :slight_smile:

@Micha, i’ve just pushed a comparession branch which uses ST’s patchset…

git clone https://github.com/RobertCNelson/stm32-linux-dev
cd ./stm32-linux-dev/
git checkout origin/v4.19.x -b tmp
./build_kernel.sh
debian@arm:~$ dmesg | grep brcm ; uname -r
[   14.232370] bluetooth hci0: Direct firmware load for brcm/BCM43430A1.hcd failed with error -2
[   14.240929] Bluetooth: hci0: BCM: Patch brcm/BCM43430A1.hcd not found
[   16.668881] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   16.857097] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   16.868759] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[   16.889115] 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
4.19.49-stm32-x0.1

Regards,

It seems the combination of ST’s patchset with debian makes the screen on the devboard turn off. Which for my application isn’t a bad thing however.

Drivers seem to load properly indeed, didn’t get the chance to actually test them yet, as the interface seems to be soft blocked from the start, and rfkill (which so far seems to be the only app which can undo this) isn’t installed.

Will try again tomorrow. Thanks for the effort, very helpful!!

@Micha, yeah i didn’t really test much other then it loaded the brcmfmac driver… Systemd should also unlock rfkill, but I probably missed one of the rfkill config options. It was mostly just to see if it worked, now to just figure out what changes are really needed in v5.4.x…

Regards,

Hi Robert,

Near to continuing with this project, was just wondering if you had found any time to progress on this already :slight_smile:

Regards,

@Micha, i added the dts change to v5.6.x, sadly, it still doesn’t work:

Regards,