CSR USB Bluetooth on linux

embeddedboy
Hi all,
I am new to Linux and want to install the USB Bluetooth module on Linux
kernel, what are the process to follow, I have created zImage by selecting
(enabling) in Bluetooth subsystem, also enabled the usb drivers, and
installed the generated zImage on Tiny6410 with supervivi and rootfs
(QTopia File system). 
    After rebooting the system and inserting the module on board it will
show that module is detected but does not accept HCI commands. what will be
the problem, how to enable the HCI command. what are the process to follow
to attach another Bluetooth device with tiny6410. I am clueless now and
kind find the path, please suggest anything if you have any idea.

embeddedboy
I got some solution, I am able to run the commands and scan the nearby
bluetooth devices but not able to connect with bluetooth devices.

If any idea how to configure pin please suggest me...

I followed following sequence
I build the kernel with bluez stack enable all the bluetooth parameter are
selected as a kernel module with [*] and with usb hci support.

then we need to download the bluez-libs-2.25.tar.gz and
bluez-utils-2.25.tar.gz and bluez-hcidump-2.30.tar.gz from
www.bluetooth.org 

Cross compile it with bluez-libs-2.25 with arm-linux-gcc.
Cross compile it with bluez-utilis-2.25 with arm-linux-gcc.
Cross compile it with bluez-hcidump-2.30 with arm-linux-gcc.

with cross compile generate the root file system with name as
bluez-rootfs.... and copy the generated etc and usr folder to
rootfs_qtopia_qt4

then we are able to run the hcitool command.

embeddedboy
anyone has any idea how to set up the hci.conf file

embeddedboy
sorry for download link given its not www.bluetooth.org the correct link is

http://www.bluez.org/download/

download following packages from the link

bluez.sf.net/download/bluez-libs-2.25.tar.gz
bluez.sf.net/download/bluez-utils-2.25.tar.gz

embeddedboy
I am still not able to connect the bluetooth devices 
I have followed below sequence to cross compilation of bluez stack.
I am able to scan the nearby devices. but not able to connect then.

by sensing hcitool auth <bdaddr>, the tiny 6410 will respond with following
error mesage

HCI authentication request failed: Connection timed out

please suggest if any one have any idea.

2016  cd
 2017  mkdir tiny6410
 2018  cd tiny6410/
 2019  tar xvzf /media/Bb/FriendlyARM/DVD\
1/Linux/arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz 
 2020  tar xvzf /media/Bb/FriendlyARM/DVD\ 1/BlueZ\
tools/bluez-libs-2.25.tar.gz 
 2021  tar xvzf /media/Bb/FriendlyARM/DVD\ 1/BlueZ\
tools/bluez-utils-2.25.tar.gz 
 2022  tar xvzf /media/Bb/FriendlyARM/DVD\ 1/BlueZ\
tools/bluez-hcidump-2.3.tar.gz 
 2023  mkdir bluez-rootfs
 2024  ls
 2025  ls -l
 2026  cd bluez-libs-2.25/
 2027  export
PATH=$PATH:/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/bin/arm
-linux-
 2028  export
CC=/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-g
cc
 2029  export
GCC=/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-g
cc
 2030  export
RANLIB=/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/bin/arm-lin
ux-ranlib
 2031  export
LD=/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-l
d
 2032  export
NM=/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-n
m
 2033  export
AS=/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-a
s
 2034  export
AR=/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-a
r
 2035  ./configure --build=i686-pc-linux-gnu --host=arm-linux
--sysconfdir=/home/administrator/tiny6410/bluez-rootfs/etc
--prefix=/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/arm-none-
linux-gnueabi
 2036  make

following error found in after hitting make 
sdp.c:426:17: error: 'USHRT_MAX' undeclared (first use in this function)

add #include <limits.h> file in sdp.c file located at
bluez-libs-2.25/src/sdp.c file marked with + sign

#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <malloc.h>
#include <syslog.h>
#include <sys/un.h>
+#include <limits.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/types.h>



 2037  ./configure --build=i686-pc-linux-gnu --host=arm-linux
--sysconfdir=/home/administrator/tiny6410/bluez-rootfs/etc
--prefix=/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/arm-none-
linux-gnueabi
 2038  make
 2039  make install
 2040  sudo make install
 2041  cd ..
 2042  cd bluez-utils-2.25/
 2043  history 
 2044  ./configure --build=i686-pc-linux-gnu --host=arm-linux
--mandir=/home/administrator/tiny6410/bluez-rootfs/usr/share/man
--sysconfdir=/home/administrator/tiny6410/bluez-rootfs/etc
--localstatedir=/home/administrator/tiny6410/bluez-rootfs/var
--prefix=/home/administrator/tiny6410/bluez-rootfs/usr
 2045  make


add #include <limits.h> file in
/home/administrator/tiny6410/bluez-utils-2.25/tools/hciattach.c

#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <syslog.h>
+#include <limits.h>
#include <termios.h>
#include <time.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <sys/socket.h>



 2046  ./configure --build=i686-pc-linux-gnu --host=arm-linux
--mandir=/home/administrator/tiny6410/bluez-rootfs/usr/share/man
--sysconfdir=/home/administrator/tiny6410/bluez-rootfs/etc
--localstatedir=/home/administrator/tiny6410/bluez-rootfs/var
--prefix=/home/administrator/tiny6410/bluez-rootfs/usr
 2047  make


error Found 
hciconfig.c:732:16: error: 'PATH_MAX' undeclared (first use in this
function)

add #include <limits.h> file in
/home/administrator/tiny6410/bluez-utils-2.25/tools/hciattach.c

#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include <getopt.h>
#include <sys/ioctl.h>
#include <sys/socket.h>





 2048  ./configure --build=i686-pc-linux-gnu --host=arm-linux
