RPi3: wifi issues and system freeze in 8.1.1

  • Hi,

    since I've updated from 8.0.2 to 8.1, I experience wifi-issues with the built-in Broadcom-chip on my Raspberry Pi 3. The wifi is either not connecting at startup or loses connection, usually after some time in idle state. This only happens sporadically, and in Version 8.1.0 I usually worked around it by disabling and enabling wifi again, or doing a reboot.
    Meanwhile, on Version 8.1.1, it already happend several times that the system was also completely frozen after a while on that occasion. So I tried to investigate this a little:

    I enabled debug-logging in kodi and I tried to put the brcmfmac-module in debug-mode, providing a file with options brcmfmac debug=0x0003FFFE  in

    /storage/.config/modprobe.d. I tried several values for debug, to increase verbosity (either decimal or hex), using the message levels I found here:

    brcmfmac debugging and appropriate debug values | tech 4 research .

    Unfortunately, I only ever got 3 lines of kernel-messages concerning brcmfmac:

    Code
    [    7.378648] usbcore: registered new interface driver brcmfmac
    [    7.524749] brcmfmac: Firmware version = wl0: Aug  7 2017 00:46:29 version 7.45.41.46 (r666254 CY) FWID 01-f8a78378
    [    8.186875] brcmfmac: power management disabled

    I also installed the network-tools addon and tried to play with power-save mode and reg-domain on startup, although this seemed pretty pointless. But due to the sporadic occurences, I couldn't figure out if this had anything to do with it.

    This morning, I experienced a system freeze again, and now the kernel-log contains the following lines, evidently repeating in a endless loop until the freeze:

    On first sight, the kodi log shows no difference to a normal bootup without the wifi issue. I also attached a full journal-log of the incident.

    My System:

    Raspberry Pi 3 Model B Rev 1.2

    LibreELEC 8.1.1, Linux 4.9.43 #1 SMP Tue Aug 29 08:16:10 BST 2017
    Wifi-firmware: 7.45.41.46 (r666254 CY), FWID 01-f8a78378


    Since my wifi-environment hasn't changed over time, and the wifi has been absolutely stable in earlier versions (and other systems like recalbox on the same device), my guess is, this is related to the recent firmware-updates for bcm43438.

    I hope I could already help someone who gets this error as well. Please write me, if can can do anything more to help.

    Greetings

    kodi.log

    journal.log

  • Can you try loading the old RPi WiFi firmware to see if that helps:

    Code
    mkdir /storage/.config/firmware
    cd /storage/.config/firmware
    wget -q http://milhouse.libreelec.tv/other/brcmwifiv0.1.tar.gz -O- | tar xvz
    reboot

    Once your device has rebooted you can confirm the old firmware has loaded by checking dmesg which should look as follows:

    Code
    # dmesg | grep brcmfmac
    [    3.835921] usbcore: registered new interface driver brcmfmac
    [    3.963630] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Aug 29 2016 20:48:16 version 7.45.41.26 (r640327) FWID 01-4527cfab

    If you are running the new firmware you will see:

    Code
    # dmesg | grep brcmfmac
    [    4.021832] usbcore: registered new interface driver brcmfmac
    [    4.195680] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Aug  7 2017 00:46:29 version 7.45.41.46 (r666254 CY) FWID 01-f8a78378
  • Hi,

    I enabled debug-logging in kodi and I tried to put the brcmfmac-module in debug-mode, providing a file with options brcmfmac debug=0x0003FFFE  in

    Note that CONFIG_BRCMDBG is not currently enabled. I will enable it in my nightly test builds (starting tonight, with #0906).

    If you wish to enable it then you should add

    Code
    brcmfmac.debug=0x????????

    to /flash/cmdline.txt where ???????? is a hexadecimal number comprising the bit values documented here: linux/debug.h at rpi-4.9.y · raspberrypi/linux · GitHub

    Debug information will appear in the kernel log (dmesg, journalctl etc.)

    Don't be tempted to use brcmfmac.debug=0xffffffff as that is an invalid parameter value and will cause the driver to fail to load.

    You will also have "forensic" data available from:

    Code
    cat /sys/kernel/debug/brcmfmac/mmc1\:0001\:1/forensics

    This github issue may also be worth a read:

    wlan freezes in raspberry pi 3 · Issue #1342 · raspberrypi/linux · GitHub

  • Ah, that explains a lot, thank you milhouse.

    Will try both shortly, although I still don't know how to reproduce it on demand. I haven't had a crash during normal operation since writing my post. Maybe generating traffic and/or attenuating the wifi-signal will do, as the last post of the github-issue suggests.

    Greetings

  • Hello dear sirs,

    I'm using night builds on RPi 3B+, and having some WiFi issues.

    Sometimes I see playback from NFS shares/Internet stuck and RPi is not responding on ping. After some time (matter of 10s of a seconds) connectivity is back again. Here's the excerpt from dmesg:

    Could you please advise which WiFi debug should I turn on to provide extensive info on this subject?

    Thanks for your business and a great product.

    Regards,

    Konstantin

  • Iridium Thanks for your prompt answer, I'll try it later definitely (need to get spare SD). Official alpha uses another firmware, am I getting this right?

    Mine is:

    LibreELEC:~ # dmesg | grep brcmfmac

    [ 5.942741] brcmfmac: F1 signature read @0x18000000=0x15264345

    [ 5.948278] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6

    [ 5.950248] usbcore: registered new interface driver brcmfmac

    [ 6.447954] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6

    [ 6.461827] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04

    [ 6.534961] brcmfmac: power management disabled

    To clarify, I'm not trying to get stable device. I'd like to help ironing out bugs of cutting edge releases.

    Regards,

    K