LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware - ARM (https://www.linuxquestions.org/questions/slackware-arm-108/)
-   -   PRI4 revision a03111 bluetooth problems (https://www.linuxquestions.org/questions/slackware-arm-108/pri4-revision-a03111-bluetooth-problems-4175689561/)

louigi600 01-30-2021 12:35 PM

PRI4 and RPi0 bluetooth problems
 
I've can't seem to get bluetooth working on 2 different RPi4 revisions and on RPi0W. This is the version information from cpuinfo:

Code:

Hardware        : BCM2711
Revision        : a03111
Serial          : 1000000091328354
Model          : Raspberry Pi 4 Model B Rev 1.1


Hardware        : BCM2711
Revision        : b03114
Serial          : 100000009dc116e9
Model          : Raspberry Pi 4 Model B Rev 1.4

Hardware        : BCM2835
Revision        : 9000c1
Serial          : 000000009b4bd2c0
#this is a RPi0W

I'm running SlackwareARM 14.2 with an old 5.4.40 SARPIi4 current kernel on the RPi4 and later I discover the same problem also on RPi0W with 5.10.14 RARPi kernel.

I keep on getting this message in the kernel ring buffer:
Code:

brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt failed with error -2
I've tried several firmware files from:
sarpi4-hacks-4.0-armv7l-1_slackcurrent_28Jan21_sp1.txz
borrowed from raspbian
https://github.com/RPi-Distro/firmwa...ee/master/brcm

None seem to work (all produce the same message in kernel ring buffer) and hciconfig shows no bluetooth device.
Wifi seems to be working fine but I wanted have the bluetooth working for testing for something I plan to do in the near future.

Has anyone got similar problems ?
Anyone know how to solve it ?

pchristy 01-30-2021 01:03 PM

I had similar problems with a Pi 400 (only partially fixed, even now) which I think uses a different chipset to the 4.

First of all, try installing the latest sarpi-hacks package, which has updated firmware for the bluetooth chips.

If that doesn't work, have a look at the modified bluez pkg detailed here: https://www.linuxquestions.org/quest...719/page5.html

At the time I found the patches for bluez, I was having problems compiling some things and sndwvs kindly provided a (64-bit!) package with the patches already applied in that thread.

BUT be warned! Try the sarpi-hacks first! There are (unconfirmed) reports that although the modified bluez package works with the 400, it might stop the 4 from working.

Mine now finds the bluetooth device and I can attach my headphones, but they drop out after a short, random time period, and the device vanishes again!

--
Pete

Emerson 01-30-2021 01:05 PM

Well, 'error -2' means it is not found at the time when kernel bluetooth driver is loading. Common problem for instance when the driver is built into kernel and the firmware is in /lib/firmware. When the kernel loads the drive with firmware is not mounted yet and you get error -2. In your case I assume the kernel driver is a module, not built into kernel? Then the firmware is not in correct location, the driver is looking into brcm subdirectory in your firmware directory, did you place it there? You may need to rename it to satisfy the driver.

louigi600 01-30-2021 01:39 PM

Quote:

Originally Posted by pchristy (Post 6213962)
I had similar problems with a Pi 400 (only partially fixed, even now) which I think uses a different chipset to the 4.

First of all, try installing the latest sarpi-hacks package, which has updated firmware for the bluetooth chips.

If that doesn't work, have a look at the modified bluez pkg detailed here: https://www.linuxquestions.org/quest...719/page5.html

At the time I found the patches for bluez, I was having problems compiling some things and sndwvs kindly provided a (64-bit!) package with the patches already applied in that thread.

BUT be warned! Try the sarpi-hacks first! There are (unconfirmed) reports that although the modified bluez package works with the 400, it might stop the 4 from working.

Mine now finds the bluetooth device and I can attach my headphones, but they drop out after a short, random time period, and the device vanishes again!

--
Pete

I've tried the latest sarpi hack ... sarpi4-hacks-4.0-armv7l-1_slackcurrent_28Jan21_sp1.txz built 2 days ago

Quote:

Well, 'error -2' means it is not found at the time when kernel bluetooth driver is loading. Common problem for instance when the driver is built into kernel and the firmware is in /lib/firmware. When the kernel loads the drive with firmware is not mounted yet and you get error -2. In your case I assume the kernel driver is a module, not built into kernel? Then the firmware is not in correct location, the driver is looking into brcm subdirectory in your firmware directory, did you place it there? You may need to rename it to satisfy the driver.
Nor sure but I think it is a module ... but the files are there in the right path /lib/firmware/brcm/
Code:

root@rpi4:~# ls -l /lib/firmware/brcm/
total 17580
-rw-r--r-- 1 root root  54734 Jan  1  2020 BCM-0bb4-0306.hcd
-rw-r--r-- 1 root root  36264 May  1  2019 BCM43430A1.hcd
-rw-r--r-- 1 root root  56759 May  1  2019 BCM4345C0.hcd
-rw-r--r-- 1 root root  269595 Apr  1  2018 bcm4329-fullmac-4.bin
-rw-r--r-- 1 root root  96224 Jan 30 17:49 bcm43xx-0.fw
-rw-r--r-- 1 root root  96224 Aug 17  2016 bcm43xx-0.fw-610.812
-rw-r--r-- 1 root root    180 Jan 30 17:49 bcm43xx_hdr-0.fw
-rw-r--r-- 1 root root    180 Aug 17  2016 bcm43xx_hdr-0.fw-610.812
-rw-r--r-- 1 root root  385067 Jan 30 17:49 brcmfmac43143-sdio.bin
-rw-r--r-- 1 root root  397312 Jan 30 17:49 brcmfmac43143.bin
-rw-r--r-- 1 root root  348160 Jan 30 17:49 brcmfmac43236b.bin
-rw-r--r-- 1 root root  455745 Jan 30 17:49 brcmfmac43241b0-sdio.bin
-rw-r--r-- 1 root root  403855 Jan 30 17:49 brcmfmac43241b4-sdio.bin
-rw-r--r-- 1 root root  408682 Jan 30 17:49 brcmfmac43241b5-sdio.bin
-rw-r--r-- 1 root root  479232 Jan 30 17:49 brcmfmac43242a.bin
-rw-r--r-- 1 root root  253748 Jan 30 17:49 brcmfmac4329-sdio.bin
-rw-r--r-- 1 root root    1509 Jan  1  2020 brcmfmac4330-sdio.Prowise-PT301.txt
-rw-r--r-- 1 root root  222126 Jan 30 17:49 brcmfmac4330-sdio.bin
-rw-r--r-- 1 root root  451566 Jan 30 17:49 brcmfmac4334-sdio.bin
-rw-r--r-- 1 root root  400864 Jan 30 17:49 brcmfmac43340-sdio.bin
-rw-r--r-- 1 root root    1693 Jan  1  2020 brcmfmac43340-sdio.meegopad-t08.txt
-rw-r--r-- 1 root root  569291 Jan 30 17:49 brcmfmac4335-sdio.bin
-rw-r--r-- 1 root root  202107 Jan 30 17:49 brcmfmac43362-sdio.bin
-rw-r--r-- 1 root root    803 Jan  1  2020 brcmfmac43362-sdio.cubietech,cubietruck.txt
-rw-r--r-- 1 root root    803 Jan  1  2020 brcmfmac43362-sdio.lemaker,bananapro.txt
-rw-r--r-- 1 root root  562183 Jan 30 17:49 brcmfmac4339-sdio.bin
-rw-r--r-- 1 root root    875 Jan  1  2020 brcmfmac43430-sdio.AP6212.txt
-rw-r--r-- 1 root root    928 Jan  1  2020 brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt
-rw-r--r-- 1 root root    831 Jan  1  2020 brcmfmac43430-sdio.MUR1DX.txt
-rw-r--r-- 1 root root  400447 Jan 30 17:49 brcmfmac43430-sdio.bin
-rw-r--r-- 1 root root    874 Jan  1  2020 brcmfmac43430-sdio.raspberrypi-rpi.txt
-rw-r--r-- 1 root root    1121 Jan 30 17:49 brcmfmac43430-sdio.txt
-rw-r--r-- 1 root root    989 Jan  1  2020 brcmfmac43430a0-sdio.ONDA-V80\ PLUS.txt
-rw-r--r-- 1 root root  382455 Jan 30 17:49 brcmfmac43430a0-sdio.bin
-rw-r--r-- 1 root root    951 Jan  1  2020 brcmfmac43430a0-sdio.jumper-ezpad-mini3.txt
-rw-r--r-- 1 root root  631467 Jan 30 19:14 brcmfmac43455-sdio.bin
-rw-r--r-- 1 root root    7163 Jan 30 19:14 brcmfmac43455-sdio.clm_blob
-rw-r--r-- 1 root root    2074 Jan 30 19:15 brcmfmac43455-sdio.txt
-rw-r--r-- 1 root root  495898 Jan 30 17:49 brcmfmac43456-sdio.bin
-rw-r--r-- 1 root root  10855 Jan 30 17:49 brcmfmac43456-sdio.clm_blob
-rw-r--r-- 1 root root    2053 Jan 30 17:49 brcmfmac43456-sdio.txt
-rw-r--r-- 1 root root  626140 Jan 30 17:49 brcmfmac4350-pcie.bin
-rw-r--r-- 1 root root  623304 Jan 30 17:49 brcmfmac4350c2-pcie.bin
-rw-r--r-- 1 root root  605388 Jan 30 17:49 brcmfmac4354-sdio.bin
-rw-r--r-- 1 root root  648770 Jan 30 17:49 brcmfmac4356-pcie.bin
-rw-r--r-- 1 root root    2515 Jan  1  2020 brcmfmac4356-pcie.gpd-win-pocket.txt
-rw-r--r-- 1 root root  526383 Jan 30 17:49 brcmfmac4356-sdio.bin
-rw-r--r-- 1 root root  557056 Jan 30 17:49 brcmfmac43569.bin
-rw-r--r-- 1 root root  550333 Jan 30 17:49 brcmfmac43570-pcie.bin
-rw-r--r-- 1 root root  633817 Jan 30 17:49 brcmfmac4358-pcie.bin
-rw-r--r-- 1 root root  595472 Jan 30 17:49 brcmfmac43602-pcie.ap.bin
-rw-r--r-- 1 root root  635449 Jan 30 17:49 brcmfmac43602-pcie.bin
-rw-r--r-- 1 root root 1105361 Jan 30 17:49 brcmfmac4366b-pcie.bin
-rw-r--r-- 1 root root 1120971 Jan  1  2020 brcmfmac4366c-pcie.bin
-rw-r--r-- 1 root root  623448 Jan 30 17:49 brcmfmac4371-pcie.bin
-rw-r--r-- 1 root root  457994 Jan 30 17:49 brcmfmac4373-sdio.bin
-rw-r--r-- 1 root root  479232 Jan 30 17:49 brcmfmac4373.bin
root@rpi4:~#

Are you sure that error -2 is only for file not found ?

The exact message is:
Code:

[    3.751663] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    3.754521] usbcore: registered new interface driver brcmfmac
[    3.783214] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt failed with error -2

Does that mean I should rename it in rcmfmac43455-sdio.raspberrypi ?
If so exactly which one and what precise name ?
these ate the files that almost match the name in dmesg
Code:

brcmfmac43455-sdio.bin      brcmfmac43455-sdio.clm_blob  brcmfmac43455-sdio.txt
And that is after root is mounted:
Code:

[    1.455027] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
In any case later I find:
Code:

[    4.043040] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    4.056123] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Jan  4 2021 19:56:29 version 7.45.229 (617f1f5 CY) FWID 01-2dbd9d2e


