[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bluetooth-dev] Howto for csr and openbt Version 2.0


Thanks for all the feedback we got. We've made the changes. About the
URL where to get the howto, we think it would be the best way, to
publish the howto with the OpenBT-Project. 

Luki and Dejan
Content Security by MailMarshal
Howto - CSR-Hardware and OpenBT

Lukas Valle & Dejan Miletic

lukivalle@xxxxxxx.ch, miletic.dejan@xxxxxxx.ch

Version 2.0


  1. Introduction

  2. 1.1 Preface
    1.2 Copyright
    1.3 The authors
    1.4 Feedback
    1.5 Acknowledgements
  3. CSR and OpenBT
  4. Compilation with H4 Support
  5. Compilation with BCSP Support
  6. Use OpenBT
  7. Transmit bitstream over ACL
  8. Test
  9. Errors
  10. Links

  1. Introduction

  2. 1.1 Preface

    This is version 2.0 of this document. We faced a lot of problems while installing Bluetooth on Linux. We thought this information might be useful to the Linux community.

    This information is intended for Linux on the Intel platform. Much of this information may be applicable to Linux on other processors, but we have no first-hand experience or information about this. The description is based on OpenBT version 0.0.8 which was installed on a SuSE Linux 7.2 Professional with kernel version 2.4.10. It should run on most other systems and with any 2.x kernel although we haven't tested it. For the Casira-Box we used the firmware hci bc01_hci-branch-12.3_casira and the PS-Tool 1.5.

    1.2 Copyright

    Copyright © 2001 Lukas Valle and Dejan Miletic. Permission to distribute and modify this document is granted under the GNU Free Documentation License

    1.3 The authors

    Valle Lukas: Student from Univerity of Applied Sciences for Architecture, Technology, Business and Language in Winterthur (Switzerland). Finishing study computer science in November 2001. Looks for a job.

    Miletic Dejan: Student from Univerity of Applied Sciences for Architecture, Technology, Business and Language in Winterthur (Switzerland). Finishing study computer science in November 2001. I will work as SW-Engineer.

    1.4 Feedback

    We welcome any feedback, good or bad, on the content of this document. We have done our best to ensure that the instructions and information herein are accurate and reliable. Please let us know if you find any errors or omissions.

    Send comments, corrections and questions to the author at lukivalle@xxxxxxx.ch, miletic.dejan@xxxxxxx.ch

    1.5 Acknowledgements

    We would like to thank:

    Peter Kjellerstedt, Anders Torbjörn Johansson and the other developers of OpenBT

    Frank Kargl from Uni Ulm

    Carl Orsborn and the staff at CSR

    and the mailinglist http://mhonarc.axis.se/bluetooth-dev/maillist.html


  3. CSR and OpenBT

  4. Get the newest OpenBT Project from http://sourceforge.net/projects/openbt.

    Unpack it in a directory using:
    $ tar xvf openbt-20011021.tar.gz
    Change into the directory and source the init_env file:
    $ cd openbt
    $ . init_env

    Edit openbt/Makefile and add the line

    make -C apps/bluetooth/sdp_server sdp_server

    after line 13. The Makefile should look like this:

        make -C linux/drivers/char/bluetooth
        make -C libs install
        make -C apps/bluetooth/userstack links
        make -C apps/bluetooth
        make -C apps/bluetooth/sdp_server sdp_user
        make -C apps/bluetooth/sdp_server sdp_server
    In linux/drivers/char/bluetooth/Makefile you may need to comment out the modversions.h include, depending on wether your kernel was build with modversions or not.
    #MODFLAGS  = -DMODVERSIONS -include $(INCLUDEDIR)/linux/modversions.h
    Supply the path to your kernel include files on line 55:
    # The INCLUDEDIR variable allows LSB compliant distros to be able to compile
    # the module correctly. Use 'make INCLUDEDIR=/usr/src/linux/include' where
    # /usr/src/linux/include is the directory that was used to build the kernel.
    INCLUDEDIR = /usr/src/linux/include
    Next you have to change the default configuration from ERICSSON to CSR. Therefore edit openbt/linux/include/linux/bluetooth/btconfig.h, undefine CONFIG_BLUETOOTH_ERICSSON and define CONFIG_BLUETOOTH_CSR on line 62 & 64:
     /* This sets current HW */
     #undef CONFIG_BLUETOOTH_USBMODULE  /* Not implemented */

    Now go to the chapter H4 or BCSP, depend what you want to use. We recommend to start with H4.


  5. Compilation with H4 Support

  6. Now you are ready for make in the openbt directory:
    $ . init_env
    $ make clean
    $ make
    $ su
    $ make install
    $ make devs
    $ exit
    Important is that you change the settings on the Casira-Board. You can work with the PS-Tool 1.5.

    Set the Host Interface to UART link running H4.

    Set the value Uart Configuration Bitfields to 168.


  7. Compilation with BCSP Support

  8. Now you are ready for make in the openbt directory:
    $ . init_env
    $ make clean
    $ su
    $ make install
    $ make devs
    $ exit
    Change the directory to openbt/apps/bluetooth/experimental/
    $ make clean
    Important is that you change the settings on the Casira-Board. You can work with the PS-Tool 1.5.

    Set the Host Interface to UART link running BCSP.

    Set the value Uart Configuration Bitfields to 6.


  9. Use OpenBT

  10. There are some command-line tools in the directory apps/bluetooth/experimental which can be used as a replacement of the btd. As these tools are more up-to-date and some errors have been fixed there, we strongly advise to use these.

    You should copy openbt/linux/drivers/char/bluetooth/bt.o to your modules directory (usually /lib/modules/<kernelversion>/pcmcia/). Next you may want to insert

    alias char-major-124    bt
    in /etc/modules.conf and do a depmod -a to get the module loaded automatically. Otherwise you have to do an insmod bt.o manually.

    Next you need to know on what serial device your card is bound. In case of an serial device, this is easy. Just look what port you connected that device to. In case of an pcmcia card, cardinfo should give you more information. When using USB, perhaps usbview may help you. Due to a lack of USB Bluetooth devices, we haven't tested that yet.


  11. Transmit bitstream over ACL

  12. If you want to transmit a bitstream over an RFCOMM/ACL-Link, you have to implement Bytestuffing of PPP. Bytes under 20hex have to be filtered.

    On senderside: When you find a byte under 20 hex: Send a 7dhex first, and XOR the founded Byte with 20h and send it too. The same with 7dhex

    On the receiver side, search for 7dhex and read the next byte. XOR this byte with 20hex.


  13. Test for Sender and Receiver

  14. Load the Modul on both sides:

    insmod openbt/linux/driver/char/bluetooth/bt.o

    Change to Directory:

    cd openbt/apps/bluetooth/experimental

    Start the Stack on both sides:


    If you don't get any errormessages during the next seconds, the stack should work. For more Information look into /var/log/messages

    Sender starts the Inquiry and return the address from the receiver device. For example 00:02:5b:ff:06:ae


    Now you can set up an RFCOMM-Connection to the receiver:

    ./btcon -d /dev/ttyBT0 -p disable -a 00:02:5b:ff:06:ae -S 2

    You will see the Message Connect, if the connection has been established.

    Now you can try to send a few data over the link.


    cat /dev/ttyBT0


    echo hallo > /dev/ttyBT0

    Now you should see the hallo on the receiver side. Everything seems to work fine and you can disconnect the link.

    ./btdisc -d /dev/ttyBT0 -D 2

    Shut down the stack with



  15. Errors

  16. Here a little table about errors we got during installation an what we have done to resolve them. A lot of that errors are fixed in the Version 0.0.8.

    /usr/src/linux/include/linux/modversions.h no such file or directory openbt/Makefile include directory on line 55 is probobly wrong. Try

    $ locate modversions.h

    and change to this directory.

    /usr/i486-suse-linux/bin/ld: cannot find -lreadline You don't have readline. Download and install it.

    Source Code: ftp://ftp.cwru.edu/pub/bash/readline-4.2.tar.gz

    User Manual: http://cnswww.cns.cwru.edu/php/chet/readline/readline.html

    Web Page: http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html


    $ tar -xvzf readline-4.2.tar.gz

    Change directory:

    $ cd readline-4.2
    $ ./configure
    $ make
    $ su
    $ make install
    $ make clean
    $ exit
    /usr/i486-suse-linux/bin/ld: cannot find -ltermcap Copy Files to the correct location:
    $ cp /usr/lib/termcap/* /usr/lib/
    $ exit
    undefined reference to bt_dfu_mode Edit File


    Comment line 1902 & 1903

    // if (bt_dfu_mode(-1))
    //     return 0;
    init_phys() not implemented Change Directory

    $ cd openbt/apps/bluetooth/userstack/

    Edit File btd.c on line 3296:

    else if (!strncmp(vendor, "CSR", 3));

    sdp_server: no such file or directory Change Directory
    $ cd /openbt/apps/bluetooth/sdp_server
    $ make
    $ su
    $ cp sdp_server /usr/sbin/
    $ exit
    $ make install
    After make devs you see an error message

    mknod -m 0666 /dev/ttyBT0 c 124 0

    mknod: `/dev/ttyBT0': File exist already

    make: *** [devs] Error 1

    $ su
    $ rm /dev/ttyBT* 
    $ make devs
    $ exit
    Could not open proc file: No such file or directory

    Could not open /dev/ttyBTC

    You forgot to load the bt.o modul

    $ insmod openbt/linux/drivers/char/bluetooth/bt.o

    Stack failed to initalize in BCSP-Mode We are not sure, what exactly the problem is, but we have made good experience with the following procedure:
    Open Casira-Box
    Disconnect the Powercable
    Insert the Powercable
    Press Reset-Button on the board
    Start bti again
    /openbt/apps/bluetooth/userstack/hci_vendor.c:1029: undefined reference to `bt_use_bcsp' Update to Version 0.0.8

  17. Links

  18. Help http://developer.axis.com/doc/software/index.shtml#SW_DEVBOARD

    Mailinglist: http://mhonarc.axis.se/bluetooth-dev/maillist.html.