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.

firmware download failed for wilink8 module

Hi,

 I'm able to get some response from Wilink Module. I'm getting the firmware version from wilink module... although there is error while requesting firmware download. The error log is as follows :

------------------------------------------------------------------------------
root@DM365_IPNC:~# insmod /opt/ipnc/modules/st_drv.ko 
[ 84.890072] (stk) :st_kim_init
[ 84.893210] bf098638

[ 84.904503] platform_drv_probe
[ 84.907609] (stk) :kim_probe
[ 84.914357] (stc): st_core_init
[ 84.917557] (stk) :Requesting gpio_no 45 
[ 84.932073] (stk) : Configuring gpio_no 45 as Output
[ 84.940914] (stk) : Value of GPIO45 : 0
[ 84.952057] (stk) : Value of GPIO45 : 8192
[ 84.964397] (stk) : Value of GPIO45 : 0
[ 84.974295] (stk) : Value of GPIO45 : 0
[ 84.978351] (stk) :sysfs entries created
[ 84.989212] (stk) : debugfs entries created 
[ 85.003969] __driver_attach_exit
root@DM365_IPNC:~# 
root@DM365_IPNC:~# insmod /opt/ipnc/modules/btwilink.ko 
[ 92.498679] bf0a0454
[ 92.501107] platform_drv_probe
[ 92.513040] bt_ti_probe
[ 92.518587] Bluetooth Driver Version 1.0 DEBUG: Inside ti_st_register_dev
[ 92.544634] bt_ti_probe: Successfull
[ 92.549080] __driver_attach_exit
[ 92.553596] btwilink platform drv registered ret = 0
root@DM365_IPNC:~# 
root@DM365_IPNC:~# uim &
root@DM365_IPNC:~# uim:@ main
uim:begin polling...