Emerson 01-30-2021 01:41 PM

Yes error -2 is not found, you could try renaming, it does not hurt.

louigi600 01-30-2021 02:08 PM

Ok so to get the error -2 to dissapear I renamed
brcmfmac43455-sdio.txt
to
brcmfmac43455-sdio.raspberrypi,4-model-b.txt
but still hciconfig shows nothing

I had a spare uSD so I put raspbian on it and the bloetooth seems to work there ... I wonder if it's a kernel problem.

Exaga 01-30-2021 04:25 PM

Quote:

Originally Posted by louigi600 (Post 6213987)
I had a spare uSD so I put raspbian on it and the bloetooth seems to work there ... I wonder if it's a kernel problem.

Looks like we need to review the firmware which SARPi distributes for Bluetooth. It's not the same as Raspberry Pi OS. I'll keep you posted. :thumbsup:

louigi600 01-31-2021 12:40 AM

1 Attachment(s)
Quote:

Originally Posted by Exaga (Post 6214023)
Looks like we need to review the firmware which SARPi distributes for Bluetooth. It's not the same as Raspberry Pi OS. I'll keep you posted. :thumbsup:

There is also something wrong in kernel 5.10.11 ... it will not boot properly on my rpi4 .... it starts ok but at some point before reaching init it slows down to snail with no slime pace ... honestly it tool like 3 minutes to eave reach the point where I see going multiuser ... and then still minutes waiting before I give up (even before I get the login prompt).

I did cheat a little and manually install kernel, modules, rc.modules-<kernel version> and hack ... manually doing most of the stuff that doinst would do ... is there something I left out that could cause this ? like not updating config.txt or cmdline.txt or the boot firmware ?
I looked a bit more into this and noticed that there are quite a few files that differ from what I have (sarpi4-boot-firmware-armv7l-1_slackcurrent_13May20_sp1.txz) to the new boot firmware:
Code:

* System.map differs
* bcm2708-rpi-b-plus.dtb differs
* bcm2708-rpi-b-rev1.dtb differs
* bcm2708-rpi-b.dtb differs
* bcm2708-rpi-cm.dtb differs
* bcm2708-rpi-zero-w.dtb differs
* bcm2708-rpi-zero.dtb differs
* bcm2709-rpi-2-b.dtb differs
* bcm2710-rpi-2-b.dtb differs
* bcm2710-rpi-3-b-plus.dtb differs
* bcm2710-rpi-3-b.dtb differs
* bcm2710-rpi-cm3.dtb differs
* bcm2711-rpi-4-b.dtb differs
* bootcode.bin differs
* config.gz differs
* fixup.dat differs
* fixup4.dat differs
* fixup4cd.dat differs
* fixup4db.dat differs
* fixup4x.dat differs
* fixup_cd.dat differs
* fixup_db.dat differs
* fixup_x.dat differs
* kernel7l.img differs
* start.elf differs
* start4.elf differs
* start4cd.elf differs
* start4db.elf differs
* start4x.elf differs
* start_cd.elf differs
* start_db.elf differs
* start_x.elf differs
- bcm2711-rpi-400.dtb only in new package
- bcm2711-rpi-cm4.dtb only in new package

