Firefly Open Source Community

   Login   |   Register   |
New_Topic
Print Previous Topic Next Topic

[Linux] Bluetooth not working

44

Credits

10

Prestige

0

Contribution

new registration

Rank: 1

Credits
44

【Linux】 Bluetooth not working

Posted at 5/16/2022 18:00:18      View:2395 | Replies:3        Print      Only Author   [Copy Link] 1#
Hey guys,

I'm playing with Station M2 (which is the same hardware as rk3566-firefly-roc-pc board) and bluetooth is not working properly for me on Armbian and ubuntu.

I'm using armbian with 5.18.0-rc4-media kernel.

dmesg reports there's a conflict between hci uart port and serial@fdd50000, and hci socket is not available in the system, hciconfig does not show anything.

I tried recompiling .dtd with everything related to serial@fdd50000 removed, and now hciconfig does display the socket, but it is always in DOWN state.

  1. hci0:        Type: Primary  Bus: UART
  2.         BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0
  3.         DOWN
  4.         RX bytes:0 acl:0 sco:0 events:0 errors:0
  5.         TX bytes:4 acl:0 sco:0 commands:1 errors:0
Copy the code


Dmesg also shows "[   15.682377] Bluetooth: hci0: command 0x0c03 tx timeout"

Any idea how can this be fixed?

Reply

Use props Report

486

Credits

20

Prestige

15

Contribution

intermediate

Rank: 3Rank: 3

Credits
486
Posted at 5/17/2022 16:10:25        Only Author  2#
Bluetooth uses uart1, which will not conflict with serial@fdd50000(uart0).

Confirm which wifi-bt module is used and whether the Bluetooth firmware is loaded normally.
This repository may have the information you need. https://gitlab.com/firefly-linux ... tree/rk356x/firefly
Reply

Use props Report

44

Credits

10

Prestige

0

Contribution

new registration

Rank: 1

Credits
44
Posted at 5/21/2022 18:31:43        Only Author  3#
Last edited by lexaguskov In 5/21/2022 18:34 Editor
时间的蝴蝶 Posted at 5/17/2022 16:10
Bluetooth uses uart1, which will not conflict with serial@fdd50000(uart0).

Confirm which wifi-bt  ...

This is my dmesg:

===[   12.510796] rockchip-pinctrl pinctrl: pin gpio0-17 already requested by fdd50000.serial; cannot claim for serial0-0
[   12.510809] rockchip-pinctrl pinctrl: pin-17 (serial0-0) status -22
[   12.510816] rockchip-pinctrl pinctrl: could not request pin 17 (gpio0-17) from group bt-enable-h  on device rockchip-pinctrl
[   12.510822] hci_uart_bcm serial0-0: Error applying setting, reverse things back
[   12.559615] random: crng init done
[   12.559634] random: 7 urandom warning(s) missed due to ratelimiting
[   12.753899] cfg80211: failed to load regulatory.db
[   12.765637] brcmfmac mmc2:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.firefly,rk3566-roc-pc.txt failed with error -2
[   12.765660] brcmfmac mmc2:0001:1: Falling back to sysfs fallback for: brcm/brcmfmac43455-sdio.firefly,rk3566-roc-pc.txt
[   12.969434] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[   12.980319] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04
===

what concerns me is line 3, some gpio pin (one that enables bluetooth chip?) is allocated for uart0, according to logs. Im using armbian with `rk3566-firefly-roc-pc.dtd`, heres the decompiled device tree:
====
...
        serial@fdd50000 {
                compatible = "rockchip,rk3568-uart\0snps,dw-apb-uart";
                reg = <0x00 0xfdd50000 0x00 0x100>;
                interrupts = <0x00 0x74 0x04>;
                clocks = <0x1c 0x0b 0x1c 0x2c>;
                clock-names = "baudclk\0apb_pclk";
                dmas = <0x24 0x00 0x24 0x01>;
                dma-names = "tx\0rx";
                pinctrl-0 = <0x25>;
                pinctrl-names = "default";
                reg-io-width = <0x04>;
                reg-shift = <0x02>;
                status = "okay";
                phandle = <0xe1>;
        };


...

        serial@fe650000 {
                compatible = "rockchip,rk3568-uart\0snps,dw-apb-uart";
                reg = <0x00 0xfe650000 0x00 0x100>;
                interrupts = <0x00 0x75 0x04>;
                clocks = <0x0e 0x11f 0x0e 0x11c>;
                clock-names = "baudclk\0apb_pclk";
                dmas = <0x24 0x02 0x24 0x03>;
                dma-names = "tx\0rx";
                pinctrl-0 = <0x90 0x91>;
                pinctrl-names = "default";
                reg-io-width = <0x04>;
                reg-shift = <0x02>;
                status = "okay";
                uart-has-rtscts;
                phandle = <0x10a>;

                bluetooth {
                        compatible = "brcm,bcm43438-bt";
                        clocks = <0x92 0x01>;
                        clock-names = "lpo";
                        device-wake-gpios = <0x93 0x11 0x00>;
                        host-wake-gpios = <0x93 0x10 0x00>;
                        shutdown-gpios = <0x93 0x0f 0x00>;
                        pinctrl-names = "default";
                        pinctrl-0 = <0x94 0x95 0x96>;
                        vbat-supply = <0x23>;
                        vddio-supply = <0x45>;
                };
        };

====

could it be that my .dtd file is incorrect?


I checked the rkwifibt repo and it does not seem to work

  1. # sh bt_load_broadcom_firmware</div><div>brcm_patchram_plus1: no process found
  2. ###AMPAK FW Auto detection patch version = [v1.1 20161117]##
  3. Can't get device info: No such devic
  4. root@os:/rkwifibt# cp: cannot stat '/data/cfg/device_info.txt': No such file or director
  5. port --enable_hci could not be opened, error 2
Copy the code

The chip is AP6255







已有 1评分Prestige +10 Pack up reason
jeremiahc + 10

View all ratings

Reply

Use props Report

6

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
6
Posted at 9/3/2022 06:34:43        Only Author  4#
lexaguskov Posted at 5/21/2022 18:31
This is my dmesg:

===[   12.510796] rockchip-pinctrl pinctrl: pin gpio0-17 already requested by ...

Did you ever get a solution to this? Not having Bluetooth on my Ubuntu Station M2 is the single outstanding issue that keeps me from full functionality.

Any tips for disabling the serial TTY on pin for UART0 are really welcome.

— Jeremiah
Reply

Use props Report

You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list