root@DM365_IPNC:~# hciconfig hci0 up
[ 99.490104] Calling st_register
[ 99.505021] (stc): st_register(0) 
[ 99.508301] (stc): chnl_id list empty :0 Calling st_kim_start
[ 99.526569] (stk) : st_kim_start
[ 99.529681] (stk) : Value of GPIO45 : 0
[ 99.533803] (stk) : Configuring gpio_no 45 to HIGH STATE Configuring gpio_no 45 to HIGH STATE
[ 99.557742] (stk) : Value of GPIO45 : 0
[ 104.361751] (stk) : Value of GPIO45 : 8192
[ 106.773309] (stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

u
[ 106.794079] (stc): st_tty_open im:read 1 from install 

uim:@ st_uart_config
uim: signal received, opening /
[ 106.804389] (stk) : line discipline installed dev/ttyS1
uim:@ set_baud_rate
uim:set_baud_rate() done
uim:Installed N_TI_WL Line displine
uim:begin polling...

[ 116.454450] (stk) :TIInit_11.8.32.bts
[ 177.129084] (stk) : request_firmware failed(errno -2) for TIInit_11.8.32.bts
[ 177.146200] (stk) :download firmware failed
[ 177.161383] (stk) :ldisc_install = 0uim:poll broke d
[ 177.166804] (stk) : Value of GPIO45 : 8192
ue 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:beg[ 177.181402] (stk) : Configuring gpio_no 45 to HIGH STATEin polling...
Configuring gpio_no 45 to HIGH STATE
[ 177.198557] (stk) : Value of GPIO45 : 0
[ 4.879536] (stk) : Value of GPIO45 : 8192
[ 7.305678] (stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

uim:read 1 from install 

uim:@ st_uart_config
uim: signal received, opening /dev/ttyS1
uim:@ set_baud_rate
uim: Can't get port settings
uim:set_baudrate() failed
uim:begin polling...

[ 8.307363] (stk) :line disc installation timed out 
[ 8.312387] (stk) :ldisc_install = 0uim:poll broke due to event 10(PRI:2/ERR:8)

u
[ 8.340509] (stk) : Value of GPIO45 : 8192
im:read 0 from i[ 8.345380] (stk) : Configuring gpio_no 45 to HIGH STATEnstall 

uim:@ st_uart_config
uim:Un-Installed N_TI_WL Line displine
uim:begin polling...
Configuring gpio_no 45 to HIGH STATE
[ 8.384768] (stk) : Value of GPIO45 : 0
[ 13.162464] (stk) : Value of GPIO45 : 8192
[ 15.561581] (stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

uim:read 1 from install 

uim:@ st_uart_config
uim: signal received, opening /dev/ttyS1
uim:@ set_baud_rate
uim: Can't get port settings
uim:set_baudrate() failed
uim:begin polling...

[ 16.567395] (stk) :line disc installation timed out 
[ 16.572420] (stk) :ldisc_install = 0uim:poll broke d
[ 16.586556] (stk) : Value of GPIO45 : 8192
ue to event 10(PRI:2/ERR:8)

uim:read 0 from install 

[ 16.597375] (stk) : Configuring gpio_no 45 to HIGH STATE
uim:Un-Installed N_TI_WL Line displine
uim:beg Configuring gpio_no 45 to HIGH STATE
in polling...
[ 16.611032] (stk) : Value of GPIO45 : 0
[ 21.467748] (stk) : Value of GPIO45 : 8192
[ 23.878550] (stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

uim:read 1 from install 

uim:@ st_uart_config
uim: signal received, opening /dev/ttyS1
uim:@ set_baud_rate
uim: Can't get port settings
uim:set_baudrate() failed
uim:begin polling...

[ 24.887348] (stk) :line disc installation timed out 
[ 24.897339] (stk) :ldisc_install = 0uim:poll broke due to event 10(PRI:2/ERR:8)

uim:read 0 from install 

[ 41.809079] Function entered at [<bf0975b0>] from [<bf0a03e4>]
[ 41.814934] r7:c7b87400 r6:c7b8c5c0 r5:00000000 r4:ffffffea
[ 41.820664] Function entered at [<bf0a02e0>] from [<c0379e3c>]
[ 41.826521] r7:c6c62d00 r6:c7b87624 r5:400448c9 r4:c7b87400
[ 41.832249] Function entered at [<c0379d88>] from [<c037f488>]
[ 41.838101] r6:00000000 r5:400448c9 r4:400448c9
[ 41.842773] Function entered at [<c037f3b0>] from [<c02cc9c8>]
[ 41.848624] r8:00000000 r7:c6c62d00 r6:00000000 r5:400448c9 r4:00000003
[ 41.855407] Function entered at [<c02cc7b8>] from [<c00b1a74>]
[ 41.861260] r6:400448c9 r5:c6c62d00 r4:00000003
[ 41.865928] Function entered at [<c00b1504>] from [<c00b1b24>]
[ 41.871784] Function entered at [<c00b1ae4>] from [<c002e020>]
[ 41.877637] r7:00000036 r6:4003efb4 r5:beff6f34 r4:4005d83c
[ 41.883387] Code: eb00036d e51b3020 e3530000 0a000002 (e5d53018) 
[ 42.257502] ---[ end trace 1fe50670edd39529 ]---
Segmentation fault
-----------------------------------------------------------------------------------------------------

On community i checked this problem can be wrong firmware path. I have two following bts path on filesystem.

root@DM365_IPNC:~# ls /etc/lib/firmware/TIInit_11.8.32.bts -l
-rw-r--r-- 1 root root 70313 Apr 17 2015 /etc/lib/firmware/TIInit_11.8.32.bts

root@DM365_IPNC:~# ls /lib/firmware/TIInit_11.8.32.bts -l
-rw-r--r-- 1 root root 70313 Apr 11 2015 /lib/firmware/TIInit_11.8.32.bts
root@DM365_IPNC:~#

-------------------------------------------------------------------------------------------------------------------
I'm expecting some comments from your side on this, please suggest .

Thanks
Brajesh

  • Hi Brajesh,

    [ 116.454450] (stk) :TIInit_11.8.32.bts
    [ 177.129084] (stk) : request_firmware failed(errno -2) for TIInit_11.8.32.bts

    Error: -2 = "No such file or directory". So the problem is that the file "TIInit_11.8.32.bts" is not found in the FIRMWARE_DIR location.
    Usually, the FIRMWARE_DIR is "/system/etc/firmware/" (on Android) and "/lib/firmware/" (on Linux). But in your case, it seems to be different.

    You need to check if there is a "firmware" rule in udev (/lib/udev/rules.d/). If it is not there, you need to add it.
    Typically, request_firmware would end up executing a script (firmware.sh) which will look for a specific folder.

    Example udev rule (this is only an EXAMPLE!).

    # firmware-class requests, copies files into the kernel
    SUBSYSTEM=="firmware", ACTION=="add",ENV{FIRMWARE}=="TIInit_11.8.32.bts", RUN+="/etc/udev/scripts/firmware.sh"

    Regards,
    Gigi Joseph.
  • Hi Gigi,

    Thanks for the info. So now i need to add firmware rule to that directory but i have not idea how do we add that . I goggled it and found following link related to udev rule for wilink device.
    processors.wiki.ti.com/.../WL1835_Cape_on_BeagleBone_with_Debian

    Can you please guide me through how can i add this rule ?

    btw my fs doesn't have any "firmware" rule in /lib/udev/rules.d/.

    Is there some macro in driver by which we can check for Firmware location that has been searched .

    Thanks
    Brajesh
  • Hi Brajesh,

    The kernel driver does not have any macro. As I said before, it uses udev. You can google a bit and find out how to add a new udev rule for firmware download.

    Sample pages: www.crashcourse.ca/.../Loading_external_firmware, doc.opensuse.org/.../cha.udev.html, etc.

    Regards,
    Gigi Joseph.
  • Hi Gigi,

    thanks, I have added one 50-firmware.rules in udev/rules.d.
    But the firmware.sh script, it points to is not existing in /udev/scripts?
    From where can we get this firmware.sh script ?
    following is content of this rule file
    ------------------------
    # do not edit this file, it will be overwritten on update

    # firmware-class requests, copies files into the kernel
    SUBSYSTEM=="firmware", ACTION=="add", ENV{FIRMWARE}=="TIInit_11.8.32.bts", RUN+="/etc/udev/scripts/firmware.sh"
    ----------------------------------------------------

    Thanks
    Brajesh
  • Hi Gigi,

    I have done what is required for udev rules. I have added an 50-firmware.rules file in /lib/udev/rules.d/ directory and also added firmware.sh script to /lib/udev/ directory. The content of /lib/udev/rules.d/50-firmware.rules is :
    -------------------------------------------------------------------------
    # do not edit this file, it will be overwritten on update

    # firmware-class requests, copies files into the kernel
    SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh"
    -------------------------------------------------------------------------
    and /lib/udev/firmware.sh :
    -------------------------------------------------------------------------

    echo "firmware.sh is running"
    FIRMWARE_DIRS="/lib/firmware/$(uname -r) /lib/firmware"

    err() {
    echo "$@" >&2
    logger -t "${0##*/}[$$]" "$@" 2>/dev/null || true
    }

    if [ ! -e /sys$DEVPATH/loading ]; then
    err "udev firmware loader misses sysfs directory"
    exit 1
    fi

    for DIR in $FIRMWARE_DIRS; do
    [ -e "$DIR/$FIRMWARE" ] || continue
    echo 1 > /sys$DEVPATH/loading
    cat "$DIR/$FIRMWARE" > /sys$DEVPATH/data
    echo 0 > /sys$DEVPATH/loading
    exit 0
    done

    echo -1 > /sys$DEVPATH/loading
    err "Cannot find firmware file '$FIRMWARE'"
    mkdir -p /dev/.udev/firmware-missing
    file=$(echo "$FIRMWARE" | sed 's:/:\\x2f:g')
    ln -s -f "$DEVPATH" /dev/.udev/firmware-missing/$file
    exit 1
    -------------------------------------------------------------------------

    and as suggested by a site, i have run udevadm monitor to see the udev event generated when firmware request happen. But when i do "hciconfig hci0 up", I can't see any udev event generated so adding udev rule doesn't make any difference. Do i need to make any changed in this ? I'm kind of stuck. 

    In other setup where we have freescale host processor and new kernel , there is no issue in downloading firmware from /lib/firmware/ . The problem that I'm facing is might be cause of my older kernel verision (2.6.37). With your help, I'v been able to come up to this point, I'm expecting your further comments on this.

    Thanks
    Brajesh

  • Hi,

    have you tried building it with the kernel with firmware ?
    have a look at this config options in kernel ,

    CONFIG_FIRMWARE_IN_KERNEL
    CONFIG_EXTRA_FIRMWARE
    CONFIG_EXTRA_FIRMWARE_DIR

    Cheers,
    --Prabhakar Lad
  • Hi Prabhakar,

    Thanks for your reply. I just added firmware rules to file system and updated the filesystem with it. By "have you tried building it with the kernel with firmware " do you mean shall i update these flags in menuconfig ?
    If yes then I'll try to see the flags in defconfig and update you .

    Thanks :)
    Brajesh
  • Hi Prabhakar,

    You were spot on, i didn't have these flags set in my config. I have updated config file as follows. But while compiling the kernl i get error as there Makefile inside firmware directory of kernel is not updated.

    -------------------------------------------------------------
    CONFIG_PREVENT_FIRMWARE_BUILD=y
    CONFIG_FW_LOADER=y
    CONFIG_FIRMWARE_IN_KERNEL=y
    CONFIG_EXTRA_FIRMWARE="TIInit_11.8.32.bts"
    CONFIG_EXTRA_FIRMWARE_DIR="/lib/firmware
    -------------------------------------------------------------

    Error is :
    -------------------------------------------------------------
    MK_FW firmware/TIInit_11.8.32.bts.gen.S
    make[3]: *** No rule to make target `/lib/firmware/TIInit_11.8.32.bts', needed by `firmware/TIInit_11.8.32.bts.gen.o'. Stop.
    -------------------------------------------------------------

    Expecting your further comments on this.

    Thanks
    Brajesh

  • Hi,

    Create a firmware directory in kernel source directory and place the firmware over there.

    Cheers,
    --Prabhakar Lad

  • Hi Prabhakar,

    Thanks for the help :) and it compiled and it has found the firmware i guess. So i have moved on two next error which is as follows.

    -------------------------------------------------------------
    [ 75.840086] (stk) :Firmware Version Commands Write
    [ 78.265352] (stk) :TIInit_11.8.32.bts�ЉG�@�ȃ�ǠU��<tF�TZF��ljG������LjG��;Ѕ�
    [ 78.281623] (stk) :change remote baud rate command in firmware
    [ 78.294354] (stk) :skipping the wait event of change remote baud
    [ 85.185399] (stc): add_channel_to_table: id 0
    [ 85.205270] (stc): chip/interface misbehavior dropping frame starting with 0x04
    [ 85.305260] (stll) :sleep indication recvd
    [ 85.309427] (stll) :send_ll_cmd: writing 31
    [ 95.185391] Unable to handle kernel NULL pointer dereference at virtual address 00000018
    [ 95.206015] pgd = c6d30000
    [ 95.208773] [00000018] *pgd=00000000
    [ 95.212392] Internal error: Oops: 5 [#1] PREEMPT
    [ 95.217029] last sysfs file: /sys/kernel/adc_value/adc_volt
    [ 95.222622] Modules linked in: btwilink st_drv version_ctrl ppp_deflate ppp_generic netconsole slhc tun loop usbmon iscsi_tcp libiscsi_tcp m
    [ 95.245567] CPU: 0 Not tainted (2.6.37_DM365_MCAM_TEST_5.1.0+ #120)
    [ 95.252225] pc : [<bf0975dc>] lr : [<bf0983b8>] psr: a0000013
    [ 95.252255] sp : c6d29e50 ip : c6d29e38 fp : c6d29e74
    [ 95.263753] r10: 00000000 r9 : c6d28000 r8 : c6d0fa00
    [ 95.269006] r7 : c7b92e80 r6 : c7b77224 r5 : 00000000 r4 : c7b77000
    [ 95.275564] r3 : c6cc30c0 r2 : 00000004 r1 : 00000000 r0 : c6cc3480
    [ 95.282123] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    [ 95.289292] Control: 0005317f Table: 86d30000 DAC: 00000015
    [ 95.295065] Process hciconfig (pid: 2982, stack limit = 0xc6d28270)
    [ 95.301360] Stack: (0xc6d29e50 to 0xc6d2a000)
    [ 95.305759] 9e40: ffffff92 c6cc30c0 c7b77000 c6c9d700
    [ 95.313999] 9e60: c7b77224 c7b92e80 c6d29e8c c6d29e78 bf0a0080 bf0975c0 c7b77000 ffffff92
    [ 95.322238] 9e80: c6d29eac c6d29e90 c037a004 bf0a0048 c004c8cc 400448c9 400448c9 00000000
    [ 95.330476] 9ea0: c6d29eec c6d29eb0 c037f4b4 c0379dc4 c0061d2c c0463e84 bedbdf34 c6d29fb0
    [ 95.338710] 9ec0: 80000005 400565b4 00000000 00000003 400448c9 00000000 c7b92e80 00000000
    [ 95.346947] 9ee0: c6d29f0c c6d29ef0 c02cc9f4 c037f3ec c6d29fac 00000003 c7b92e80 400448c9
    [ 95.355185] 9f00: c6d29f7c c6d29f10 c00b1a74 c02cc7f4 c6d29f38 c6d29f2c c6d29f64 c6d29f28
    [ 95.363422] 9f20: c02cdd64 c00a42a4 c74879a0 00000000 00000000 c043da80 c78063c0 c749ce00
    [ 95.371656] 9f40: 00000000 00000003 40054fb4 00000119 c002e1a4 00000003 00000000 400448c9
    [ 95.379892] 9f60: c7b92e80 c002e1a4 c6d28000 00000000 c6d29fa4 c6d29f80 c00b1b24 c00b1514
    [ 95.388128] 9f80: c02ce874 00000000 4007383c bedbdf34 40054fb4 00000036 00000000 c6d29fa8
    [ 95.396365] 9fa0: c002e020 c00b1af4 4007383c bedbdf34 00000003 400448c9 00000000 4008617c
    [ 95.404601] 9fc0: 4007383c bedbdf34 40054fb4 00000036 00000000 00000000 40141000 bedbdca4
    [ 95.412837] 9fe0: 00000000 bedbdc78 400565f4 4022ab0c 60000010 00000003 00000000 00000000
    [ 95.421036] Backtrace:
    [ 95.423512] Function entered at [<bf0975b0>] from [<bf0a0080>]
    [ 95.429368] r7:c7b92e80 r6:c7b77224 r5:c6c9d700 r4:c7b77000
    [ 95.435102] Function entered at [<bf0a0038>] from [<c037a004>]
    [ 95.440955] r5:ffffff92 r4:c7b77000
    [ 95.444568] Function entered at [<c0379db4>] from [<c037f4b4>]
    [ 95.450420] r6:00000000 r5:400448c9 r4:400448c9
    [ 95.455091] Function entered at [<c037f3dc>] from [<c02cc9f4>]
    [ 95.460942] r8:00000000 r7:c7b92e80 r6:00000000 r5:400448c9 r4:00000003
    [ 95.467725] Function entered at [<c02cc7e4>] from [<c00b1a74>]
    [ 95.473578] r6:400448c9 r5:c7b92e80 r4:00000003
    [ 95.478248] Function entered at [<c00b1504>] from [<c00b1b24>]
    [ 95.484103] Function entered at [<c00b1ae4>] from [<c002e020>]
    [ 95.489955] r7:00000036 r6:40054fb4 r5:bedbdf34 r4:4007383c
    [ 95.495703] Code: eb00036d e51b3020 e3530000 0a000002 (e5d53018)
    [ 95.903636] ---[ end trace 1590de2f6651310d ]---
    Segmentation fault
    -------------------------------------------------------------

    Expecting your further comments.

    Thanks
    Brajesh
  • Hi,

    what steps did you follow to load the bt modules ?

    Cheers,
    --Prabhakar Lad
  • Hi Prabhakar,

    I have followed following steps :

    ------------------------------------------------------------------
    root@DM365_IPNC:~# insmod /opt/ipnc/modules/st_drv.ko
    KERNEL[50.513499] add /module/st_drv (module)
    [ 50.525733] (stk) :st_kim_init
    [ 50.528933] bf098638
    [ 50.531326] platform_drv_probe
    [ 50.534414] (stk) :kim_probe

    [ 50.547901] (stc): st_core_init
    [ 50.551101] (stk) :Requesting gpio_no 45
    [ 50.565243] (stk) : Configuring gpio_no 45 as Output
    [ 50.575275] (stk) : Value of GPIO45 : 0
    [ 50.582183] (stk) : Value of GPIO45 : 8192
    [ 50.601291] (stk) : Value of GPIO45 : 0
    [ 50.605716] (stk) : Value of GPIO45 : 0
    [ 50.609770] (stk) :sysfs entries created
    [ 50.625337] (stk) : debugfs entries created
    [ 50.631944] __driver_attach_exit
    KERNEL[50.635669] add /bus/platform/drivers/kim (drivers)
    root@DM365_IPNC:~#
    root@DM365_IPNC:~# uim &
    root@DM365_IPNC:~# uim:@ main
    uim:begin polling...

    root@DM365_IPNC:~# insmod /opt/ipnc/modules/btwilink.ko

    KERNEL[57.031094] add /module/btwilink (mod[ 57.039540] bf0a0454
    ule)
    [ 57.042813] platform_drv_probe
    [ 57.065233] bt_ti_probe
    [ 57.067981] Bluetooth Driver Version 1.0 DEBUG: Inside ti_st_register_dev
    KERNEL[57.091288] add /devices/virtual/bluetooth/hci0 (bluetooth)
    KERNEL[5[ 57.102953] bt_ti_probe: Successfull
    7.095442] add /devices/virt[ 57.109290] __driver_attach_exit
    ual/bluetooth/hci0/rfkill0 (rfkill)
    KERNEL[57.097358] change /devices/virtual/bluetooth/hci0/[ 57.120123] btwilink platform drv registered ret = 0
    rfkill0 (rfkill)
    KERNEL[57.108660] add /bus/platform/drivers/btwilink (drivers)
    root@DM365_IPNC:~#


    root@DM365_IPNC:~# hciconfig hci0 up
    [ 61.292116] Calling st_register
    [ 61.305239] (stc): st_register(0)
    [ 61.308519] (stc): chnl_id list empty :0 Calling st_kim_start
    [ 61.322145] (stk) : st_kim_start
    [ 61.333800] (stk) : Value of GPIO45 : 0
    [ 61.345333] (stk) : Configuring gpio_no 45 to HIGH STATE Configuring gpio_no 45 to HIGH STATE
    [ 61.358803] (stk) : Value of GPIO45 : 0
    [ 66.174589] (stk) : Value of GPIO45 : 8192
    [ 68.597671] (stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

    u
    [ 68.616017] (stc): st_tty_open im:read 1 from install

    uim:@ st_uart_config
    uim: signal received, opening /dev/ttyS1
    uim:@ set_baud_rate
    uim:set_baud_rate() done

    [ 68.632668] (stk) : line discipline installed uim:Installed N_TI_WL Line displine
    uim:begin polling...

    [ 75.840086] (stk) :Firmware Version Commands Write
    [ 78.265352] (stk) :TIInit_11.8.32.bts�ЉG�@�ȃ�ǠU��<tF�TZF��ljG������LjG��;Ѕ�
    [ 78.281623] (stk) :change remote baud rate command in firmware
    [ 78.294354] (stk) :skipping the wait event of change remote baud
    [ 85.185399] (stc): add_channel_to_table: id 0
    [ 85.205270] (stc): chip/interface misbehavior dropping frame starting with 0x04
    [ 85.305260] (stll) :sleep indication recvd
    [ 85.309427] (stll) :send_ll_cmd: writing 31
    [ 95.185391] Unable to handle kernel NULL pointer dereference at virtual address 00000018
    [ 95.206015] pgd = c6d30000
    [ 95.208773] [00000018] *pgd=00000000
    [ 95.212392] Internal error: Oops: 5 [#1] PREEMPT
    [ 95.217029] last sysfs file: /sys/kernel/adc_value/adc_volt
    [ 95.222622] Modules linked in: btwilink st_drv version_ctrl ppp_deflate ppp_generic netconsole slhc tun loop usbmon iscsi_tcp libiscsi_tcp m
    [ 95.245567] CPU: 0 Not tainted (2.6.37_DM365_MCAM_TEST_5.1.0+ #120)
    [ 95.252225] pc : [<bf0975dc>] lr : [<bf0983b8>] psr: a0000013
    [ 95.252255] sp : c6d29e50 ip : c6d29e38 fp : c6d29e74
    [ 95.263753] r10: 00000000 r9 : c6d28000 r8 : c6d0fa00
    [ 95.269006] r7 : c7b92e80 r6 : c7b77224 r5 : 00000000 r4 : c7b77000
    [ 95.275564] r3 : c6cc30c0 r2 : 00000004 r1 : 00000000 r0 : c6cc3480
    [ 95.282123] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    [ 95.289292] Control: 0005317f Table: 86d30000 DAC: 00000015
    [ 95.295065] Process hciconfig (pid: 2982, stack limit = 0xc6d28270)
    [ 95.301360] Stack: (0xc6d29e50 to 0xc6d2a000)
    [ 95.305759] 9e40: ffffff92 c6cc30c0 c7b77000 c6c9d700
    [ 95.313999] 9e60: c7b77224 c7b92e80 c6d29e8c c6d29e78 bf0a0080 bf0975c0 c7b77000 ffffff92
    [ 95.322238] 9e80: c6d29eac c6d29e90 c037a004 bf0a0048 c004c8cc 400448c9 400448c9 00000000
    [ 95.330476] 9ea0: c6d29eec c6d29eb0 c037f4b4 c0379dc4 c0061d2c c0463e84 bedbdf34 c6d29fb0
    [ 95.338710] 9ec0: 80000005 400565b4 00000000 00000003 400448c9 00000000 c7b92e80 00000000
    [ 95.346947] 9ee0: c6d29f0c c6d29ef0 c02cc9f4 c037f3ec c6d29fac 00000003 c7b92e80 400448c9
    [ 95.355185] 9f00: c6d29f7c c6d29f10 c00b1a74 c02cc7f4 c6d29f38 c6d29f2c c6d29f64 c6d29f28
    [ 95.363422] 9f20: c02cdd64 c00a42a4 c74879a0 00000000 00000000 c043da80 c78063c0 c749ce00
    [ 95.371656] 9f40: 00000000 00000003 40054fb4 00000119 c002e1a4 00000003 00000000 400448c9
    [ 95.379892] 9f60: c7b92e80 c002e1a4 c6d28000 00000000 c6d29fa4 c6d29f80 c00b1b24 c00b1514
    [ 95.388128] 9f80: c02ce874 00000000 4007383c bedbdf34 40054fb4 00000036 00000000 c6d29fa8
    [ 95.396365] 9fa0: c002e020 c00b1af4 4007383c bedbdf34 00000003 400448c9 00000000 4008617c
    [ 95.404601] 9fc0: 4007383c bedbdf34 40054fb4 00000036 00000000 00000000 40141000 bedbdca4
    [ 95.412837] 9fe0: 00000000 bedbdc78 400565f4 4022ab0c 60000010 00000003 00000000 00000000
    [ 95.421036] Backtrace:
    [ 95.423512] Function entered at [<bf0975b0>] from [<bf0a0080>]
    [ 95.429368] r7:c7b92e80 r6:c7b77224 r5:c6c9d700 r4:c7b77000
    [ 95.435102] Function entered at [<bf0a0038>] from [<c037a004>]
    [ 95.440955] r5:ffffff92 r4:c7b77000
    [ 95.444568] Function entered at [<c0379db4>] from [<c037f4b4>]
    [ 95.450420] r6:00000000 r5:400448c9 r4:400448c9
    [ 95.455091] Function entered at [<c037f3dc>] from [<c02cc9f4>]
    [ 95.460942] r8:00000000 r7:c7b92e80 r6:00000000 r5:400448c9 r4:00000003
    [ 95.467725] Function entered at [<c02cc7e4>] from [<c00b1a74>]
    [ 95.473578] r6:400448c9 r5:c7b92e80 r4:00000003
    [ 95.478248] Function entered at [<c00b1504>] from [<c00b1b24>]
    [ 95.484103] Function entered at [<c00b1ae4>] from [<c002e020>]
    [ 95.489955] r7:00000036 r6:40054fb4 r5:bedbdf34 r4:4007383c
    [ 95.495703] Code: eb00036d e51b3020 e3530000 0a000002 (e5d53018)
    [ 95.903636] ---[ end trace 1590de2f6651310d ]---
    Segmentation fault

    -------------------------------------

    Can you please point out where am I missing ?

     

    Thanks
    Brajesh

  • Hi,

    Steps seems OK.
    what platform changes have you done ? also from what kernel version did you backport (I see too many printks in driver which you added maybe refresh those files may be you caused something it to crash there) ?

    Cheers,
    --Prabhakar Lad
  • Hi Prabhakar,

    I'm using kernel 2.6.37 which i know is pretty old. I have not back ported the driver. I got btwilink.c (which i guess could be a issue) from a community and just updated Kconfig to have it in menuconfig.
    I have modified some UART1 related pin muxing changes and also the baudrate of ttyS1 is set to 115200 by termios application as i couldn't find from where i shall update uart baudrate from board file. But setting it by application did the trick. Now my only doubt is whether shall i keep .baudrate = 3000000 for btwilink platform data cause i have kept .baudrate = 115200 in plateform data of btwilink as if i keep .baudrate = 3000000, wilink device doesn't respond with firmware version. Since the wilink device boot up with default 115200 baudrate, it can't communicate with ttyS1 (3000000). Can you please clarify about this baudrate issue ?

    And you might be correct about too many debug prints , i enabled them when i was facing driver related issues. Now i'll remove printk's and will update if there is any success.

    Thanks
    Brajesh
  • Hi,

    I think the nearest kernel version is 2.6.39 in which bt_wilink driver is present [1], take the files from there also probably take the ti_st from there only.
    pin muxing is definitely required for your uart,

    platform changes should look the following:

    +struct ti_st_plat_data wilink_pdata = {
    + .nshutdown_gpio = GPIO_TO_PIN(1, 21),
    + .dev_name = "/dev/ttyO4",
    + .flow_cntrl = 1,
    + .baud_rate = 3000000,
    +};
    +
    +static struct platform_device wl12xx_device = {
    + .name = "kim",
    + .id = -1,
    + .dev.platform_data = &wilink_pdata,
    +};
    +
    +static struct platform_device btwilink_device = {
    + .name = "btwilink",
    + .id = -1,
    +};
    +
    +static inline void __init init_st_platform_data(void)
    +{
    + platform_device_register(&wl12xx_device);
    + platform_device_register(&btwilink_device);
    +}
    +

    and finally call init_st_platform_data() from your machines init callback. not sure why you need termios
    the st driver should do it, cant help further until the board is scoped.

    [1] www.kernel.org/.../v2.6

    Cheers,
    --Prabhakar Lad
  • Hi Prabhakar & Gigi,

    Thanks both of you for your valuable inputs. :) . Finally BT is UP & RUNNING. Updating the driver did the trick.
    Although It's not scanning the devices yet, but I hope that should work soon.

    Thanks again :)
    Brajesh
  • Hi,

    Good to hear it works!
    Just set 'hciconfig hci0 piscan' and then later try scanning. btw if are you using bluez4 use hcitool to scan.

    Cheers,
    --Prabhakar Lad
  • Hi Prabhakar,

    Thanks for info. Following is the response of bluez commands that i have followed.

    ---------------------------------------------------------------------------------------------------------

    root@DM365_IPNC:~# hciconfig hci0 piscan

    root@DM365_IPNC:~# hcitool scan
    Scanning ...
    root@DM365_IPNC:~# hcitool scan
    Scanning ...
    root@DM365_IPNC:~# hcitool scan
    Scanning ...
    root@DM365_IPNC:~# hciconfig -a
    hci0: Type: BR/EDR Bus: UART
    BD Address: 84:DD:20:92:A5:E0 ACL MTU: 1021:6 SCO MTU: 180:4
    UP RUNNING PSCAN ISCAN
    RX bytes:1212 acl:0 sco:0 events:27 errors:0
    TX bytes:117 acl:0 sco:0 commands:24 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)

    root@DM365_IPNC:~# hciconfig hci0 name VELA_BT.0
    root@DM365_IPNC:~# hciconfig hci0 class 0x000100

    root@DM365_IPNC:~# hciconfig hci0 lp RSWITCH 

    root@DM365_IPNC:~# hciconfig hci0 -a
    hci0: Type: BR/EDR Bus: UART
    BD Address: 84:DD:20:92:A5:E0 ACL MTU: 1021:6 SCO MTU: 180:4
    UP RUNNING PSCAN ISCAN
    RX bytes:2350 acl:0 sco:0 events:44 errors:0
    TX bytes:442 acl:0 sco:0 commands:41 errors:0
    Features: 0xff 0xfe 0x2d 0xfe 0xdb 0xff 0x7b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy: RSWITCH
    Link mode: SLAVE ACCEPT
    Name: 'VELA_BT.0'
    Class: 0x000100
    Service Classes: Unspecified
    Device Class: Computer, Uncategorized
    HCI Version: 4.0 (0x6) Revision: 0x0
    LMP Version: 4.0 (0x6) Subversion: 0xac20
    Manufacturer: Texas Instruments Inc. (13)

    root@DM365_IPNC:~# hcitool scan
    Scanning ...

    ---------------------------------------------------------------------------------------------------------

    Thanks

    Brajesh

  • Hi Prabhakar,

    I got the solution of scanning probelm by this post "https://e2e.ti.com/support/wireless_connectivity/f/307/t/360495". 

    Now I'm getting my remote device is scanned list as follows :

    ----------------------------------

    root@DM365_IPNC:~# hcitool scan
    Scanning ...
    10:30:47:74:49:32 Galaxy Grand2
    root@DM365_IPNC:~# hcitool cc 10:30:47:74:49:32

    ----------------------------------

    Although it is not connecting to any device yet. When i pair it up from my Mobile, it ask for PIN. Can you give me some idea how to pair it up with remote device ?

    Thanks

    Brajesh