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.

WL1273 Bluetooth enable problem on omap4430


OS:Android4.4
Kernel: 3.4
CPU: OMAP4430
Wireless module: WL1273
problem: Bluetooth unable turn on. To trace code in kernel/drivers/misc/ti-st driver, seems can not get chip, maj_ver, min_ver information from module.



dmesg:
====================
...

[   11.161315] android_usb: already disabled
[   11.170074] adb_open
[   11.173126] mtp_bind_config
[   11.177825] adb_bind_config
[   11.198181] EXT4-fs (mmcblk0p13): re-mounted. Opts: (null)
shell@MC18:/ $ [   11.415679] PM_Batt: BATT_DET_START
[   11.627197] (stk) : waiting for ver info- timed out  
[   11.627227] (stk) :kim: failed to read local ver
[   11.627227] (stk) :download firmware failed

[   11.627227] (stk) :ldisc_install = 0
[   11.634552] (stc): st_tty_close
[   11.970520] sharp_LQ0_dpi_panel display0: failed to set lcd brightness
...
======================

 

From: kernel/drivers/misc/ti-st/st-kim.c

=================

static long read_local_version(struct kim_data_s *kim_gdata, char *bts_scr_name)
{
unsigned short version = 0, chip = 0, min_ver = 0, maj_ver = 0;
const char read_ver_cmd[] = { 0x01, 0x01, 0x10, 0x00 };
 

pr_debug("%s", __func__);


INIT_COMPLETION(kim_gdata->kim_rcvd);
if (4 != st_int_write(kim_gdata->core_data, read_ver_cmd, 4)) { 

    pr_err("kim: couldn't write 4 bytes");
    return -EIO;
}


if (!wait_for_completion_interruptible_timeout(
    &kim_gdata->kim_rcvd, msecs_to_jiffies(CMD_RESP_TIME))) {

    pr_err(" waiting for ver info- timed out ");
    return -ETIMEDOUT;

}
INIT_COMPLETION(kim_gdata->kim_rcvd);

version =
    MAKEWORD(kim_gdata->resp_buffer[13],
            kim_gdata->resp_buffer[14]);
chip = (version & 0x7C00) >> 10;
min_ver = (version & 0x007F);
maj_ver = (version & 0x0380) >> 7;

if (version & 0x8000)
    maj_ver |= 0x0008;

sprintf(bts_scr_name, "TIInit_%d.%d.%d.bts", chip, maj_ver, min_ver);

......

return 0;
}


Please help this, thanks

