This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Wilink8 backporting bluetooth module for 2.6.37

Hi,

Can any one please point me to backport the bluetooth module on 2.6.37.

Thanks And Regards,

Mike

  • Hi Mike,

    We don't have any official version...

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    Can you point me to unofficaial version please ? I have got the wifi working.

    Thanks And Regards,
    Mike
  • Hi Mike,

    I'm sorry if I have confused you... There is no such version. I think the best way would be to use the shared transport driver that is part of the 2.6.37 kernel.

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    Can you please point me on how to use the shared transport driver for interacting with bluetooth ?

    Thanks And Regards,
    Mike

  • Hi Mike,

    Sure...

    1. In your defconfig, enable CONFIG_TI_ST & CONFIG_BT_WILINK* (ensure also that CONFIG_BT is set).
    2. Get "uim" source from: https://gitorious.org/uim and cross compile for your platform
    3. Get the BT firmware from: git://git.ti.com/wilink8-bt/ti-bt-firmware.git and copy: TIInit_X.X.XX.bts to "/lib/firmware/"
    4. Start the uim during boot
    5. Issue standard BlueZ commands (hciconfig hci0 up/down, hcitool inq, etc).

    (*) AFAIK, CONFIG_BT_WILINK is available only from 2.6.39. So that driver needs to be ported (/drivers/bluetooth/btwilink.c)

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    Sorry for the delay I was on a holiday for a month!

    1: What BT firmware needs to be used for 8148
    2: Correct me if I am wrong the wilink8 wifi driver (backporting) is independent and has nothing to do with bluetooth ?
    3: Can you point me to 2.6.39. So that driver needs to be ported (/drivers/bluetooth/btwilink.c)
    4: Should I use bluez or bluetopia ? any links on to cross compiling this stack ? (I see that both stack support all the profiles that I need)

    Thanks And Regards,
    Mike
  • Hi,

    1. BT Firmware depends on the WL18xx device you are using,you can get the latest SP from here git.ti.com/.../master
    2. yes it has nothing to do with Bluetooth.
    3. You can search it online, the one I could find is lxr.oss.org.cn/.../btwilink.c
    4. BlueZ, if you are using btwilink
  • Hi Sundeep,

    Thanks that helped me.

    I can see the driver is being called following is the boot log:

    [ 2.000000] Bluetooth: Bluetooth Driver for TI WiLink - Version 1.0
    [ 2.010000] hdev d6782800
    [ 2.010000] HCI device registered (hdev d6782800)

    But I am still not sure who loads the firmware & which firmware do I need to
    use for wl18xx device ?

    I have also bluez in my filesystem how do I need to proceed further ?

    Thanks And Regards,
    Mike
  • Hi,

    Some update, I did the following:

    $ uim &
    [1] 183
    uim:@ main
    uim:install = /sys/devices/platform/kim/install
    uim:dev_name = /sys/devices/platform/kim/dev_name
    uim:baud_rate = /sys/devices/platform/kim/baud_rate
    uim:flow_cntrl = /sys/devices/platform/kim/flow_cntrl
    uim:begin polling...
    $ hciconfig up
    hci0: Type: BR/EDR Bus: UART
    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

    $ hciconfig hci0 up
    Can't init device hci0: Operation not possible due to RF-kill (132)

    But I am still not sure which firmware needs to be used by the wl18xx device & how to load.

    Thanks And Regards,
    Mike
  • Hi,

    Further update this is what I did after bootup:

    $ uim &
    [1] 183
    uim:@ main
    uim:install = /sys/devices/platform/kim/install
    uim:dev_name = /sys/devices/platform/kim/dev_name
    uim:baud_rate = /sys/devices/platform/kim/baud_rate
    uim:flow_cntrl = /sys/devices/platform/kim/flow_cntrl
    uim:begin polling...
    $ hciconfig hci0 up
    Can't init device hci0: Operation not possible due to RF-kill (132)
    $ rfkill list
    0: hci0: Bluetooth
    Soft blocked: yes
    Hard blocked: no

    $ rfkill unblock bluetooth
    $ hciconfig hci0 reset
    uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 1 from install

    uim:@ st_uart_config
    uim: signal received, opening /dev/ttyO1
    uim:@ set_baud_rate
    uim:set_baud_rate() done
    uim:Setting speed to 3000000
    uim:@ read_command_complete
    uim: Command complete started
    uim:@ read_hci_event
    uim: read_hci_event
    uim:Invalid response
    [ 421.670000] (stk) :line disc installation timed out
    [ 422.780000] (stk) :line disc installation timed out
    [ 423.890000] (stk) :line disc installation timed out
    [ 425.000000] (stk) :line disc installation timed out
    [ 426.110000] (stk) :line disc installation timed out
    [ 427.220000] (stk) :line disc installation timed out
    [ 427.220000] ti_st_open: st_register failed -22
    Can't init device hci0: Input/output error (5)
    uim:begin polling...
    uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 0 from install

    uim:@ st_uart_config
    uim:Un-Installed N_TI_WL Line displine
    uim:begin polling...
    $

    But still no luck!

    Thanks And Regards,
    Mike
  • Hi,

    Looks like GPIO is not toggled properly.

    This should be high before there is any communication with the chip.

    Could you please check if the connection with the chip is fine when you face this issue. Also if possible please check if the voltage on GPIO is driven high.

    Also probe the UART lines to make sure that the UART configuration is correct.

    also make sure that you are using the correct from location git.ti.com/.../master
  • Hi Sundeep,

    But I thought nshutdown_gpio in pdata did that, do we need to explicitly do that ?

    And also I am using TIInit_12.8.32.bts firmware how does this firmware get loaded ?

    Thanks And Regards,
    Mike
  • Hi Sudeep,

    The GPIO pin is correct I have verified, I have moved a further ahead but still not there, following is the issue I am facing now:

    # hciconfig hci0 up
    uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 1 from install

    uim:@ st_uart_config
    uim: signal received, opening /dev/ttyO4
    uim:@ set_baud_rate
    uim:set_baud_rate() done
    uim:Setting speed to 3000000
    uim:@ read_command_complete
    uim: Command complete started
    uim:@ read_hci_event
    uim: read_hci_event
    uim:Command complete done
    uim:Speed changing to 3000000, 1
    uim:@ set_custom_baud_rate
    uim:Installed N_TI_WL Line displine
    uim:begin polling...
    #
    #
    # hciconfig hci0 reset
    uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 0 from install

    uim:@ st_uart_config
    uim:Un-Installed N_TI_WL Line displine
    uim:begin polling...
    uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 1 from install

    uim:@ st_uart_config
    uim: signal received, opening /dev/ttyO4
    uim:@ set_baud_rate
    uim:set_baud_rate() done
    uim:Setting speed to 3000000
    uim:@ read_command_complete
    uim: Command complete started
    uim:@ read_hci_event
    uim: read_hci_event
    uim:Command complete done
    uim:Speed changing to 3000000, 1
    uim:@ set_custom_baud_rate
    uim:Installed N_TI_WL Line displine
    uim:begin polling...
    #

    Thanks And Regards,
    Mike
  • Hi Sudeep,

    Following is the dmesg output:

    [ 41.820000] hci0 d6782800
    [ 41.820000] (stc): st_register(2)
    [ 41.820000] (stc): chnl_id list empty :2
    [ 41.820000] (stk) : st_kim_start
    [ 41.930000] (stk) :ldisc_install = 1
    [ 41.980000] (stc): st_tty_open
    [ 41.980000] (stk) : line discipline installed
    [ 41.990000] (stk) :TIInit_11.8.32.bts
    [ 41.990000] PM: Adding info for No Bus:kim
    [ 41.990000] PM: Removing info for No Bus:kim
    [ 41.990000] (stk) :change remote baud rate command in firmware
    [ 41.990000] (stk) :skipping the wait event of change remote baud
    [ 41.990000] (stc): add_channel_to_table: id 2
    [ 41.990000] (stc): st_register(3)
    [ 41.990000] (stc): add_channel_to_table: id 3
    [ 41.990000] (stc): st_register(4)
    [ 41.990000] (stc): add_channel_to_table: id 4
    [ 41.990000] hci0: type 1 len 4hci0: type 1 len 4hci0: type 1 len 4hci0: type 1 len 4hci0: type 1 len 4hci0: type 1 len 4hci0: type 1 len 4hci0: type 6
    #

    Thanks And Regards,
    Mike
  • Hi,

    From the logs you have posted it looks like BT is UP and running.
  • Hi Sundeep,

    But when I do scan I dont get any device listed:

    # hcitool scan
    Scanning ...
    #

    And also when I scan through my mobile device I nor do see my device.

    Thanks And Regards,
    Mike
  • Hi,

    By default the antenna configuration is mapped to U.FL (external) connector (C7 and C8 are connected) in COM8. Which has to be changed to C5 and C6 capacitors, for routing it to internal antenna. So the range will be very less. Could you keep it side by side and try.

    also make sure that the page and inquiry scans are running (enabled)

    Please make sure you are using the right service pack from here git.ti.com/.../master.
  • Hi Sundeep,

    I did try with the antenna connected keepeing the devices very close enough, but still it doesnt list out my mobile device.
    Is it that it only works when wifif driver is enabled ? (because I have turned of the wifi module). Seems its getting the
    mac address but I am not able to discover it on my mobile device.

    I am using the bt_wilink driver from 2.6.39 kernel ? were there any bug fixes or something for this and I need to upgrade or something ?

    Thanks And Regards,
    Mike
  • Hi,

    I don't think it is related to the WiFi driver, Could you please let me know the size of the SP you are using? it should be around 69Kb.
  • Hi Sundeep,

    Its around 72K.

    # du -ha TIInit_11.8.32.bts
    72K TIInit_11.8.32.bts
    # uim &
    [1] 188
    uim:@ main
    uim:install = /sys/devices/platform/kim/install
    uim:dev_name = /sys/devices/platform/kim/dev_name
    uim:baud_rate = /sys/devices/platform/kim/baud_rate
    uim:flow_cntrl = /sys/devices/platform/kim/flow_cntrl
    uim:begin polling...
    # rfkill unblock bluetooth
    # hciconfig hci0 up
    uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 1 from install

    uim:@ st_uart_config
    uim: signal received, opening /dev/ttyO4
    uim:@ set_baud_rate
    uim:set_baud_rate() done
    uim:Setting speed to 3000000
    uim:@ read_command_complete
    uim: Command complete started
    uim:@ read_hci_event
    uim: read_hci_event
    uim:Command complete done
    uim:Speed changing to 3000000, 1
    uim:@ set_custom_baud_rate
    uim:Installed N_TI_WL Line displine
    uim:begin polling...
    # hciconfig -a
    hci0: Type: BR/EDR Bus: UART
    BD Address: 34:B1:F7:E2:DE:CB ACL MTU: 1021:6 SCO MTU: 180:4
    UP RUNNING
    RX bytes:348 acl:0 sco:0 events:11 errors:0
    TX bytes:49 acl:0 sco:0 commands:11 errors:0
    Features: 0xff 0xfe 0x2d 0xfe 0xdb 0xff 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy:
    Link mode: SLAVE ACCEPT
    Name: ''
    Class: 0x001f00
    Service Classes: Unspecified
    Device Class: Invalid Device Class!
    HCI Version: 4.0 (0x6) Revision: 0x0
    LMP Version: 4.0 (0x6) Subversion: 0xac20
    Manufacturer: Texas Instruments Inc. (13)

    #

    Thanks And Regards,
    Mike
  • Hi Sundeep,

    Can you point me to the driver bt_wilink & uim + headers + firmware which works on your side so that I'll back port appropriately.

    Thanks for you support!

    Thanks And Regards,
    Mike

  • Hi,

    To bring up BT using BlueZ you can refer to the link processors.wiki.ti.com/.../WL18xx_BlueZ_Bringing_Up_on_AM335x
    I think you already have the correct firmware, I think you already have this link git.ti.com/.../master
    You can get the UIM from git.ti.com/.../master

    and the btwilink.c is part of the kernel, if you define CONFIG_BT_WILINK=y in your defconfig it should do the job. You can just search for "btwilink.c linux cross reference"
  • Hi Sunddep,

    I got it working thanks! but i am not able pair for which I'll open a separate thread.

    Thanks And Regards,
    --Mike