2 2
data

OrangePi Lite2 & 3 Bluetooth

Recommended Posts

hciattach is not necessary, the kernel does that automatically if configured like this:

 

https://megous.com/git/linux/commit/?h=opi3-5.2&id=0c27ac4b4586bc2c0dded85b5bf82f78531d01c3

 

Sorry, I don't have guide to make BT work, because there's shouldn't be much to configure. All you need is a kernel with the support and then you just need to configure BT address (btmgmt public-addr) for your device. Kernel part is something armbian should figure out.

 

Share this post


Link to post
Share on other sites

Also without kernel's H6 RTC patches, you'll not make this work, because BT will not have clock enabled.

Share this post


Link to post
Share on other sites

Do you know if these patches are included in the current lite2 built?

Share this post


Link to post
Share on other sites
15 hours ago, megi said:

hciattach is not necessary, the kernel does that automatically if configured like this:

 

 

Allright, so I just wait for 5.2 Kernel and hope for the best. Thanks for your answer though!

 

And even if it did not work, it was kinda fun to try to figure out how that works. Even though everything with drivers (firmware) is still insane complicated on Linux :)

Share this post


Link to post
Share on other sites
On 5/27/2019 at 8:37 PM, data said:

Do you know if these patches are included in the current lite2 built?

I don't see them in armbian. Anyway, I only have Opi 3 working, and lite2 may have a different bluetooth chip.

Share this post


Link to post
Share on other sites
On 5/30/2019 at 3:50 AM, megi said:

I don't see them in armbian. Anyway, I only have Opi 3 working, and lite2 may have a different bluetooth chip.

If I convert DTB to DTS (and back) and add this:

 

/* There's the BT part of the AP6256 connected to that UART */ &uart1 { pinctrl-names = "default"; pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; uart-has-rtscts; status = "okay"; bluetooth { compatible = "brcm,bcm4345c5"; clocks = <&rtc 1>; clock-names = "lpo"; device-wakeup-gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */ host-wakeup-gpios = <&r_pio 1 1 GPIO_ACTIVE_HIGH>; /* PM1 */ shutdown-gpios = <&r_pio 1 4 GPIO_ACTIVE_HIGH>; /* PM4 */ max-speed = <1500000>; }; };

 

And copy https://github.com/orangepi-xunlong/OrangePiH6_external/tree/master/ap6256 to:

/lib/firmware/brcm/(BCM4345C5.hcd)

 

Am I correct that it will it work then? (I'm using a OPi3)

Share this post


Link to post
Share on other sites

Seems i found some workaround for OPi Lite2 board under  latest armbian image for OPi lite2 (Linux orangepilite2 5.2.5-sunxi64 #5.92).

 

uart1 is configured properly by board DTB (no loaded uart1 overlay!) but bt chip on ttyS1 not answered.

 

Board schematics (OrangePi_Lite2_Schematics_v2.0.pdf) is strange: BT-RST-N pulled up to vcc (R139 on schematics) and pulled down to GND (R147).

 

After boot pin PM4 (BT-REG-ON -> BT-RST-N) is unclaimed and seems BT-RST-N actually has low level.

cat /sys/kernel/debug/pinctrl/*/pinmux-pins

pin 388 (PM4): UNCLAIMED

 

1. Try pull up this pin:

echo 388 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio388/direction
echo 1 >/sys/class/gpio/gpio388/value
 

2. load hci_uart module and do attach to uart1:

modprobe hci_uart

hciattach /dev/ttyS1 any
 

3. now i see two hci devices:

root@orangepilite2:~# hciconfig
hci1:   Type: Primary  Bus: UART
        BD Address: AA:AA:AA:AA:AA:AA  ACL MTU: 1021:8  SCO MTU: 64:1
        DOWN
        RX bytes:712 acl:0 sco:0 events:38 errors:0
        TX bytes:464 acl:0 sco:0 commands:44 errors:0

hci0:   Type: Primary  Bus: SDIO
        BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0
        DOWN
        RX bytes:0 acl:0 sco:0 events:0 errors:0
        TX bytes:0 acl:0 sco:0 commands:0 errors:0

 

4.  try to up hci1:

hciconfig hci1 up

 

5. hci1 up and running now.

root@orangepilite2:~# hciconfig hci1
hci1:   Type: Primary  Bus: UART
        BD Address: AA:AA:AA:AA:AA:AA  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING
        RX bytes:1410 acl:0 sco:0 events:74 errors:0
        TX bytes:895 acl:0 sco:0 commands:80 errors:0
 

root@orangepilite2:~# hciconfig hci1 version
hci1:   Type: Primary  Bus: UART
        BD Address: AA:AA:AA:AA:AA:AA  ACL MTU: 1021:8  SCO MTU: 64:1
        HCI Version: 4.1 (0x7)  Revision: 0x0
        LMP Version: 4.1 (0x7)  Subversion: 0x6119
        Manufacturer: Broadcom Corporation (15)
 

 

Share this post


Link to post
Share on other sites

You can always give 5.3-rcX kernel a shot if you haven't already.

You can find some prebuild debs and images following the link below.

Share this post


Link to post
Share on other sites

Still the BT shows:

 

hci1:   Type: Primary  Bus: SDIO
        BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0
        DOWN
        RX bytes:0 acl:0 sco:0 events:0 errors:0
        TX bytes:0 acl:0 sco:0 commands:0 errors:0
 

 

Running 5.3.0 RC8

Share this post


Link to post
Share on other sites

Do you need only the first file or all the others too?

 

BCM4345C5.hcd add ap6256 firmware8 months ago

config.txt add ap6256 firmware8 months ago

fw_bcm43456c5_ag.bin add ap6256 firmware8 months ago

fw_bcm43456c5_ag_apsta.bin add ap6256 firmware8 months ago

nvram.txt

 

well, I got them to the directory, but they show up in green, does that mean anything. If it look at it with lsattr it looks the same:

 

--------------e---- ./BCM4345C5.hcd
 

and with hciconfig it still show the BT device as 0000000 and not working

files.png

Share this post


Link to post
Share on other sites
On 9/13/2019 at 3:50 PM, Werner said:

I do not own this board so no idea.

thanks anyhow. I feel I'm so close with the description stating that the file need to be there and that is it. And I have the file there and it is not working but showing up in a different color. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
2 2