Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

How to setup Marvell bluetooth

1,275 bytes added, 18:40, 1 October 2015
m
no edit summary
To read CSR chip version
<pre>
root@igep0020:~# bccmd -t bcsp -d /dev/ttyO1 chiprev
Chip revision: 0x0030 (BC4-ROM)
</pre>
----
 
== Setup HCI device ==
 
=== Load Linux kernel modules ===
 
Next, you will need to load some bluetooth modules
<pre>
# modprobe bluetooth
# modprobe hci_uart
# modprobe l2cap
# modprobe rfcomm
# dmesg
Bluetooth: Core ver 2.13
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP ver 2.11
Bluetooth: L2CAP socket layer initialized
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM ver 1.10
</pre>
=== Load PSKEY parameter parameters ===
With your preferred editor create a 'bluez.psr' file like this:
<pre>
And send the file using the bccmd tool.
<pre>
# bccmd -t bcsp -d /dev/ttyO1 psload -r bluez.psr
Loading PSKEY_LC_ENHANCED_POWER_TABLE ... done
Loading PSKEY_LC_COMBO_DISABLE_PIO_MASK ... done
Loading PSKEY_LC_COMBO_DOT11_CHANNEL_PIO_BASE ... done
</pre>
 
----
 
== Setup HCI device ==
 
=== Load Linux kernel modules ===
 
Next, you will need to load some bluetooth modules. Prompt:
<pre>
modprobe bluetooth
modprobe hci_uart
modprobe hidp
modprobe l2cap
modprobe rfcomm
</pre>
 
You shoud get these logs ( using [[IGEP_firmware_Yocto|IGEP Firmware Yocto 1.2.2-3]] ):
<pre>
root@igep00x0:~# modprobe bluetooth
[ 1183.967773] Bluetooth: Core ver 2.15
[ 1183.971588] NET: Registered protocol family 31
[ 1183.976226] Bluetooth: HCI device and connection manager initialized
[ 1183.982849] Bluetooth: HCI socket layer initialized
root@igep00x0:~# modprobe hci_uart
[ 1184.013031] Bluetooth: HCI UART driver ver 2.2
[ 1184.017669] Bluetooth: HCI H4 protocol initialized
[ 1184.022674] Bluetooth: HCI BCSP protocol initialized
[ 1184.027832] Bluetooth: HCILL protocol initialized
root@igep00x0:~# modprobe hidp
[ 1184.067993] Bluetooth: L2CAP ver 2.15
[ 1184.071807] Bluetooth: L2CAP socket layer initialized
[ 1184.087188] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
root@igep00x0:~# modprobe l2cap
root@igep00x0:~# modprobe rfcomm
[ 1184.147399] Bluetooth: RFCOMM TTY layer initialized
[ 1184.152526] Bluetooth: RFCOMM socket layer initialized
[ 1184.157867] Bluetooth: RFCOMM ver 1.11
</pre>
<pre>
# hciattach -s 115200 /dev/ttyO1 bcsp 115200 noflow# hciconfig hci0 up# hciconfig hci0 piscan# hciconfig -a hci0
hci0: Type: UART
BD Address: 00:02:5B:00:A5:A5 ACL MTU: 310:10 SCO MTU: 64:8
=== Scan for HCI bluetooth peer devices ===
<pre>
# hcitool -i hci0 scan
Scanning ...
00:1E:A4:FC:EC:2E Phone
</pre>
=== Ping bluetooth peer device ===
<pre>
root@igep00x0:/etc/bluetooth# l2ping -c 4 00:1E:A4:FC:EC:2E
Ping: 00:1E:A4:FC:EC:2E from 00:02:5B:00:A5:A5 (data size 44) ...
44 bytes from 00:1E:A4:FC:EC:2E id 0 time 38.79ms
44 bytes from 00:1E:A4:FC:EC:2E id 1 time 38.60ms
44 bytes from 00:1E:A4:FC:EC:2E id 2 time 38.66ms
44 bytes from 00:1E:A4:FC:EC:2E id 3 time 538.79ms
4 sent, 4 received, 0% loss
</pre>
== Others ==
=== Switch-off wifi to get better bluetooth performance ===
For best performance you need to disable WIFI, you can do this:<br><br>Disable wlan0 interface<pre>ifconfig wlan0 down</pre> Switch-off "power down" line of wifi* For IGEPv2 RevC ('''IGEP0020-RC''') and IGEP COM MODULE ('''IGEP0030-RE''') series <pre>echo 0 > /sys/class/gpio/gpio138/value</pre> * For older IGEPv2 RevB ('''IGEP0020-RB''') series
<pre>
# echo 0 > /sys/class/gpio/gpio94/value
</pre>
4,199
edits