--mandir=/home/administrator/tiny6410/bluez-rootfs/usr/share/man
--sysconfdir=/home/administrator/tiny6410/bluez-rootfs/etc
--localstatedir=/home/administrator/tiny6410/bluez-rootfs/var
--prefix=/home/administrator/tiny6410/bluez-rootfs/usr
 2049  make


error found
request.c:654:23: error: 'USHRT_MAX' undeclared (first use in this
function)

add following to
/home/administrator/tiny6410/bluez-utils-2.25/sdpd/request.c

#include <stdio.h>
#include <errno.h>
#include <malloc.h>
#include <syslog.h>
#include <sys/socket.h>
+#include <limits.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>



 2050  ./configure --build=i686-pc-linux-gnu --host=arm-linux
--mandir=/home/administrator/tiny6410/bluez-rootfs/usr/share/man
--sysconfdir=/home/administrator/tiny6410/bluez-rootfs/etc
--localstatedir=/home/administrator/tiny6410/bluez-rootfs/var
--prefix=/home/administrator/tiny6410/bluez-rootfs/usr
 2051  make

error found 
sdp.c:74:16: error: 'PATH_MAX' undeclared (first use in this function)

add #include <limits.h>  to
/home/administrator/tiny6410/bluez-utils-2.25/hidd/sdp.c

#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <malloc.h>
+#include <limits.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/socket.h>


 2052  ./configure --build=i686-pc-linux-gnu --host=arm-linux
--mandir=/home/administrator/tiny6410/bluez-rootfs/usr/share/man
--sysconfdir=/home/administrator/tiny6410/bluez-rootfs/etc
--localstatedir=/home/administrator/tiny6410/bluez-rootfs/var
--prefix=/home/administrator/tiny6410/bluez-rootfs/usr
 2053  make
 2054  make install


Installation of bluez-utilis-2.25 completed successfully

 2055  cd ..
 2056  cd bluez-hcidump-2.3/
 2057  ./configure --build=i686-pc-linux-gnu --host=arm-linux
--mandir=/home/administrator/tiny6410/bluez-rootfs/usr/share/man 
--prefix=/home/administrator/tiny6410/bluez-rootfs/usr
 2058  make
 2059  make install

Installation of bluez-hcidump-2.3/ completed successfully

Now extract the rootfs_qtopia_qt4-20120517.tar.gz in tiny6410 folder

 2060  cd ..
 2061  tar xvzf /media/Bb/FriendlyARM/DVD\
1/Linux/rootfs_qtopia_qt4-20120517.tar.gz 

permission required 

 2062  sudo tar xvzf /media/Bb/FriendlyARM/DVD\
1/Linux/rootfs_qtopia_qt4-20120517.tar.gz 
 2063  cp -r /home/administrator/tiny6410/bluez-rootfs/
/home/administrator/tiny6410/rootfs_qtopia_qt4/
copy the content of /home/administrator/tiny6410/bluez-rootfs/ to
/home/administrator/tiny6410/rootfs_qtopia_qt4/

 2065  sudo cp -r /home/administrator/tiny6410/bluez-rootfs/etc/
/home/administrator/tiny6410/rootfs_qtopia_qt4/
 2066  sudo cp -r /home/administrator/tiny6410/bluez-rootfs/usr/
/home/administrator/tiny6410/rootfs_qtopia_qt4/
 2067  sudo cp -r /home/administrator/tiny6410/bluez-rootfs/var/
/home/administrator/tiny6410/rootfs_qtopia_qt4/
 2068  cd rootfs_qtopia_qt4/
 2070  ls
 2071  cd ..


 2073  mkubimage-mlc2 rootfs_qtopia_qt4/ rootfs_bluez_2.25.ubi
 2074  sudo mkubimage-mlc2 rootfs_qtopia_qt4/ rootfs_bluez_2.25.ubi
 2075  sudo minicom


and install the superboot, kernel zImage and rootfs_bluez_2.25.ubi into the
tiny6410 board.

after installation completed the command shows that linraries are not found
we need to reinstall the libraries by using following command

 2078  cd bluez-libs-2.25/
 2079  ./configure --build=i686-pc-linux-gnu --host=arm-linux
--includedir=/home/administrator/tiny6410/bluez-rootfs/usr/include/
--libdir=/home/administrator/tiny6410/bluez-rootfs/usr/lib 
--sysconfdir=/home/administrator/tiny6410/bluez-rootfs/etc
--prefix=/home/administrator/tiny6410/opt/FriendlyARM/toolschain/4.5.1/arm-none-
linux-gnueabi
 2080  make
 2081  make install
 2082  sudo make install
 2083  cd ..
 2084  sudo rm -rf rootfs_bluez_2.25.ubi 
 2085  sudo cp -r /home/administrator/tiny6410/bluez-rootfs/etc/
/home/administrator/tiny6410/rootfs_qtopia_qt4/
 2086  sudo cp -r /home/administrator/tiny6410/bluez-rootfs/usr/
/home/administrator/tiny6410/rootfs_qtopia_qt4/
 2087  sudo cp -r /home/administrator/tiny6410/bluez-rootfs/var/
/home/administrator/tiny6410/rootfs_qtopia_qt4/
 2088  sudo mkubimage-mlc2 rootfs_qtopia_qt4/ rootfs_bluez_2.25.ubi

and install the superboot, kernel zImage and rootfs_bluez_2.25.ubi into the
tiny6410 board.

Board is running and scanning the nearby bluetooth devices.

venkat
We are integrating CSR8510 dongle with Android kitkat on TI Beaglebone
black.

Do you have any guide to integrate the USB dongle to Android system