Johnny

  • Hi,

    Have you followed the steps mentioned in the below link to bring up Bluedroid on Android, 

    http://e2e.ti.com/support/low_power_rf/f/538/t/294284.aspx

  • Hi,

    Yes, I double check it again and results as below

    1. kernal default config CONFIG_TI_ST=y CONFIG_ST_HCI=y have set.
    2. ttyo0 permission is 660 in init_omap4430.rc
    3. uim_sys is running.
    4. /sys/devices/plftform/kim exist
    5. firmware are located in system/etc/firmware

    BRs,

    Johnny

  • Hi,

    I hope you forgot to mention HCI TTY driver, and you have already checked it.

    In that case it looks to me like either you UART is not configured correctly or the BT_EN is not toggled properly.

  • Hi,

    Agree, the CONFIG_ST_HCI=y had set in kernel config.

    I'm keep trace on why UART is open failed according to logcat message show you below. It seems something wrong on HAL layer.

    =============
    E/uim-sysfs(  113): uim: Command complete started
    E/uim-sysfs(  113): uim: Inside read_hci_event
    E/uim-sysfs(  113): uim: read_hci_event
    E/uim-sysfs(  113): uim: Invalid response
    E/uim-sysfs(  113): uim:cleanup
    E/uim-sysfs(  113): uim: Inside st_uart_config
    E/uim-sysfs(  113): uim: Un-Installed N_TI_WL Line displine
    E/libbt_ti( 1125):  Can't open hci_tty
    E/bt_userial( 1125): userial_open: wrong numbers of open fd in vendor lib [-1]!
    E/bt_userial( 1125): userial_open: HCI UART expects only one open fd
    I/bt-btu  ( 1125): btu_task received preload complete event
    I/bt_hci_bdroid( 1125): bt_hc_worker_thread exiting
    D/BTSNOOP-DISP( 1125): btsnoop_close
    I/libbt_ti( 1125): vendor cleanup
    I/        ( 1125): BTE_InitTraceLevels -- TRC_HCI
    I/        ( 1125): BTE_InitTraceLevels -- TRC_L2CAP
    I/        ( 1125): BTE_InitTraceLevels -- TRC_RFCOMM
    I/        ( 1125): BTE_InitTraceLevels -- TRC_AVDT
    I/        ( 1125): BTE_InitTraceLevels -- TRC_AVRC
    I/        ( 1125): BTE_InitTraceLevels -- TRC_A2D
    I/        ( 1125): BTE_InitTraceLevels -- TRC_BNEP
    I/        ( 1125): BTE_InitTraceLevels -- TRC_BTM
    I/        ( 1125): BTE_InitTraceLevels -- TRC_GAP
    I/        ( 1125): BTE_InitTraceLevels -- TRC_PAN
    I/        ( 1125): BTE_InitTraceLevels -- TRC_SDP
    I/        ( 1125): BTE_InitTraceLevels -- TRC_GATT
    I/        ( 1125): BTE_InitTraceLevels -- TRC_SMP
    I/        ( 1125): BTE_InitTraceLevels -- TRC_BTAPP
    I/        ( 1125): BTE_InitTraceLevels -- TRC_BTIF
    I/GKI_LINUX( 1125): gki_task_entry: gki_task task_id=0 [BTU] terminating
    ============================

    BRs,

    Johnny

  • Hi Johnny,

    Can you check the permissions of "hci_tty".

    Please add the below in "ueventd.rc" file.

    /dev/hci_tty 0660 system net_bt_stack

     

  • Hi Sundeep,


    Problem still exist, added "/dev/hci_tty 0660 system net_bt_stack" in "ueventd.rc" file.

    E/uim-sysfs(  113): uim: Invalid response
    E/uim-sysfs(  113): uim:cleanup
    E/uim-sysfs(  113): uim: Inside st_uart_config
    E/uim-sysfs(  113): uim: Un-Installed N_TI_WL Line displine
    E/libbt_ti( 1078):  Can't open hci_tty
    E/bt_userial( 1078): userial_open: wrong numbers of open fd in vendor lib [-1]!
    E/bt_userial( 1078): userial_open: HCI UART expects only one open fd
    I/libbt_ti( 1078): vendor op - 4
    I/libbt_ti( 1078): vendor op - 1
    I/bt_hci_bdroid( 1078): bt_hc_worker_thread exiting
    I/bt-btu  ( 1078): btu_task received preload complete event
    D/bt_userial( 1078): userial_close(fd:-1)
    I/libbt_ti( 1078): vendor op - 4
    D/BTSNOOP-DISP( 1078): btsnoop_close
    I/libbt_ti( 1078): vendor cleanup
    I/libbt_ti( 1078): vendor op - 0
    W/libbt_ti( 1078): Unknown opcode: 0
    I/        ( 1078): BTE_InitTraceLevels -- TRC_HCI
    I/        ( 1078): BTE_InitTraceLevels -- TRC_L2CAP
    I/        ( 1078): BTE_InitTraceLevels -- TRC_RFCOMM
    I/        ( 1078): BTE_InitTraceLevels -- TRC_AVDT
    I/        ( 1078): BTE_InitTraceLevels -- TRC_AVRC
    I/        ( 1078): BTE_InitTraceLevels -- TRC_A2D
    I/        ( 1078): BTE_InitTraceLevels -- TRC_BNEP
    I/        ( 1078): BTE_InitTraceLevels -- TRC_BTM
    I/        ( 1078): BTE_InitTraceLevels -- TRC_GAP
    I/        ( 1078): BTE_InitTraceLevels -- TRC_PAN
    I/        ( 1078): BTE_InitTraceLevels -- TRC_SDP
    I/        ( 1078): BTE_InitTraceLevels -- TRC_GATT
    I/        ( 1078): BTE_InitTraceLevels -- TRC_SMP
    I/        ( 1078): BTE_InitTraceLevels -- TRC_BTAPP
    I/        ( 1078): BTE_InitTraceLevels -- TRC_BTIF

    BRs,

    Johnny

  • Hi,

    You will get this problem only when you don't have "hci_tty" or if the permissions are not correct.

    check if you have "hci_tty" driver.

  • Hi Sundeep,

    We found the fix solution today. The kernel UART uart1_tx pin config in /kernel/arch/arm/mach-omap2/board-44xx-serial.c was improper. 

    Thanks for your support.

    BRs,

    Johnny