agherzan / meta-raspberrypi

Yocto/OE BSP layer for the Raspberry Pi boards
https://www.yoctoproject.org/
MIT License
549 stars 417 forks source link

Broadcom Wi-Fi and Bluetooth Detection Issues on Raspberry Pi 3 Model B V1.2 with Yocto Scarthgap Branch #1388

Open Joseph-MSar opened 1 week ago

Joseph-MSar commented 1 week ago

Description: I am working with Yocto on a Raspberry Pi 3 Model B V1.2, using the scarthgap branch. I am encountering issues with getting the Broadcom Wi-Fi and Bluetooth hardware to work properly. Despite setting up the necessary drivers and firmware, neither Wi-Fi nor Bluetooth is being detected or initialized. Below are the details of my configuration, the troubleshooting steps I’ve taken, and the results observed. Configuration and Environment

Bild Configuration:
BB_VERSION           = "2.8.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "raspberrypi3"
DISTRO               = "poky"
DISTRO_VERSION       = "5.0.5"
TUNE_FEATURES        = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta                 
meta-poky            
meta-yocto-bsp       = "scarthgap:dce4163d42f7036ea216b52b9135968d51bec4c1"
meta-oe              
meta-python          
meta-multimedia      
meta-networking      = "scarthgap:2e3126c9c16bb3df0560f6b3896d01539a3bfad7"
meta-raspberrypi     = "scarthgap:6df7e028a2b7b2d8cab0745dc0ed2eebc3742a17"

here is my local.conf

BB_NUMBER_THREADS = "5"
PARALLEL_MAKE = "-j 5"

MACHINE?= "raspberrypi3"

DL_DIR ?= "${TOPDIR}/downloads"

SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
TMPDIR = "${TOPDIR}/tmp"

DISTRO ?= "poky"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    HALT,${TMPDIR},100M,1K \
    HALT,${DL_DIR},100M,1K \
    HALT,${SSTATE_DIR},100M,1K \
    HALT,/tmp,10M,1K"

EXTRA_IMAGE_FEATURES ?= "debug-tweaks tools-debug src-pkgs dbg-pkgs tools-sdk"
CONF_VERSION = "2"
ENABLE_UART = "1"
RM_OLD_IMAGE ="1"
DISTRO_FEATURES += " usrmerge"
EXTRA_USERS_PARAMS = "usermod -d /root root"
LICENSE_FLAGS_ACCEPTED = "synaptics-killswitch"
INHERIT +="rm_work"
RPI_USE_U_BOOT ="1"
DISTRO_FEATURES:append = " bluez5 bluetooth wifi"
IMAGE_INSTALL:append = " wpa-supplicant iw bluez5"
#with and without  linux-firmware-bcm43430 wifi/blutooth are not working
IMAGE_INSTALL:append = " linux-firmware-bcm43430"
DISABLE_RPI_BOOT_LOGO = "1" 

Other Firmware/Driver Packages: In MACHINE_EXTRA_RRECOMMENDS, includes the following packages in raspberrypi3.conf:

linux-firmware-rpidistro-bcm43430
linux-firmware-rpidistro-bcm43455
bluez-firmware-rpidistro-bcm43430a1-hcd
bluez-firmware-rpidistro-bcm4345c0-hcd 

Observations and Steps Taken Driver Loading:

Verified that the required firmware files (brcmfmac43430-sdio.bin and brcmfmac43455-sdio.bin) are present in /lib/firmware/brcm/. The brcmfmac and brcmutil drivers are visible on the system. But are not loaded automatically. Below is my dmesg output: and my lsmod output dmesg.txt lsmod.txt

When loaded manually with modprobe brcmfmac and modprobe brcmutil, they do not automatically detect or initialize a Wi-Fi interface. Running ip link show reveals that wlan0 is not created. here is my dmesg after attempting to manually load the drivers:

[  501.131253] Bluetooth: hci0: Frame reassembly failed (-84)
[  514.639972] Bluetooth: hci0: Frame reassembly failed (-84)
[  536.134002] Bluetooth: hci0: Frame reassembly failed (-84)
[  600.868066] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[  600.898739] Loaded X.509 cert 'benh@debian.org: 577e021cb980e0e820821ba7b54b4961b8b4fadf'
[  600.914724] Loaded X.509 cert 'romain.perier@gmail.com: 3abbc6ec146e09d1b6016ab9d6cf71dd233f0328'
[  600.931797] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[  600.943637] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[  601.092595] usbcore: registered new interface driver brcmfmac
[  617.874459] Bluetooth: hci0: Frame reassembly failed (-84)

There is no further output indicating Wi-Fi initialization or issues. This is true even after enabling the SDIO bus support for FullMAC drivers in the kernel configuration.

Bluetooth Behavior:

Bluetooth is also non-functional. Running hciconfig -a shows no BD address (all zeros). The Bluetooth-related firmware packages are installed, but no hci0 device is created or recognized, and Bluetooth tools (hciconfig) do not detect the hardware.

I also attempted to add dtoverlay=sdio in /boot/config.txt to force SDIO initialization, but this did not help. The SDIO device remains undetected on both Wi-Fi and Bluetooth.

Questions and Support Needed Could you provide guidance on the following points?

Driver Initialization: Are there known dependencies or configurations needed to ensure that brcmfmac and brcmutil automatically initialize wlan0 and detect Bluetooth ? Bluetooth Setup: Are additional configurations required to properly initialize Bluetooth hardware and prevent the BD address from being set to all zeros?

Any help or insights would be greatly appreciated, as this is my first time working with Yocto on the Raspberry Pi, and I am encountering challenges in detecting and initializing both Wi-Fi and Bluetooth.

Thanks in advance JosephMS,