I attached the script to quickly check and produce the above output *did not want to produce diff like output)/

The new boot firmware can boot the old kernel ... and also new kernel seems to boot fine with it.
Be warned : update both kernel and boot firmware else you get in trouble ;)
old kernel and new boot firmware: no bt device
new kernel and latest SARPi-hack firmware: no bt device
New kernel and raspbian firmware: still no bt device

How do they get it working on raspbian ?

I also found a github project with the brcm firmware and the stuff there does not match with SARPi nor raspbian ... is that stuff any good ?

PS: sorry for calling "Raspberripi OS" "rasbian" ... it may seem that I put something old on my RPI4 but that is not the case I downloaded 2021-01-11-raspios-buster-armhf.zip
Nice to note they don't call it raspbian any more but they still have the debian release name "buster"

pchristy 01-31-2021 02:43 AM

One of the patches I pointed to earlier corrects an error in bluez. Bluez looks for firmware in /etc/firmware rather than /lib/firmware. One of the three patches is to fix that. The other two are specifically for the chip used in the 400.

--
Pete

louigi600 01-31-2021 03:11 AM

Quote:

Originally Posted by pchristy (Post 6214147)
One of the patches I pointed to earlier corrects an error in bluez. Bluez looks for firmware in /etc/firmware rather than /lib/firmware. One of the three patches is to fix that. The other two are specifically for the chip used in the 400.

--
Pete

Ok but I don't want to recompile so I will link /etc/firmware to /lib/firmware and hopefully bluez will find the firmware
Code:

root@rpi4:/etc# ls -ld /etc/firmware
lrwxrwxrwx 1 root root 15 Jan 31 10:12 /etc/firmware -> ../lib/firmware/
root@rpi4:/etc#

Restarted rc.bluetooth and still nothing
Full reboot and still no bt device

pchristy 01-31-2021 03:23 AM

The other thing worth trying is to replace the /lib/firmware/brcm folder with the one from Raspbian. That is what got mine to at least load initially. Sarpi-hacks should do this, but if it didn't work for you, try going back to the original firmware supplied for the device.

--
Pete

Exaga 01-31-2021 03:52 AM

Quote:

Originally Posted by louigi600 (Post 6214120)
There is also something wrong in kernel 5.10.11 ... it will not boot properly on my rpi4 .... it starts ok but at some point before reaching init it slows down to snail with no slime pace ... honestly it tool like 3 minutes to eave reach the point where I see going multiuser ... and then still minutes waiting before I give up (even before I get the login prompt).

I have no idea or answer to what the problem is for you here. Right now I have 3 Slackware ARM current installations - (2 on sd card and 1 on SSD) all running kernel 5.10.11 - which I use for various purposes, but none as a desktop system, and they all boot very quickly and work as expected. In fact, I've noticed a slight speed increase in Slackware ARM operations since Christmas 2020, which is probably due to MoZes updating pkgs and/or making things better and/or streamlining, etc.

Quote:

Originally Posted by louigi600 (Post 6214120)
The new boot firmware can boot the old kernel ... and also new kernel seems to boot fine with it.
Be warned : update both kernel and boot firmware else you get in trouble ;)
old kernel and new boot firmware: no bt device
new kernel and latest SARPi-hack firmware: no bt device
New kernel and raspbian firmware: still no bt device

How do they get it working on raspbian ?

Back in 2019 I created a LQ post regarding RPi3/RPi4 Bluetooth. Every once in a while it breaks and the problems users are experiencing recently can be attributed to this. Obviously the RPi guys keep on top of their own hardware/software and fix any issues that may arise. I usually wait until there is a problem before looking into it and trying to solve it. I don't use RPi onboard wireless or Bluetooth and when there is a need for it I have my own plug-in USB devices for these purposes. These USB devices are infinitely more reliable, generally better supported under Slackware ARM (depending on the device in question), and not usually 'headache-inducing' like the RPi's onboard Cypress wireless combo shizzle can be at times.

I suspect something has changed in kernel 5.10.x that worked fine in kernel 5.4.x. That's what I'll be looking into initially.

Quote:

Originally Posted by louigi600 (Post 6214120)
I also found a github project with the brcm firmware and the stuff there does not match with SARPi nor raspbian ... is that stuff any good ?

The brcm firmware that SARPi uses is currently https://archive.raspberrypi.org/debi...+rpt11_all.deb [2021-01-25 10:27]. I can't comment on the https://github.com/RPi-Distro/firmwa...ee/master/brcm firmware, but it looks to be somewhat out of date in many places.

TheTKS 01-31-2021 05:12 AM

You could try to look over here for hints
https://www.linuxquestions.org/quest...an-4175689292/

Wifi wasn't found
Code:

# ifconfig wlan0
gave
Code:

wlan0: error fetching interface information: Device not found
Wifi is working now that I removed all files from /lib/firmware/brcm and then reinstalled sarpi-hacks.

Note that I don't know if what I did there will also work for Bluetooth. I also don't know if it's everything I should have done ex. if I should have done a complete sarpi & kernel reinstall. Going to do that now.

TKS

louigi600 01-31-2021 05:41 AM

I suspect I should have done a diff with raspbian config.txt but even with
Code:

# Uncomment to enable Bluetooth LE
dtoverlay=pi3-miniuart-bt
enable_uart=1

I still don't see any hci device. Maybe there's a missing dependency in kernel that moved and importing the previous config looses it.
I will examine the lsmod output from raspbian and slackwareARM and see if I can catch something.
I looked at the differences in kernel config between raspbian and SARPi-current for RPi4
Code:

davide@nuc8i5:/tmp/rpi4-bt-issue$ zdiff raspbian.config.gz slackwarearm.config.gz  |grep BT
< # CONFIG_BT_SELFTEST is not set
> # CONFIG_BT_MSFTEXT is not set
> # CONFIG_BT_SELFTEST is not set
> # CONFIG_BT_FEATURE_DEBUG is not set
< # CONFIG_BT_HCIBTSDIO is not set
> CONFIG_BT_HCIBTSDIO=m
> # CONFIG_BT_HCIUART_RTL is not set
< CONFIG_BT_WILINK=m
davide@nuc8i5:/tmp/rpi4-bt-issue$

This might be a little more comprehensible:
Code:

davide@nuc8i5:/tmp/rpi4-bt-issue$ comm -23 <(zcat raspbian.config.gz |sort) <(zcat slackwarearm.config.gz |sort) | grep BT
# CONFIG_BT_HCIBTSDIO is not set
CONFIG_BT_WILINK=m
davide@nuc8i5:/tmp/rpi4-bt-issue$ comm -13 <(zcat raspbian.config.gz |sort) <(zcat slackwarearm.config.gz |sort) | grep BT
# CONFIG_BT_FEATURE_DEBUG is not set
# CONFIG_BT_HCIUART_RTL is not set
# CONFIG_BT_MSFTEXT is not set
CONFIG_BT_HCIBTSDIO=m
davide@nuc8i5:/tmp/rpi4-bt-issue$

