Anyone got Bluetooth running with the R01 processor yet?

Am I missing a driver or something? Have the latest image, but bluetoothctl doesn’t spot the hardware.

3 Likes

To enable bluetooth on uConsole, you need to:

  • modify the device tree to add the missing bluetooth device, and make it no conflicting nodes
  • recompile the kernel with some missing options on, so the drivers are enabled
  • install bluetooth firmware, because it’ll be loaded on device initialization
  • install related userspace tools(bluez, etc.)

The modified device tree and related instructions can be found in my repository.

4 Likes

Hello @PotatoMania I compiled your kernel and everything works great but the Bluetooth (did not tried the 4G yet though). I can’t get it to load the module, no particular logs are generated. Besides copying the firmware in the right path, is there something to do in particular?

To enable bluetooth, you need:

  • proper device tree with the bluetooth node
  • the kernel driver module
  • firmware in the right path
  • daemons for the bluetooth protocol stack(bluez) installed and running

I think the first 3 requirements are met since you are the code in my repo. The kernel driver will not emit any log if the log level is low. You can check if the module is loaded using lsmod. You can increase the log level to max by append loglevel=8 to the kernel cmdline.

No luck. No module is loaded when bluetooth is restarted. I can only find btbcm, and manually loading it does not fix the No default controller available output of bluetoothctl. The sunxi-bt is unblocked in rfkill. I’ve just installed bluez and -utils, do I need more ?

Based on the limited information, I have no clue why BT on your device doesn’t work. I’d suggest to increase the kernel log level(in kernel command line in [boot partition]/extlinux/extlinux.conf) to get the log produced by relevant kernel modules to see if something goes wrong.

Further more, I’d like to hear how you install the kernel and bundled stuff. Are you using an ArchLinux rootfs? Or something else but you managed to install the kernel? Are you using the package manager? Anything will be helpful. BTW you can check your current kernel version with uname -a.

For userspace software, bluetooth daemon(bluetoothd) need to be started as a service.

There are at least 3 kernel modules related: bluetooth, btbcm, hci_uart. If my memory is right, sunxi-bt is not relevant and is just leftovers from the original configuration.

Do you place the BT firmware into /lib/firmware (or some path like this)? Typically these Wifi/BT Combo chip/module don’t need firmware to make wifi work, but for BT it usually need firmware…

Some information for reference:

Thank you for your replies.

@NekoRouter I placed the BCM4345C5.hcd firmware in /usr/lib as advised on the git. WiFi works thanks to the AUR package for its firmware, depite having some logs about the BCM43456-sdio with the brcmfmac

[ 25.870486] brcmfmac: F1 signature read @0x18000000=0x15294345
[ 25.898377] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[ 25.950780] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43456-sdio.allwinner,d1-h.txt failed with error -2
[ 26.184974] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43456-sdio for chip BCM4345/9
[ 26.216275] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/9 wl0: May 14 2020 17:26:08 version 7.84.17.1 (r871554) FWID 01-3d9e1d87

[ 27.974757] [DISP]disp_module_init finish
[ 27.993678] alloc_fd: slot 21 not NULL!
[ 28.402827] HDMI 2.0 driver init start!
[ 28.422339] boot_hdmi=false
[ 28.425694] ERROR: pinctrl_get for HDMI2.0 DDC fail
[ 28.460103] HDMI2.0 module init end
[ 28.854227] HDMI cable is connected
[ 28.858622] _read8-Error:I2C DDC Read8 extended failed for i2cAddr 0x50 seg 0x30 pointer 0x0 addr 0x0
[ 28.870659] _read8-Error:I2C DDC Read8 extended failed for i2cAddr 0x50 seg 0x30 pointer 0x0 addr 0x0
[ 28.882089] _read8-Error:I2C DDC Read8 extended failed for i2cAddr 0x50 seg 0x30 pointer 0x0 addr 0x0
[ 28.893507] _read8-Error:I2C DDC Read8 extended failed for i2cAddr 0x50 seg 0x30 pointer 0x0 addr 0x0
[ 28.904642] Error:EDID read failed

[ 24.851464] sunxi-rfkill soc@3000000:rfkill@0: set block: 0
[ 24.898277] sunxi-rfkill soc@3000000:rfkill@0: bt power on success

@PotatoMania I use the felixc.at Arch rootfs I compiled your kernel on my x86 main computer, and installed it from chrooting into the SD. I use pacman as the package manager. I got the Bluetooth stack from there, but I realize I probably miss some modules, namely the Bluetooth one. It does not load whith the systemd unit.

It is the only issue I encountered up until now, even 4g works better right now. Do you install bluez from official repos or did you compile it for your kernel? The output of uname -a :

Linux archlinux 5.4.61-1-uconsole-r01-bsp #1 PREEMPT Sun, 21 Jan 2024 18:05:58 +0000 riscv64 GNU/Linux

1 Like

The bluetooth module is compiled into the kernel(in config CONFIG_BT=y rather than =m), so it’s expected that there’s no dedicated mod file.

The firmware file should be placed at /usr/lib/firmware/brcm. For instance, the BCM4345C5.hcd should be placed to /usr/lib/firmware/brcm/BCM4345C5.hcd. The actual path is important. From your partial log, I see no error about the hcd file. If the driver is loaded and the hcd file is not present, the driver will complain about that, and therefore you can check if the hardware is detected and the driver is working.

My rfkill output:

ID TYPE      DEVICE      SOFT      HARD
 0 bluetooth hci0     blocked unblocked
 1 wlan      phy0   unblocked unblocked

Yeah I blocked bluetooth manually because the co-existence with WiFi is so bad that I prefer external dongle for BT audio devices.

The firmware is at the right place. My BT device appears as sunxi-bt in my rfkill output, maybe there is something there. Also no bluetooth module is loaded at boot or when I launch the bluetooth service.

I’ll go back to kernel compilation and dig deeper into that. I’ll let you know!

It’s likely that you used the wrong device tree. Maybe you need to change the /extlinux/extlinux.conf.

My example:

default uc-arch-5.4.61

label uc-arch-5.4.61
        linux /vmlinuz-linux-uconsole-r01-bsp
        fdt /dtbs/sunxi/uc_board.dtb
        append root=PARTUUID=17d04eeb-aa6f-486e-1234-567808680000 clk_ignore_unused console=tty0 loglevel=8 cma=96M LANG=en_US.UTF-8 fbcon=rotate:1 vt.cur_default=0x300058 random.trust_cpu=on

Note that PARTUUID is different from UUID and you can get it though blkid. The block path method will still work.

1 Like

Thank you @PotatoMania I should have double checked the extlinux conf, I pointed to the wrong tree indeed. Now I got the bluetooth up and running, thank you!

1 Like

I might go back to the R-01 in my uConsole, lack of BT was the issue. Is there a simple set of instructions to enable BT on the R-01?