And regarding the modules: (here are the modules that are only loaded in raspbian)
Code:

davide@nuc8i5:/tmp/rpi4-bt-issue$ comm -23 <(awk '{print $1}' < raspbian.lsmod | sort) <(awk '{print $1}' < slackwarearm.lsmod | sort)
8021q
btbcm
cec
cmac
drm
drm_kms_helper
drm_panel_orientation_quirks
fb_sys_fops
garp
gpu_sched
hci_uart
i2c_dev
ip_tables
libsha256
llc
rfcomm
snd
snd_bcm2835
snd_compress
snd_pcm
snd_pcm_dmaengine
snd_soc_core
snd_timer
stp
syscopyarea
sysfillrect
sysimgblt
v3d
vc4
x_tables
davide@nuc8i5:/tmp/rpi4-bt-issue$

I've highlighted the ones I'm sure are bluetooth related.

But even with a bit of module unload/load still no luck:
Code:

root@rpi4:~# lsmod | grep bt
btsdio                16384  0
bluetooth            421888  8 btsdio,bnep
root@rpi4:~# rmmod  btsdio
root@rpi4:~# modprobe btbcm
root@rpi4:~# modprobe hci_uart
root@rpi4:~# modprobe rfcomm
root@rpi4:~# hciconfig
root@rpi4:~#


TheTKS 01-31-2021 06:43 AM

Quote:

Originally Posted by TheTKS (Post 6214190)
You could try to look over here for hints
https://www.linuxquestions.org/quest...an-4175689292/
...

Note that I don't know if what I did there will also work for Bluetooth. I also don't know if it's everything I should have done ex. if I should have done a complete sarpi & kernel reinstall. Going to do that now.

I went back and reinstalled all sarpi packages and kernel-firmware, and once again had the same files in /lib/firmware/brcm that I had before, and no wifi (wlan0 not visible in ifconfig.)

Then I again deleted all files in /lib/firmware/brcm and reinstalled sarpi-hacks, and now have functioning wifi again.

TKS

louigi600 01-31-2021 08:43 AM

4 Attachment(s)
For me wifi is working ok (in fact I connect to my RPi4 via wifi)
I tried removing everything from /lib/firmware/brcm and then putting in there only the firmware from SARPi-hack but still bluetooth is not working.

@TheTKS this thread is about bluetooth ;)

I've attached the kernel configs and output of lsmod should anyone want to do some more analysis there.
My considerations regarding the differences are in a previpus post on this thread.

TheTKS 01-31-2021 11:07 AM

Quote:

Originally Posted by louigi600 (Post 6214264)
For me wifi is working ok (in fact I connect to my RPi4 via wifi)
I tried removing everything from /lib/firmware/brcm and then putting in there only the firmware from SARPi-hack but still bluetooth is not working.

@TheTKS this thread is about bluetooth ;)

I've attached the kernel configs and output of lsmod should anyone want to do some more analysis there.
My considerations regarding the differences are in a previpus post on this thread.

I understand this thread is about BT, but since some of the discussion involved firmware in the same directory, I was curious if there might be the same or similar origin that might point you to a solution.

It appears not, so I’ll stop with the wifi stuff now. Still curious about what’s causing your BT problems.

Exaga’s suggestion of a dongle sounding pretty good to me now.

Good luck getting your BT problem solved soon.

TKS

Exaga 01-31-2021 03:40 PM

Quote:

Originally Posted by louigi600 (Post 6214264)
I've attached the kernel configs and output of lsmod should anyone want to do some more analysis there.

My considerations regarding the differences are in a previpus post on this thread.

OK Louigi. I've spent most of the day looking into Bluetooth and I'm obviously missing something because I'm no nearer to a solution now than when I started.

I noticed that modules were missing from the kernel 5.10.11 so I fixed that and rebuilt it. This made no difference. In fact I've built approx. 5 kernels today, testing with various configs, and it's made no difference. I've also played around with Raspberry Pi OS /lib/firmware/brcm and it's made no difference. The strange thing is that Bluetooth is initialising and activating as expected but no device(s) are found with 'hcitool dev', or by any other means/commands.

All I get is this:
Code:

root@torq:~# hcitool dev
Devices:
root@torq:~# hciattach /dev/ttyS0 bcm43xx 921600 noflow
bcm43xx_init
Initialization timed out.
root@torq:~# hcidump
HCI sniffer - Bluetooth packet analyzer ver 5.55
Can't attach to device hci0. No such device(19)
root@torq:~# bluetoothctl
Agent registered
[bluetooth]# devices
No default controller available
[bluetooth]# info hci0
No default controller available
[bluetooth]#

Something somehere is stopping the hci0 device from being detected. What am I missing here?

Exaga 01-31-2021 03:45 PM

1 Attachment(s)
Quote:

Originally Posted by rsamurti (Post 6214330)
But bluetooth is not working. This has to be investigated.

Here's a 'dmesg' from my Slackware ARM current - RPi4 [4GB] system - and if you have any suggestions or results from your own investigations let's discuss it:

louigi600 02-01-2021 12:27 AM

@Exaga
I noticed this in your dmesg:
Code:

[    4.292244] brcmfmac: F1 signature read @0x18000000=0x15264345
[    4.301032] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    4.301483] usbcore: registered new interface driver brcmfmac
[    4.375641] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt failed with error -2

If you get rid of that by copying brcmfmac43455-sdio.txt to what the firmware loader is looking for
Code:

cd /lib/firmware/brcm
cp brcmfmac43455-sdio.txt brcmfmac43455-sdio.raspberrypi,4-model-b.txt

The content of that file seems to have important details maybe that will help once the needed modules are all there.

Will that make any difference to your newer kernel builds ?
Can you share the kernel config where you fixed the missing modules ?

pchristy 02-02-2021 08:46 AM

Not sure if it will help or not, but I've finally cracked the problem with the 400, and part of the solution may apply to your setup.

I discovered that there is another version of the BCM4345C5.hcd firmware required for bluetooth in the /lib/firmware/ap6256 directory. Being further up the "pecking order", this was being loaded in preference to the version in the brcm folder.

Removing the ap6256 folder enabled the correct firmware to load, and all my problems went away!

I also found an interesting script which resets bluetooth and reloads the firmware here: https://github.com/agungpambudi55/bl...n-init-running

The file you want is called "bluetoothResetFirmware.sh"

It needs to be run twice for some reason, but when it reloads the firmware, it will tell you the location where it found it. That is what tipped me off as to the problem!

See my post here for all the gory details: https://www.linuxquestions.org/quest...-a-4175689669/

Hope this helps!

--
Pete

louigi600 02-02-2021 12:57 PM

In my case these are the only firmwares that are loading:
Code:

root@rpi4:~# grep -i firmware: /var/log/dmesg
[    0.080767] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-01-27T22:19:57, variant start
[    0.090781] raspberrypi-firmware soc:firmware: Firmware hash is 99d9a48302e4553cff3688692bb7e9ac760a03fa
[    4.154561] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    4.169412] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Mar  2 2020 23:30:41 version 7.45.202 (r724630 CY) FWID 01-72f6ece2
root@rpi4:~#

But my kernel is missing modules so maybe this information is incomplete.
You got that bluetoothResetFirmware.sh script to run in SlackwareARM ?

Code:

# Created on Mar 2020
# Agung Pambudi <agung.pambudi5595@gmail.com>

sudo killall hciattach
if grep -a Zero /proc/device-tree/model; then
  raspi-gpio set 45 op dl
  sleep 1
  raspi-gpio set 45 op dh
else
  /opt/vc/bin/vcmailbox 0x38041 8 8 128 0
  sleep 1
  /opt/vc/bin/vcmailbox 0x38041 8 8 128 1
fi
sudo btuart

On anything but the RPi0 it would just do:
Code:

killall hciattach
/opt/vc/bin/vcmailbox 0x38041 8 8 128 0
sleep 1
/opt/vc/bin/vcmailbox 0x38041 8 8 128 1
btuart

/opt/vc is not on my system: is it in some SARPi packages ?
Oooops raspbian is hardfloat and 14.2 is softfloat
Code:

root@rpi4:/opt/vc/bin# file vcmailbox
vcmailbox: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, not stripped
root@rpi4:/opt/vc/bin#

This will not work on SlackwareARM 14.2

Not sure how you came to have ap6256 in the first place but i cant find it in /lib/firmware (both SlackwareARM and raspbian )

Exaga 02-02-2021 02:30 PM

1 Attachment(s)
Quote:

Originally Posted by louigi600 (Post 6214541)
Will that make any difference to your newer kernel builds ?
Can you share the kernel config where you fixed the missing modules ?

I'm still testing this... but here you are:

Exaga 02-02-2021 02:45 PM

1 Attachment(s)
@Louigi and here's the dmesg from the latest boot with that kernel...

louigi600 02-02-2021 03:22 PM

@EXAGA did the BT device work any better with the renaming of brcmfmac43455-sdio.txt ?

pchristy 02-02-2021 04:14 PM

David: Just to clarify - I'm running slarm64-current, so there will be differences with slackwarearm-14.2. I have done a lot of messing around with firmware, but I thought I had only changed the contents of the brcm directory. And yes, my installation does have /opt/vc/bin/vcmailbox (no idea what it is or does, though!).

At a guess, it is setting the baud rate of the uart.

--
Pete

louigi600 02-03-2021 12:01 AM

I compiled with Exaga's config and i noticed that I have the btsdio module loaded:
Code:

bnep                  20480  2
fuse                  126976  1
btsdio                16384  0
bluetooth            409600  8 btsdio,bnep

and like this still no difference.
But in the other thread I also remember reading somewhere that, in these conditions, the device showed up wrong in hciconfig ... it's not showing at all on my RPi4.

In this post Exaga is talking about this issue but here it's different there is no device showing up at all.
Code:

root@rpi4:~# rmmod btsdio
root@rpi4:~# modprobe  hci_uart
root@rpi4:~# modprobe btsdio
root@rpi4:~# hciattach ttyS0 bcm43xx 921600
bcm43xx_init
Initialization timed out.
root@rpi4:~# hcitool dev
Devices:
root@rpi4:~#

I tried once with raspbian kernel on slackwareARM 14.2 with SARPi boot firmware and SARPi /lib/firmware/brcm/* ... still no go
Also tried with raspbian lib/firmware/brcm/* ... still no go
Last try I will try with raspbian boot birmware

I noticed these differences in the config.txt :
Code:

root@rpi4:/boot# grep -vE '^#|^ *$' config.txt
dtoverlay=pi3-miniuart-bt
enable_uart=1
[pi4]
[all]
root@rpi4:/boot#

root@nuc8i5:/mnt/tmp/boot# grep -vE '^#|^ *$' config.txt
dtparam=audio=on
[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]
root@nuc8i5:/mnt/tmp/boot#

It was me that enabled the bluetooth LE the other stuff, I think, has nothing to do with bluetooth. I commented it again and borrowed the rest of the boot firmware from raspbian: still nothing.

I'm stuck ... I've no idea what else could make the difference (/etc/firmware is still linked to /lib/firmware).
Anyone have any other ideas ?
something in the userland ? (I mean I'm using raspbian kernel, modules, boot firmware and firmware and still no bt device detected !)

Exaga 02-03-2021 03:39 AM

Quote:

Originally Posted by louigi600 (Post 6215287)
@EXAGA did the BT device work any better with the renaming of brcmfmac43455-sdio.txt ?

Same results after renaming this file to 'brcmfmac43455-sdio.raspberrypi,4-model-b.txt' :scratch:

pchristy 02-03-2021 04:57 AM

If the BT device is not detected, that implies that either the firmware is not being loaded, or it is the wrong firmware. At least, that is the conclusion I came to on my 400.

Once I got that sorted, it all leapt into life.

Can't help much further, because the 400 uses a slightly different chipset. I've lost track of all the things I tried on mine before I finally cracked it (might explain the ap6256 folder!), so I'm going to do a fresh install and start again from scratch - though keeping my currently working card, just in case!

One final thought - and it is clutching at straws - I see you are using 14.2. In the x86 world, this is well past its sell-by date, and most have switched to -current, which is actually very stable. I'm running 64-bit current on the 400, and now I've got the BT working, its almost indistinguishable from the x86_64 version.

--
Pete

louigi600 02-03-2021 07:07 AM

So I will double check which firmware files are being loaded on raspbian ... because I've copied over the entire /lib/firmware/brcm directory from raspbian entirely replacing what was there before (except for the renaming thing on the txt file) ... if it is a firmware issue it's not for something in the brcm subfolder.

I don't get this on the raspbian dmesg
Code:

[    3.966894] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    4.026166] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    4.036813] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    4.039409] cfg80211: failed to load regulatory.db

But this may be wifi related and not bluetooth ... could not spot anything else.

Unfortunately not all firmware loading operations get logged, it is up to the author of the driver.
It would be interesting to enable kernel dynamic debug buy raspbian kernel does not have it enabled
# CONFIG_DYNAMIC_DEBUG is not set
it would be interesting to log every firmware load operation where it is working :(

Found this intresting subfolder:
Code:

root@nuc8i5:/mnt/tmp/lib/firmware# tar cpvzf /tmp/rpi.tgz raspberrypi
raspberrypi/
raspberrypi/bootloader/
raspberrypi/bootloader/critical/
raspberrypi/bootloader/critical/vl805-000138a1.bin
raspberrypi/bootloader/critical/pieeprom-2020-04-16.bin
raspberrypi/bootloader/critical/vl805-000137ad.bin
raspberrypi/bootloader/critical/recovery.bin
raspberrypi/bootloader/critical/pieeprom-2020-09-03.bin
raspberrypi/bootloader/beta/
raspberrypi/bootloader/beta/pieeprom-2020-10-02.bin
raspberrypi/bootloader/beta/pieeprom-2020-10-28.bin
raspberrypi/bootloader/beta/pieeprom-2020-11-24.bin
raspberrypi/bootloader/beta/vl805-000138a1.bin
raspberrypi/bootloader/beta/pieeprom-2020-07-16.bin
raspberrypi/bootloader/beta/pieeprom-2020-12-11.bin
raspberrypi/bootloader/beta/pieeprom-2021-01-05.bin
raspberrypi/bootloader/beta/pieeprom-2021-01-11.bin
raspberrypi/bootloader/beta/pieeprom-2020-07-31.bin
raspberrypi/bootloader/beta/recovery.bin
raspberrypi/bootloader/beta/pieeprom-2021-01-16.bin
raspberrypi/bootloader/beta/pieeprom-2020-09-03.bin
raspberrypi/bootloader/latest
raspberrypi/bootloader/default
raspberrypi/bootloader/stable/
raspberrypi/bootloader/stable/vl805-000138a1.bin
raspberrypi/bootloader/stable/pieeprom-2020-06-15.bin
raspberrypi/bootloader/stable/pieeprom-2020-07-16.bin
raspberrypi/bootloader/stable/pieeprom-2020-04-16.bin
raspberrypi/bootloader/stable/pieeprom-2020-12-11.bin
raspberrypi/bootloader/stable/vl805-000137ad.bin
raspberrypi/bootloader/stable/pieeprom-2021-01-11.bin
raspberrypi/bootloader/stable/pieeprom-2020-07-31.bin
raspberrypi/bootloader/stable/recovery.bin
raspberrypi/bootloader/stable/pieeprom-2021-01-16.bin
raspberrypi/bootloader/stable/pieeprom-2020-09-03.bin
raspberrypi/bootloader/release-notes.md
root@nuc8i5:/mnt/tmp/lib/firmware#

I copied it over along with the regulatory.db but still no BT device.

Ok one last try with the firmware: I will copy the entire /lib/firmware from raspbian to slackware : damn it still no go :(

If it is a firmware issue raspbian is loading firmware trough fallback from somewhere else.

pchristy 02-03-2021 10:40 AM

I'm not sure what the exact filename of the firmware would be for your system, I only know it for the 400. If you can determine exactly which firmware *should* be loaded, try looking for duplicate filenames in /lib/firmware.

I've just done a complete re-install of slarm64 (on a new sd card!), and that troublesome ap6256 folder is definitely there again! I'm not sure where its coming from, as it certainly isn't in the kernel-firmware package! I will need to move it out of the way as part of my (ongoing) setting up!

My new install does not have that /opt/vc/bin/vcmailbox file. Can't remember where I must have got it from - perhaps form the same location as the bluetoothResetFirmware.sh script? I'll have to go back and have a look...

--
Pete

TheTKS 02-03-2021 12:29 PM

louigi, clear something up. In various posts, you’ve mentioned SlackwareARM 14.2 and Sarpi and RPi 4.

But those aren’t meant to go together. You should only be installing -current on RPi 4, otherwise - problems!

So , do you have -current or 14.2 on your Pi4?

I don’t understand it enough to explain why you’ll have problems. I’m going by the instructions on the Sarpi website.

Getting that right doesn’t eliminate the BT problems, though.

TKS

louigi600 02-03-2021 02:42 PM

Quote:

Originally Posted by TheTKS (Post 6215621)
louigi, clear something up. In various posts, you’ve mentioned SlackwareARM 14.2 and Sarpi and RPi 4.

But those aren’t meant to go together. You should only be installing -current on RPi 4, otherwise - problems!

So , do you have -current or 14.2 on your Pi4?

I don’t understand it enough to explain why you’ll have problems. I’m going by the instructions on the Sarpi website.

Getting that right doesn’t eliminate the BT problems, though.

TKS

I have kernel form current and userland from 14.2, there is no official kernel for the RPi4 running 14.2 so that's just a workaround since I don't like to run current.
The kernel does offer hardfloat but the userland will never require it so it's ok to use the current kernel on softfloat userland.
Actually the only problem I have is bluetooth, everything else is working fine, ethernet, wifi, audio, X ... I even compiled the kernel with Exaga's bt config.
I don't think it's because I'm doing this workaround to run 14.2 on my RPi4 ... but I have 2 more spare uSD ... I can try current on one of them and see how it goes.
And besides that I think Exaga himself is having the same problem on current.

Desiderius 02-05-2021 02:42 AM

No Bluetooth
 
I have also a RPI4 running current and impossible to make PI Bluetooth work !

I have also tested many things without success !

When I plug a USB Bluetooth adapter, everything works perfectly ! But impossible to use the onboard Bluetooth adapter


Quote:

Originally Posted by louigi600 (Post 6215665)
I have kernel form current and userland from 14.2, there is no official kernel for the RPi4 running 14.2 so that's just a workaround since I don't like to run current.
The kernel does offer hardfloat but the userland will never require it so it's ok to use the current kernel on softfloat userland.
Actually the only problem I have is bluetooth, everything else is working fine, ethernet, wifi, audio, X ... I even compiled the kernel with Exaga's bt config.
I don't think it's because I'm doing this workaround to run 14.2 on my RPi4 ... but I have 2 more spare uSD ... I can try current on one of them and see how it goes.
And besides that I think Exaga himself is having the same problem on current.


pchristy 02-05-2021 03:30 AM

Desiderius: This is a firmware issue! I have a Pi 400 which is different from the 4, but some of the fixes I used on the 400 apply. The only one that may not is patching Bluez, and even one of those patches is probably a good idea. Have a look here: https://www.linuxquestions.org/quest...-a-4175689669/

The main points are: 1) Replace the /lib/firmware/brcm folder with the one from a recent Raspbian. 2) If your system has a /lib/firmware/ap6256 folder, move it out of the way (I put it in /root/tmp). Don't just delete it, in case you need it back!

This should make your adapter appear! If it still won't bind, try patching Bluez - but I believe this is only necessary for the 400.

The reason for moving the ap6256 folder is that it contains files with the same names as some in the brcm folder. Being higher up the "pecking order", it gets loaded first, so the updates to brcm become ineffective! Moving the ap6256 folder out of the way allows the correct firmware from the brcm folder to load.

That is my experience anyway! It certainly works on the 400.

--
Pete

louigi600 02-05-2021 07:50 AM

Guys I have copied from PRiOS with working onboard bluetooth (on the very same RPi4):
the entire /lib/firmware and /etc/firmware is linked to /lib/firmware.
kernel and modules
boot firmware

The only thing that is left over is the renaming txt file I renamed ... I will remove that and see if it's any better.
I will take with me one of my old bt dongles and see if they work with the same setup.

Desiderius 02-05-2021 07:54 AM

Thanks for your answer @PChristhy

Where can I download the Raspbian /lib/firmware/brcm ?

Desiderius

Quote:

Originally Posted by pchristy (Post 6216379)
Desiderius: This is a firmware issue! I have a Pi 400 which is different from the 4, but some of the fixes I used on the 400 apply. The only one that may not is patching Bluez, and even one of those patches is probably a good idea. Have a look here: https://www.linuxquestions.org/quest...-a-4175689669/

The main points are: 1) Replace the /lib/firmware/brcm folder with the one from a recent Raspbian. 2) If your system has a /lib/firmware/ap6256 folder, move it out of the way (I put it in /root/tmp). Don't just delete it, in case you need it back!

This should make your adapter appear! If it still won't bind, try patching Bluez - but I believe this is only necessary for the 400.

The reason for moving the ap6256 folder is that it contains files with the same names as some in the brcm folder. Being higher up the "pecking order", it gets loaded first, so the updates to brcm become ineffective! Moving the ap6256 folder out of the way allows the correct firmware from the brcm folder to load.

That is my experience anyway! It certainly works on the 400.

--
Pete


pchristy 02-05-2021 08:53 AM

Quote:

Originally Posted by Desiderius (Post 6216464)
Thanks for your answer @PChristhy

Where can I download the Raspbian /lib/firmware/brcm ?

Desiderius

Ah! My Pi-400 came with a working copy of Raspbian, so I simply copied it from there. You can download Raspbian images from here: https://www.raspberrypi.org/software/operating-systems/

You will need to mount the image (or install it on an SD card) and then extract the firmware files.

Alternatively, Exaga's sarpi-hacks package contains firmware files, which I believe he got from Raspbian: https://sarpi.fatdog.eu/index.php?p=downloads

Click on the appropriate version for your system, and it will take you to a second page where you can find the hacks package.

I'm not sure if Exaga uses the "pure" Raspbian files, or if he tweaks them somewhat. I've been using the pure Raspbian ones, which are a bit more effort to obtain, but I know they work!

--
Pete

Desiderius 02-05-2021 09:51 AM

Thanks for your quick answer

I will try to extract it from the Raspian image since actually I have the files from the Exaga sarpi-hacks package ( since I use SARPI to install Slackware ) and it does not work.

I will let you know if it works !

Didier

pchristy 02-05-2021 09:53 AM

Yes, please let us know! I'm afraid I only have a 400, so my experience is not necessarily applicable to other Pis! But from your description of your problem, it sounds the same as mine!

--
Pete

louigi600 02-07-2021 08:41 AM

Quote:

Originally Posted by louigi600 (Post 6216460)
Guys I have copied from PRiOS with working onboard bluetooth (on the very same RPi4):
the entire /lib/firmware and /etc/firmware is linked to /lib/firmware.
kernel and modules
boot firmware

The only thing that is left over is the renaming txt file I renamed ... I will remove that and see if it's any better.
I will take with me one of my old bt dongles and see if they work with the same setup.

Not sure if RPiOS uses some stuff out of /opt/vc to make the bluetooth work but on 14.2 I can't do much about it because I can't find a softfloat version of that stuff.
Concerning the firmware now even the renamd txt fie was removed and still can't see the onboard BT device.

I tried a usb BT dongle and it works

louigi600 02-10-2021 07:52 AM

I have some interesting updates that also span to a little OT from this post.
I recently treated myself with a new 2Gb ram RPi4 instead of the stingy 1Gb I'd usually buy (the old one will become a NAS).
Code:

Hardware        : BCM2711
Revision        : b03114
Serial          : 100000009dc116e9
Model          : Raspberry Pi 4 Model B Rev 1.4

with SARPi4 kernel build from Jan 2021 (v 5.10.11) on the above device usb does not work at all ... but seems to be fine with latest 5.10.14.

No change at all regarding BT on this device even with latest SARPi kernel and firmware.

I set up a multiboot uSD so that the 14.2 userland on it will boot from both RPi4 and RPi0 ... so I can also report that BT on the RPi0 is in the same state as the RPi4

Desiderius 02-11-2021 03:50 AM

I did the test yesterday !

First I have looked for an ap6256 folder on the RPI : no ap6256 folder !

In /lib/firmware I have renamed the "brcm" folder to "old_brcm" and I have put the "brcm" folder extracted from the actual Raspberry PI OS image.

Look for an ap6256 folder : no !

Chown root:root to brcm and reboot !

No Bluetooth icon in the task bar and when asking KDE for Bluetooth adapters, the answer is "No adapter available" !

To be sure, I have plugged an USB Bluetooth stick and the icon appears in the task bar and KDE sees the USB adapter !


Quote:

Originally Posted by pchristy (Post 6216379)
Desiderius: This is a firmware issue! I have a Pi 400 which is different from the 4, but some of the fixes I used on the 400 apply. The only one that may not is patching Bluez, and even one of those patches is probably a good idea. Have a look here: https://www.linuxquestions.org/quest...-a-4175689669/

The main points are: 1) Replace the /lib/firmware/brcm folder with the one from a recent Raspbian. 2) If your system has a /lib/firmware/ap6256 folder, move it out of the way (I put it in /root/tmp). Don't just delete it, in case you need it back!

This should make your adapter appear! If it still won't bind, try patching Bluez - but I believe this is only necessary for the 400.

The reason for moving the ap6256 folder is that it contains files with the same names as some in the brcm folder. Being higher up the "pecking order", it gets loaded first, so the updates to brcm become ineffective! Moving the ap6256 folder out of the way allows the correct firmware from the brcm folder to load.

That is my experience anyway! It certainly works on the 400.

--
Pete


pchristy 02-11-2021 10:17 AM

Oh, dear! Well, as I said at the start, I have a 400, not a 4 which I know is slightly different. I can only say what worked on my system.

It was worth a try, though, and thanks for posting so that others will know!

--
Pete

louigi600 02-12-2021 12:12 AM

So recapping :
  • no trace of ap6256 in /lib/firmware
  • /etc/firmware linked to /lib/firmware
  • tried both SARPi hack /lib/firmware and RPiOS /lib/firmware
  • tried both SARPi boot firmware RPiOS boot firmware
  • tried latest SARPi kernel (5.10.14) and RPiOS kernel (5.4.83)

Onbpard bluetooth does work if I boot RPiOS but not with any of the above combinations with slackwareARM 14.2.
USB bluetooth dongles work fine.

I tried on the below RPi models :

Code:

Hardware        : BCM2711
Revision        : a03111
Serial          : 1000000091328354
Model          : Raspberry Pi 4 Model B Rev 1.1


Hardware        : BCM2711
Revision        : b03114
Serial          : 100000009dc116e9
Model          : Raspberry Pi 4 Model B Rev 1.4

Hardware        : BCM2835
Revision        : 9000c1
Serial          : 000000009b4bd2c0
#this is a RPi0W

Does RPiOS send some vc command to switch on the onboard BT, something with rfkill: they must do something which is not driver/firmware related (I tried with their kernel and firmware).

Exaga 02-12-2021 09:29 AM

Quote:

Originally Posted by louigi600 (Post 6219357)
So recapping :

Does RPiOS send some vc command to switch on the onboard BT, something with rfkill: they must do something which is not driver/firmware related (I tried with their kernel and firmware).

Hi Louigi,

After reading over your own efforts, and those of others, in an attempt to solve this Cypress Bluetooth shizzle on Slackware ARM, I decided to look into this issue with the mindset that it cannot be that difficult to get working - given that Bluetooth works perfectly on the Raspberry Pi OS. Initially I assumed it must be a /dev rule or some other configuration setting that was missing. Historically, in my experience, the key to solving Slackware problems such as this usually lies in the amount of Jaffa cakes consumed while working on it and the level of enjoyment reached while doing so. On this particular wet, cold, freezing, winter's day the enjoyment factor cannot easily be measured. However, this venture took less than a box of (10) Jaffa cakes - and I finished the rest off because they were lonely. Full moon, half moon, total eclipse! <3

So, working loosely from what you (and others) have already tried and done, first I took a look at the Raspberry Pi OS Bluetooth files and configurations. I installed the 'bluez' pkg and noticed that it added a '/usr/lib/firmware/brcm' directory full of driver files. There's just one of them that's relevant to RPi4 Bluetooth, namely the 'BCM4345C0.hcd' file. So, this was my starting point. I copied the entire '/usr/lib/firmware/brcm' directory from the Raspberry Pi OS to Slackware ARM into the same location.

Then I looked at the Raspberry Pi's Device Tree overlays README specifically for boot related Bluetooth settings. As a result I added the following to my 'boot/config.txt' file:

Code:

dtparam=krnbt=on
enable_uart=0

I then spent 25-30 minutes on Google to see what other users had done to get around the problem of Bluetooth not working on the RPi4 and, I have to say, what a plethora of confusion and chaos that revealed! However, I came across this Arch Linux ARM package enabling integrated Bluetooth on Raspberry Pi 3B/3B+/Zero W page with some interesting information. This lead me into creating a directory (which didn't already exist) containing a symlink to the appropriate Bluetooth driver:

Code:

root@torq:~# mkdir -p /usr/lib/firmware/updates/brcm
root@torq:~# ln -svf /usr/lib/firmware/brcm/BCM4345C0.hcd /usr/lib/firmware/updates/brcm/BCM.hcd
'/usr/lib/firmware/updates/brcm/BCM.hcd' -> '/usr/lib/firmware/brcm/BCM4345C0.hcd'
root@torq:~#

I rebooted the RPi4 and did some testing...

Code:

root@torq:~# echo $MACHTYPE
arm-slackware-linux-gnueabihf
root@torq:~# cat /etc/slackware-version
Slackware 14.2+
root@torq:~# cat /proc/device-tree/model
Raspberry Pi 4 Model B Rev 1.2
root@torq:~# hcidump
HCI sniffer - Bluetooth packet analyzer ver 5.55
device: hci0 snap_len: 1500 filter: 0xffffffff
root@torq:~# hcitool dev
Devices:
        hci0    AA:AA:AA:AA:AA:AA
root@torq:~# bluetoothctl
Agent registered
[CHG] Controller AA:AA:AA:AA:AA:AA Pairable: yes
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller AA:AA:AA:AA:AA:AA Discovering: yes
[NEW] Device 61:0D:45:B4:B2:CC 61-0D-45-B4-B2-CC
[NEW] Device 0B:D6:50:46:BA:F5 0B-D6-50-46-BA-F5
[NEW] Device D0:03:4B:57:88:87 D0-03-4B-57-88-87
[NEW] Device 1E:0D:43:77:1D:12 1E-0D-43-77-1D-12
[NEW] Device 08:BE:03:36:81:C7 08-BE-03-36-81-C7
[NEW] Device 40:CB:C0:B6:64:EE 40-CB-C0-B6-64-EE
[bluetooth]# exit
root@torq:~#

I won't be looking to waste any more time on this. I certainly don't need or want Bluetooth but I sincerely hope it works the same for everyone else. I'll think about doing something with the sarpi-hacks pkg to include the above. No guarantees.

The important thing to note here is that it was solved with Slackware ARM and eating Jaffa cakes at the same time, washed down with strong Italian (100% Arabica) coffee. HOO-RAH! :cool:

louigi600 02-12-2021 04:57 PM

Thanks Exaga ... I can confirm that this fixes it on both RPi4 and RPi0
Code:

root@rpi4:~# hciconfig
hci0:  Type: Primary  Bus: UART
        BD Address: DC:A6:32:E3:69:00  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING
        RX bytes:4181 acl:0 sco:0 events:395 errors:0
        TX bytes:59723 acl:0 sco:0 commands:393 errors:0

root@rpi4:~# hcitool scan
Scanning ...
        D4:11:A3:D8:2E:3C      Galaxy A40
root@rpi4:~#

Code:

root@rpi0:~# hcitool dev
Devices:
        hci0    B8:27:EB:DC:34:E1
root@rpi0:~# hciconfig 
hci0:  Type: Primary  Bus: UART
        BD Address: B8:27:EB:DC:34:E1  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING
        RX bytes:2875 acl:0 sco:0 events:213 errors:0
        TX bytes:31922 acl:0 sco:0 commands:213 errors:0

root@rpi0:~# hcitool scan
Scanning ...
        D4:11:A3:D8:2E:3C      Galaxy A40
root@rpi0:~#


pchristy 02-13-2021 02:46 AM

Thanks for your efforts, Exaga! Regarding your comment about not needing bluetooth, it is actually quite important on the 400 which doesn't have an audio out jack.

The only way to get audio out of a 400 is either via the HDMI lead, or bluetooth. Since most monitors don't offer HDMI audio, that leaves only bluetooth, so for some of us, it is quite important!

I'll try adding your commands to the config.txt file on my 400 and report back later today. Mine is currently working OK, but I note that the there has been an overnight upgrade to the kernel-firmware file in slarm64, which may overwrite that dreaded brcm folder again!

Again, thanks for your efforts investigating this!

--
Pete

sndwvs 02-13-2021 03:27 AM

Quote:

Originally Posted by pchristy (Post 6219742)
I'll try adding your commands to the config.txt file on my 400 and report back later today. Mine is currently working OK, but I note that the there has been an overnight upgrade to the kernel-firmware file in slarm64, which may overwrite that dreaded brcm folder again!

if you are using the distribution firmware it is updated according to the slackware distribution, but for some boards, including raspberry pi 3/4, there is its own firmware (upstream + specific for a specific SoC/board) kernel-firmware-bcm2711-5.10.9-aarch64-1mara.txz

pchristy 02-13-2021 04:59 AM

sndwvs: Thanks for pointing that out! I have just been using slackpkg to update from the distribution. Perhaps I should add slackpkg+ and add the location of that firmware file. Is this documented anywhere?

That also answers the question of where the ap6256 folder that caused me so much trouble came from! I originally loaded my installation from one of your images, and then pointed slackpkg at the distribution to update and install everything. Although this updated the /lib/firmware/brcm folder, it didn't update the ap6256 folder, which had an older - and incompatible - version of the BCM4345C5.hcd firmware needed by my 400. My 400 kept loading the wrong firmware, because ap6256 is higher up the "pecking order" than brcm! It took me some time to find that issue!

According to the dates on the files, the two now appear to be in sync.

I think this needs to be flagged up - and/or some kind of work-around devised. Those of us new to ARM are not familiar with these foibles! ;)

BTW, as an aside, although the kernel-firmware package appears to have been updated in the distribution, slackpkg isn't picking it up. I'm guessing this is because the changelog and other associated files haven't caught up yet.

Cheers,

--
Pete


All times are GMT -5. The time now is 06:46 PM.