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.

Issues in HCI_UART interface for DM365 + WL1835MOD

Other Parts Discussed in Thread: WL1835MOD, WL1835

Hi ,

I am working on getting WL1835MOD chip up, which is interfaced with TI's DM365 via UART (HCI_UART). But i am facing few issues in getting the interface detected. I have a kernel 2.6.4 running on my DM365 and i have enabled Bluetooth Core device drivers and HCI_UART (H4) drivers in kernel. Also when i boot the device this updated kernel image i see the initialization of HCI & HCI_UART interface. 

The issue is i can't find the hci0 interface in /sys/class/bluetooth/ , even though WL1835 connected to the device. As of now don't have hci related tools (hciconfig etc). But can you please suggest something to get the interface detected in the device.

Any inputs would be appreciated.

Thanks

Brajesh

  • Hi,

    Did you make sure if the hardware configuration is fine as mentioned here processors.wiki.ti.com/.../WL18xx_Module_Schematic_Checklist

    Do you mean you are not able to run hciconfig hci0 up? and you done have hciconfig commands?
    Did you try hciattach /dev/ttyS2 texas 115200 (use the device as per your device)?
  • Hi Sundeep ,

    Thanks for your prompt reply. As per your suggestions i have gone through the link that you have suggested for hardware connection and configurations. Since for now my task is to get HCI interface, I have looked in to BT Section of that link and following pin connections are required.

    HOST_TX, HOST_RX, HOST_CTS, HOST_RTS & BT_EN. 

    So as i checked, i have above pins connected to WL1835MOD. But still i don't get hci0 interface in /sys/class/bluetooth/ directory.

    do you think there are other pin connections also required. There is a mention of slow clock but i guess to get HCI_UART interface all that is not necessary or is it ?

    And about hci commands, i am yet to have those commands as i have not compiled the bluez. But that'll be required only if i have hci0 interface. The problem is that the tty Uart console doesn't detect the connected hci interface.

    Also as i pointed out earlier that i am using kernel 2.6, may that be a problem can you provide some sort of patches if available for DM365.   

    Please revert back with your valuable comments and suggestions. 

    Thanks

    Brajesh

  • Hi,

    Yes slow clock and power is required as well, slow clock must be accurate as per the data sheet.
  • Hi Sundeep,

    As you suggested, I have checked and probed slow clock in WiLink device and it seems fine. But still it doesn't detect hci0 interface. 

    Can you please check and verify the steps that i am following to get the HCI UART interface up as i explained above.

    Compiling kernel with following kernel Bluetooth Configurations :

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

    +CONFIG_BT=y
    +CONFIG_BT_L2CAP=y
    +CONFIG_BT_SCO=y
    +CONFIG_BT_RFCOMM=n
    +CONFIG_BT_RFCOMM_TTY=n
    +CONFIG_BT_BNEP=n
    +CONFIG_BT_BNEP_MC_FILTER=y
    +CONFIG_BT_BNEP_PROTO_FILTER=y
    +
    +#
    +# Bluetooth device drivers
    +#
    +# CONFIG_BT_HCIBTUSB is not set
    +# CONFIG_BT_HCIBTSDIO is not set
    +CONFIG_BT_HCIUART=y
    +CONFIG_BT_HCIUART_H4=y
    +CONFIG_BT_HCIUART_BCSP=y
    +# CONFIG_BT_HCIUART_ATH3K is not set
    +CONFIG_BT_HCIUART_LL=y
    +# CONFIG_BT_HCIBCM203X is not set
    +# CONFIG_BT_HCIBPA10X is not set

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

    Loading DM365 with updated kernel image when DM365 device is connected to WL1835MOD via HCI UART. And connections are as follows :

    HOST_TX, HOST_RX, HOST_CTS, HOST_RTS & BT_EN. 

    After this an "hci0" interface is expected at /sys/class/bluetooth/. Although i can't find one.  Am i doing something wrong somewhere ?

    Thanks for your suggestions. Waiting for your more inputs. 

    Thanks

    Brajesh

  • Hi Sundeep,

    Following is the Boot log of DM365 which shows init of HCI_UART and ttyS0 AND ttyS1. But no hci0 interface.

    brajesh@brajesh-Latitude-3540:~/ipnc_rdk_dm36x_5.1/Source/dvsdk_ipnctools/ipnc_psp_03_21_00_04/kernel$ sudo minicom -s
    [sudo] password for brajesh:


    Welcome to minicom 2.5

    OPTIONS: I18n
    Compiled on May 2 2011, 10:05:24.
    Port /dev/ttyUSB0

    Press CTRL-A Z for help on special keys


    DM365 IPNC :>AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
    Unknown command 'AT' - try 'help'
    DM365 IPNC :>
    DM365 IPNC :>tftpboot 0x80700000 uImage_mcam_dm365_30_Mar;nand erase 0x400000 0x500000;nand write 0x80700000 0x400000 0x500000
    TFTP from server 192.168.1.1; our IP address is 192.168.1.2
    Filename 'uImage_mcam_dm365_30_Mar'.
    Load address: 0x80700000
    Loading: #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    #################################################################
    ###############################################################
    done
    Bytes transferred = 4645568 (46e2c0 hex)

    NAND erase: device 0 offset 0x400000, size 0x500000
    Erasing at 0x8e0000 -- 100% complete.
    OK

    NAND write: device 0 offset 0x400000, size 0x500000
    5242880 bytes written: OK
    DM365 IPNC :>reset
    DM36x initialization passed!
    0x00000000Fail boot Count: 0x00000003
    Boot Loader BootMode = NAND
    Starting NAND Copy...
    Valid magicnum, 0xA1ACED66, found in block 0x00000008.
    Boot Mode Task Completed

    IPNC UBL Version: 2.2.0
    Platform: DM365-297

    UBL Executed Sucessfully

    Jumping to entry point at 0x81080000

    U-Boot 1.3.4-svn1306 (Jan 6 2015 - 19:29:17) DM365-IPNC-5.1.0

    I2C: ready
    DRAM: 256 MB
    NAND: NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
    Bad block table found at page 65472, version 0x01
    Bad block table found at page 65408, version 0x01
    128 MiB
    *** Warning - bad CRC or NAND, using default environment

    In: serial
    Out: serial
    Err: serial
    ARM Clock :- 297MHz
    DDR Clock :- 270MHz
    Ethernet PHY: RTL8201 @ 0x10
    Cheking DDR memeory size....
    DDR Memory Size :256M
    Hit any key to stop autoboot: 0

    NAND read: device 0 offset 0x400000, size 0x450000
    4521984 bytes read: OK

    Loading from NAND 128MiB 3,3V 8-bit, offset 0x400000
    Image Name: Linux-2.6.37_IPNC_DM365_5.1.0+
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 4645504 Bytes = 4.4 MB
    Load Address: 80008000
    Entry Point: 80008000
    ## Booting kernel from Legacy Image at 80700000 ...
    Image Name: Linux-2.6.37_IPNC_DM365_5.1.0+
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 4645504 Bytes = 4.4 MB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
    OK

    Starting kernel ...

    [ 0.000000] Linux version 2.6.37_IPNC_DM365_5.1.0+ (root@brajesh-Latitude-3540) (gcc version 4.3.3 (GCC) ) #14 PREEMPT Mon Mar 30 18:30:44 5
    [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
    [ 0.000000] CPU: VIVT data cache, VIVT instruction cache
    [ 0.000000] Machine: DaVinci DM36x MCAM
    [ 0.000000] Memory policy: ECC disabled, Data cache writeback
    [ 0.000000] DaVinci dm36x_rev1.2 variant 0x8
    [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
    [ 0.000000] Kernel command line: mem=128M console=ttyS0,115200n8 root=/dev/mtdblock3 rootfstype=squashfs ip=off eth=00:01:02:03:04:05 cmemk1
    [ 0.000000] TI DaVinci EMAC: kernel boot params Ethernet address: 00:01:02:03:04:05
    [ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
    [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    [ 0.000000] Memory: 128MB = 128MB total
    [ 0.000000] Memory: 125212k/125212k available, 5860k reserved, 0K highmem
    [ 0.000000] Virtual kernel memory layout:
    [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
    [ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
    [ 0.000000] DMA : 0xff000000 - 0xffe00000 ( 14 MB)
    [ 0.000000] vmalloc : 0xc8800000 - 0xfea00000 ( 866 MB)
    [ 0.000000] lowmem : 0xc0000000 - 0xc8000000 ( 128 MB)
    [ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
    [ 0.000000] .init : 0xc0008000 - 0xc002d000 ( 148 kB)
    [ 0.000000] .text : 0xc002d000 - 0xc044c000 (4220 kB)
    [ 0.000000] .data : 0xc044c000 - 0xc0476280 ( 169 kB)
    [ 0.000000] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    [ 0.000000] Preemptable hierarchical RCU implementation.
    [ 0.000000] RCU-based detection of stalled CPUs is disabled.
    [ 0.000000] Verbose stalled-CPUs detection is disabled.
    [ 0.000000] NR_IRQS:245
    [ 0.000000] Console: colour dummy device 80x30
    [ 0.000399] Calibrating delay loop... 147.86 BogoMIPS (lpj=739328)
    [ 0.220082] pid_max: default: 32768 minimum: 301
    [ 0.220511] Mount-cache hash table entries: 512
    [ 0.221554] CPU: Testing write buffer coherency: ok
    [ 0.223683] devtmpfs: initialized
    [ 0.227640] DaVinci: 8 gpio irqs
    [ 0.228475] NET: Registered protocol family 16
    [ 0.389105] bio: create slab <bio-0> at 0
    [ 0.395686] SCSI subsystem initialized
    [ 0.401282] usbcore: registered new interface driver usbfs
    [ 0.403078] usbcore: registered new interface driver hub
    [ 0.404248] usbcore: registered new device driver usb
    [ 0.412415] vpss vpss: dm365_vpss vpss probed
    [ 0.412501] vpss vpss: dm365_vpss vpss probe success
    [ 0.414938] Advanced Linux Sound Architecture Driver Version 1.0.23.
    [ 0.417510] Bluetooth: Core ver 2.15
    [ 0.418387] NET: Registered protocol family 31
    [ 0.418434] Bluetooth: HCI device and connection manager initialized
    [ 0.418486] Bluetooth: HCI socket layer initialized
    [ 0.418616] Switching to clocksource timer0_1
    [ 0.513257] musb-hdrc: version 6.0, host, debug=0
    [ 0.513511] musb-hdrc musb-hdrc: dma type: pio
    [ 0.529342] musb-hdrc musb-hdrc: MUSB HDRC host driver
    [ 0.529622] musb-hdrc musb-hdrc: new USB bus registered, assigned bus number 1
    [ 0.529947] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [ 0.530016] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [ 0.530071] usb usb1: Product: MUSB HDRC host driver
    [ 0.530116] usb usb1: Manufacturer: Linux 2.6.37_IPNC_DM365_5.1.0+ musb-hcd
    [ 0.530169] usb usb1: SerialNumber: musb-hdrc
    [ 0.533166] hub 1-0:1.0: USB hub found
    [ 0.533295] hub 1-0:1.0: 1 port detected
    [ 0.535291] musb-hdrc musb-hdrc: USB Host mode controller at fec64000 using PIO, IRQ 12
    [ 0.536783] NET: Registered protocol family 2
    [ 0.537210] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    [ 0.538255] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
    [ 0.538573] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
    [ 0.538999] TCP: Hash tables configured (established 4096 bind 4096)
    [ 0.539055] TCP reno registered
    [ 0.539117] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [ 0.539204] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [ 0.539931] NET: Registered protocol family 1
    [ 0.541320] RPC: Registered udp transport module.
    [ 0.541380] RPC: Registered tcp transport module.
    [ 0.541420] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [ 0.633371] squashfs: version 4.0 (2009/01/31) Phillip Lougher
    [ 0.641987] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
    [ 0.646638] JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
    [ 0.652146] msgmni has been set to 244
    [ 0.657833] io scheduler noop registered (default)
    [ 0.660306] CSL: Module install successful, device major num = 253
    [ 0.660369] CSL: Module version 0.10.00, built on Mar 23 2015 16:08:55
    [ 0.660442] I2C: Module install successful, device major num = 252
    [ 0.660496] DMA: Module install successful, device major num = 251
    [ 0.660535] DRV: Module install successful
    [ 0.660568] DRV: Module built on Mar 23 2015 16:08:57
    [ 0.660603] DRV: EDMACC.QUEPRI = 00002777
    [ 0.660634] DRV: SYSTEM.MSTPRI0 = 00440011
    [ 0.660666] DRV: SYSTEM.MSTPRI1 = 00000444
    [ 0.660697] DRV: ISP.BCR = 00000002
    [ 0.660729] DRV: SYSTEM.MISC = 00000399
    [ 0.660761] EDMAK module: built on Mar 23 2015 at 16:08:38
    [ 0.660802] Reference Linux version 2.6.37
    [ 0.660837] File /home/brajesh/ipnc_rdk_dm36x_5.1/Source/dvsdk_ipnctools/linuxutils_2_26_02_05/packages/ti/sdo/linuxutils/edma/src/modulec
    [ 0.662872] IRQK module: built on Mar 23 2015 at 16:08:11
    [ 0.662940] Reference Linux version 2.6.37
    [ 0.662977] File /home/brajesh/ipnc_rdk_dm36x_5.1/Source/dvsdk_ipnctools/linuxutils_2_26_02_05/packages/ti/sdo/linuxutils/irq/src/module/c
    [ 0.665071] irqk initialized
    [ 0.665168] CMEMK module: built on Mar 23 2015 at 16:08:35
    [ 0.665220] Reference Linux version 2.6.37
    [ 0.665256] File /home/brajesh/ipnc_rdk_dm36x_5.1/Source/dvsdk_ipnctools/linuxutils_2_26_02_05/packages/ti/sdo/linuxutils/cmem/src/modulec
    [ 0.691772] allocated heap buffer 0xc9000000 of size 0x6222000
    [ 0.691835] CMEM Range Overlaps Kernel Physical - allowing overlap
    [ 0.691886] CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x88000000)
    [ 0.692083] cmemk initialized
    [ 0.692158] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
    [ 0.717500] serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
    [ 1.339472] console [ttyS0] enabled
    [ 1.365809] serial8250.0: ttyS1 at MMIO 0x1d06000 (irq = 41) is a 16550A
    [ 1.377491] brd: module loaded
    [ 1.392534] NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung )
    [ 1.401636] Creating 9 MTD partitions on "davinci_nand.0":
    [ 1.407196] 0x000000000000-0x000000200000 : "bootloader"
    [ 1.418430] 0x000000200000-0x000000400000 : "params"
    [ 1.429863] 0x000000400000-0x000000900000 : "kernel"
    [ 1.440999] 0x000000900000-0x000002900000 : "filesystem"
    [ 1.452640] 0x000002900000-0x000003000000 : "config"
    [ 1.463596] 0x000003000000-0x000003500000 : "kernel_recovery"
    [ 1.475353] 0x000003500000-0x000004500000 : "filesystem_recovery"
    [ 1.487649] 0x000004500000-0x000004f00000 : "syslog"
    [ 1.499147] 0x000004f00000-0x000008000000 : "data1"
    [ 1.510284] davinci_nand davinci_nand.0: controller rev. 2.3
    [ 1.568840] davinci_mdio davinci_mdio.0: davinci mdio revision 1.4
    [ 1.575076] davinci_mdio davinci_mdio.0: detected phy mask fffeffff
    [ 1.583311] davinci_mdio.0: probed
    [ 1.586785] davinci_mdio davinci_mdio.0: phy[16]: device 0:10, driver unknown
    [ 1.595212] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 1.601861] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 1.608111] i2c_davinci i2c_davinci.1: initiating i2c bus recovery


    [ 1.765867] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 1.772193] i2c_davinci i2c_davinci.1: initiating i2c bus recovery


    [ 1.904423] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 1.910759] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 1.917001] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 1.923332] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [

    [ 2.515262] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.521590] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.527831] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.534158] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.540492] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.546734] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.553061] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.559395] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.565636] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.571966] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.578206] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.584536] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.590871] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.597107] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 2.603439] i2c_davinci i2c_davinci.1: timeout waiting for bus ready
    [ 2.609932] i2c_davinci i2c_davinci.1: timeout waiting for bus ready
    [ 2.616380] bq32k: probe of 1-0068 failed with error -5
    [ 2.622416] i2c /dev entries driver
    [ 2.629036] Linux media interface: v0.10
    [ 2.633913] Linux video capture interface: v2.00
    [ 2.641667] vpbe-osd vpbe-osd: OSD sub device probe success
    [ 2.648391] vpbe-venc vpbe-venc: VENC sub device probe success
    [ 2.655575] vpbe-v4l2 vpbe-v4l2: vpbe v4l2 device registered
    [ 2.661998] Setting default output to Composite
    [ 2.666575] Setting default mode to ntsc
    [ 2.670826] vpbe-v4l2 vpbe-v4l2: Trying to register VPBE display device.
    [ 2.677562] vpbe-v4l2 vpbe-v4l2: layer=c7862a00,layer->video_dev=c7862ae8
    [ 2.685758] vpbe-v4l2 vpbe-v4l2: Trying to register VPBE display device.
    [ 2.692822] vpbe-v4l2 vpbe-v4l2: layer=c78fb000,layer->video_dev=c78fb0e8
    [ 2.702268] watchdog watchdog: heartbeat 60 sec
    [ 2.708966] Bluetooth: HCI UART driver ver 2.2
    [ 2.713463] Bluetooth: HCI H4 protocol initialized
    [ 2.718273] Bluetooth: HCI BCSP protocol initialized
    [ 2.723668] Bluetooth: HCILL protocol initialized
    [ 2.733803] Error: Driver 'davinci-mcbsp' is already registered, aborting...
    [ 2.744762] asoc: cq93vc-hifi <-> davinci-vcif mapping ok
    [ 2.755448] ALSA device list:
    [ 2.758470] #0: DaVinci DM365 EVM
    [ 2.764160] TCP cubic registered
    [ 2.775097] NET: Registered protocol family 10
    [ 2.783175] IPv6 over IPv4 tunneling driver
    [ 2.790254] NET: Registered protocol family 17
    [ 2.795368] Bluetooth: L2CAP ver 2.15
    [ 2.799273] Bluetooth: L2CAP socket layer initialized
    [ 2.804428] Bluetooth: SCO (Voice Link) ver 0.6
    [ 2.809206] Bluetooth: SCO socket layer initialized
    [ 2.814569] Bluetooth: RFCOMM TTY layer initialized
    [ 2.819877] Bluetooth: RFCOMM socket layer initialized
    [ 2.825097] Bluetooth: RFCOMM ver 1.11
    [ 2.829017] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
    [ 2.834362] Bluetooth: BNEP filters: protocol multicast
    [ 2.839892] lib80211: common routines for IEEE802.11 drivers
    [ 2.845642] Registering the dns_resolver key type
    [ 2.861165] drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
    [ 2.872817] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
    [ 2.885144] devtmpfs: mounted
    [ 2.888340] Freeing init memory: 148K
    INIT: version 2.86 booting
    [ 4.243271] Empty flash at 0x002a50f8 ends at 0x002a5800
    Starting mounting local filesystems: mount mount: mounting /dev/root on / failed: No such file or directory
    mount: mounting none on /dev/shm failed: No such file or directory
    failed (2: ).
    [ 4.721444] davinci_pwm: PWM Control Module loaded successfully
    mkdir: cannot create directory '/mnt/nand/uploaded_cfg': File exists
    Creat queue id:32769
    queue id:32769
    FileMngThread created
    Creat queue id:65538
    queue id:65538
    AlramThread created
    IR-CUT Thread created
    queue id:65538
    Profile Schedule Thread created
    Creat queue id:98307
    queue id:98307
    Creat queue id:131076
    queue id:131076
    PtzThread created
    Cam Iris Thread created
    Share memory init success
    IPNC_DM365_5.1.0+ (root@brajesh-Latitude-3540) (gcc version 4.3.3 (GCC) ) #14
    queue id:98307
    Starting internet superserver: inetd.
    insmod: can't read '/opt/ipnc/modules/deflate.ko': No such file or directory
    insmod: can't read '/opt/ipnc/modules/des_generic.ko': No such file or directory
    insmod: can't read '/opt/ipnc/modules/md5.ko': No such file or directory
    [ 6.780755] net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=0:10, id=8201)
    [ 6.809271] ADDRCONF(NETDEV_UP): eth0: link is not ready
    umount: /mnt/nas: not mounted

    CPU is DM365

    *****************************************************************

    IPNC BUILD VERSION: DM365 IPNC RDK V5.10.00.04

    *****************************************************************

    ./av_server.out DM365 NTSC TI2A AEWB SINGLE_STREAM H264 2000000 CBR AUTO 720 MENUOFF &
    Check_device_version : DEVICE VER = 0 !!
    net_get_ifaddr: ioctl SIOCGIFADDR: No such device
    net_get_netmask: ioctl SIOCGIFNETMASK: No such device
    ApproDrvInit: 7
    Creat queue id:163845
    queue id:163845
    [ 8.077956] davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
    [ 8.752983] Loading iSCSI transport class v2.0-870.
    [ 8.779356] PHY: 0:10 - Link is Up - 100/Full
    [ 8.789906] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

    AVSERVER UI: Initializing.

    CLK Hz,
    ARM Hz = 297000000
    DDR Hz = 270000000
    VPSS Hz = 270000000
    IMCOP Hz = 270000000

    [OSA_FILE ] Reading file [/mnt/nand/IMG_Paramset.bin] ... ERROR
    IMAGE TUNE: Paramset File is not available..... Setting DEFAULT parameter
    [ 10.424558] iscsi: registered transport (tcp)
    insmod: can't read '/opt/ipnc/modules/musb_hdrc.ko': No such file or directory
    insmod: can't read '/opt/ipnc/modules/cppi_dma.ko': No such file or directory
    insmod: can't read '/opt/ipnc/modules/davinci.ko': No such file or directory
    SYSTEM.MSTPRI0 value changed to 00440011

    CONFIGURING AVSERVER FOR DM365 .....
    queue id:98307
    SENSOR FPS VALUE = 30
    [ 10.667060] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 10.673517] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 10.679997] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 10.686245] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 10.692603] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 10.699025] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 10.705270] i2c_davinci i2c_davinci.1: initiating i2c bus recovery

    [ 17.141996] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.148234] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.154737] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.161363] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.167649] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.174026] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.180513] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.186798] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.193157] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.199641] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.206035] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.212414] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.218803] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.225048] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.231653] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.237936] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.244298] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.250658] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.256897] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.263230] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.269589] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.275897] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.282239] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.288504] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.294838] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.301188] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.307424] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.313754] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.320101] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.326339] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.332670] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.339021] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.345261] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 17.351603] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 18.015484] i2c_davinci i2c_davinci.1: timeout waiting for bus ready
    [ 18.022190] i2c16_transfer(0x10, 0x30)
    ERROR (drv_imgs_MT9M034_1.2MP.c|DRV_imgsCheckId|1502): DRV_i2c16Read16()
    [ 18.036601] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.040616] i2c_davinci i2c_davinci.1: timeout waiting for bus ready
    [ 19.047008] i2c_davinci i2c_davinci.1: timeout waiting for bus ready
    [ 19.053504] i2c16_transfer(0x10, 0x30)
    ERROR (drv_imgs_MT9M034_1.2MP.c|DRV_imgsCheckId|1502): DRV_i2c16Read16()
    [ 19.067983] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.074438] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.080794] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.087059] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.093398] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.099733] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.105996] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.112342] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.118605] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.124942] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.131278] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.137543] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.143873] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.150211] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.156475] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.162807] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.169157] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.175561] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.181937] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.188208] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.194552] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.201030] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.207433] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.213817] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.220184] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.226706] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.233088] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.239454] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.245694] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.252198] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.258579] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.264956] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.271365] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.277604] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.283953] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.290311] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.510921] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.517157] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.523505] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.529854] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.788383] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.794716] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.801051] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.807314] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.813647] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.819995] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.826228] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.832557] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.838906] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.845140] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.851470] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.857731] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.864062] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.870415] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.876648] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.883008] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.889368] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.895609] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.901955] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.908217] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.914551] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.920904] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 19.927141] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 20.059656] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 20.065893] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 20.072278] i2c_davinci i2c_davinci.1: timeout waiting for bus ready
    [ 20.078673] i2c_davinci i2c_davinci.1: timeout waiting for bus ready
    [ 20.085171] i2c16_transfer(0x10, 0x30)
    ERROR (drv_imgs_MT9M034_1.2MP.c|DRV_imgsCheckId|1502): DRV_i2c16Read16()
    [ 20.099744] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 20.106044] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 20.112434] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 23.706503] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 23.712837] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 23.719172] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 23.725439] i2c_davinci i2c_davinci.1: initiating i2c bus recovery

    [ 24.192232] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 24.198465] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 24.204796] i2c_davinci i2c_davinci.1: initiating i2c bus recovery
    [ 24.211148] i2c_davinci i2c_davinci.1: timeout waiting for bus ready
    [ 24.217541] i2c_davinci i2c_davinci.1: timeout waiting for bus ready
    [ 24.224048] i2c16_transfer(0x10, 0x30)
    ERROR (drv_imgs_MT9M034_1.2MP.c|DRV_imgsCheckId|1502): DRV_i2c16Read16()
    ERROR (drv_imgs_MT9M034_1.2MP.c|DRV_imgsOpen|60): DRV_imgsCheckId()
    ERROR (drv_capture.c|DRV_captureOpen|63): Open failed
    ERROR (videoCaptureThr.c|VIDEO_captureTskCreate|96): DRV_captureOpen()
    ERROR (videoCaptureThr.c|VIDEO_captureTskMain|782): VIDEO_captureTsk[ 24.260964] tun: Universal TUN/TAP device driver, 1.6
    Create() ERROR [ 24.267240] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
    (avServerMainThr.c|AVSERVER_tskStart|24):

    WD Manager : Watch dog reset Triggered by task[ 24.471616] console [netcon0] enabled
    [ 24.478898] netconsole: network logging started
    [ 24.780032] PPP generic driver version 2.4.2
    [ 24.860287] PPP Deflate Compression module registered
    mkdosfs 2.11 (12 Mar 2005)
    unable to get drive geometry, using default 255/63/dev/ram0 has 255 heads and 63 sectors per track,
    logical sector size is 512,
    using 0xf8 media descriptor, with 8192 sectors;
    file system has 2 12-bit FATs and 4 sectors per cluster.
    FAT size is 6 sectors, and provides 2036 clusters.
    Root directory contains 512 slots.
    Volume ID is 0000001a, no volume label.
    [ 26.437025]
    [ 26.437057] Version Control: Version Control Module Loaded
    queue id:32769
    TimeOut occure in boot_proc.
    Program exit.
    ApproDrvInit: 3
    queue id:163845
    insmod: can't read '/opt/ipnc/module/usb-storage.ko': No such file or directory
    mount: mounting devpts on /dev/pts failed: No such file or directory
    INIT: Entering runlevel: 5
    Starting telnet daemon.
    done
    getty: ioctl() TIOCSPGR
    _____ _____ _ _
    | _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
    | | _| .'| . | . | | __| _| . | | | -_| _| _|
    |__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
    |___| |___|

    Arago Project http://arago-project.org DM365_IPNC console

    Arago 2009.11 DM365_IPNC console

    DM365_IPNC login: root
    login[1459]: root login on `console'

    -sh: can't access tty; job control turned off
    root@DM365_IPNC:~# ls /sys/class/bluetooth/
    root@DM365_IPNC:~#

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

    Please let me know your comments on above boot log.
    Thanks
    Brajesh
  • Hi Brajesh,

    I don't see that you are running "hciattach". This is the one that creates the 'hci0' interface.

    Regards,
    Gigi Joseph.
  • Hi Joseph,



    Thanks for your reply, it is exactly what i was asking. Bluez stack gave me the binaries and with hciattach command i can see the hci0 interface in /sys/class/bluetooth.

    Following are the command responses, please have a look.

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

    root@DM365_IPNC:~# hciattach /dev/ttyS1 any
    Device setup complete
    root@DM365_IPNC:~# hciconfig hci0 up

    Can't init device hci0: Connection timed out (110)

    root@DM365_IPNC:~# hcitool dev
    Devices:


    root@DM365_IPNC:~# hcitool con
    Connections:

    root@DM365_IPNC:~# hcitool inq
    Inquiring ...
    Inquiry failed.: No such device

    root@DM365_IPNC:~# hciconfig -a
    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

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

    As you can see above, it doesn't show the BD Adress of the device. Now can you suggest me what shall i do to get the interface up.



    Thanks

    Brajesh
  • Hi Brajesh,

    Please check the hciattach doucmentation. I think the command should be - "hciattach /dev/ttyS1 texas 115200"

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    I tried that command it gives me "Initialization timed out". 

    Shall follow what is mentioned in the following link ?

    http://www.lsr.com/ProductsForum/tabid/164/forumid/1/postid/3995/scope/posts/Default.aspx

    Thanks 

    Brajesh

  • Hi Brajesh,

    Yes, that is a good idea!
    "Initialization timed out" could indicate that the BT_EN GPIO is not toggled.

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    For that shall i have a seperate gpio_en.ko driver as mentioned in that link ? And if yes then what should it contain ? simply toggling gpio_out ?

    Thanks
    Brajesh
  • Yes, or you can export the BT_EN gpio and control it via the sysfs entries.

    echo <bt_en> > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio<bt_en>/direction
    echo 1 > /sys/class/gpio/gpio<bt_en>/value

    check the output of debug/gpio { /sys/kernel/debug/gpio}

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    As you suggested, i am exporting GPIO as follows.

    ------------------------------------------------------------
    root@DM365_IPNC:~# echo 48 > /sys/class/gpio/export
    root@DM365_IPNC:
    root@DM365_IPNC:~# echo out > /sys/class/gpio/gpio48/direction
    root@DM365_IPNC:~#
    root@DM365_IPNC:~# echo 1 > /sys/class/gpio/gpio48/value
    root@DM365_IPNC:~#
    (Although value doesn't seem to update, i checked it via following commands)
    root@DM365_IPNC:~# cat /sys/class/gpio/gpio48/value
    0
    root@DM365_IPNC:~#
    Also by following command :
    root@DM365_IPNC:~# cat /sys/kernel/debug/gpio
    GPIOs 0-31, DaVinci:

    GPIOs 32-63, DaVinci:
    gpio-33 (usb ) out hi
    gpio-48 (sysfs ) out lo

    GPIOs 64-95, DaVinci:

    GPIOs 96-106, DaVinci:

    After doing above steps when i do hciattach, it throws same error.
    root@DM365_IPNC:~# hciattach /dev/ttyS1 texas 3000000
    Initialization timed out.
    root@DM365_IPNC:~#
    ------------------------------------------------------------------------------
    Can you please suggest me what can be the reason behind it.

    Thanks
    Brajesh
  • Hi Brajesh,

    For some reason, the BT_EN gpio is not driven high - "gpio-48 (sysfs ) out lo" . You can also check it using a scope.
    This is the reason why hciattach is failing.

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    I have checked GPIO_48 using scope and noticed that it is toggling when i am toggling by above commands (exporting gpio in sysfs). But it is not toggling when i give hci commands (hciattach)or insert drivers (st_drv.ko & btwlink.ko).

    But when i toggle GPIO via following commands, inserting st_drv.ko throws error as follows:
    ------------------------------------------------------------------------------------------------------
    root@DM365_IPNC:~# echo 48 > /sys/class/gpio/export
    root@DM365_IPNC:~# echo out > /sys/class/gpio/gpio48/direction
    root@DM365_IPNC:~# echo 0 > /sys/class/gpio/gpio48/value

    root@DM365_IPNC:~# insmod /opt/ipnc/modules/st_drv.ko
    [ 71.202527] (stk) : gpio 48 request failed
    [ 71.214197] kim: probe of kim failed with error -16
    ---------------------------------------------------------------------------------------------------------

    and when i do not toggle gpio by exporting gpio, i get following response :
    --------------------------------------------------------------------------------------------------------
    root@DM365_IPNC:~# insmod /opt/ipnc/modules/st_drv.ko
    [ 153.526850] (stk) :sysfs entries created
    [ 153.541728] (stk) : debugfs entries created root@DM365_IPNC:~#
    root@DM365_IPNC:~# 2C
    root@DM365_IPNC:~# insmod /opt/ipnc/modules/btwilink.ko
    root@DM365_IPNC:~#
    ----------------------------------------------------------------------------------------------------------
    So it seems like gpio has to toggle via inserting drivers rather than manually.

    Can you please give your inputs on above issues.

    Thanks
    Brajesh
  • Hi Brajesh,

    If you are using the Shared transport driver, then you don't need to manually control the GPIO. The st_kim does that. But have you set the correct "nshutdown_gpio" (in the board file) ? Also, in this case you don't need the hciattach. This is replaced by the "uim" utility.

    Please see: processors.wiki.ti.com/.../WL18xx_BlueZ_Bringing_Up_on_AM335x for the BlueZ bring up guide.

    So, either follow the above guide or use the legacy method (gpio toggle & hciattach).

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    So it means for non legacy method, I just need to give 

    #insmod st_drv.ko

    #insmod btwlink.ko

    is that all ?

    Thanks

    Brajesh

  • Hi Joseph,

    For non legacy method i have removed hci uart drivers as suggested by a link. And when insert st_drv.ko driver , /sys/devices/plateform/kim/install should show 1 but it is showing 0, which means UART interface is not detected.
    -----------------------------------------------------------------------------------------
    root@DM365_IPNC:~# insmod /opt/ipnc/modules/st_drv.ko
    [ 38.890706] (stk) :sysfs entries created
    [ 38.895149] (stk) : debugfs entries created root@DM365_IPNC:~#
    root@DM365_IPNC:~#
    root@DM365_IPNC:~# cat /sys/devices/platform/kim/dev_name
    /dev/ttyS1
    root@DM365_IPNC:~# cat /sys/devices/platform/kim/baud_rate
    3000000
    root@DM365_IPNC:~# cat /sys/devices/platform/kim/install
    0

    root@DM365_IPNC:~# uim
    uim:@ main
    uim:begin polling.. (HANGS here)
    ------------------------------------------------------------------------------------------

    Next time when i try btwlink.ko, it doesn't show any logs at all.

    root@DM365_IPNC:~# insmod /opt/ipnc/modules/st_drv.ko
    [ 38.890706] (stk) :sysfs entries created
    [ 38.895149] (stk) : debugfs entries created root@DM365_IPNC:~#

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

    Can't see any reason why /sys/devices/platform/kim/install is not changing from '0' to '1'.

    Thanks
    Brajesh
  • Hi Joesph,

    I have done some more analysis of the problem by putting some debug prints. Actually it looks like after inserting st_drv.ko and running uim command as said earlier when i insert "btwilink.ko", the driver is not calling bt_ti_probe function to probe device. As i can see from debug prints, the btwlink.ko driver gets registered successfully but doesn't go any where after that. Can you give your inputs on this what might be the reason behind this.

    And also when does the chip_enable function in board file gets called. Following is the code snap.
    ---------------------------------------
    int plat_kim_chip_enable(struct kim_data_s *kim_data)
    {
    printk(KERN_DEBUG "INSIDE %s \n",__FUNCTION__);
    gpio_request(kim_data->nshutdown, "bt_enable");
    gpio_direction_output(kim_data->nshutdown, 0);
    gpio_set_value(kim_data->nshutdown, 0);
    // msleep(1);
    gpio_direction_output(kim_data->nshutdown, 1);
    gpio_set_value(kim_data->nshutdown, 1);
    gpio_free(kim_data->nshutdown);
    return 0;
    }
    int plat_kim_chip_disable(struct kim_data_s *kim_data)
    {
    gpio_direction_output(kim_data->nshutdown, 0);
    gpio_set_value(kim_data->nshutdown, 0);
    return 0;
    }

    struct ti_st_plat_data wilink_pdata = {
    .nshutdown_gpio = BT_EN,
    .dev_name = "/dev/ttyS1", /*Write node for bluetooth*/
    .flow_cntrl = 1,
    //baud_rate = 115200,
    .baud_rate = 3000000,
    .resume = plat_kim_resume,
    .suspend = plat_kim_suspend,
    .chip_disable = plat_kim_chip_disable,
    .chip_enable = plat_kim_chip_enable,
    // .irq = gpio_to_irq(MX6SL_PAD_EPDC_D6),
    };

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

    I have put debug prints inside chip_enable function and found out that it has not been called during any of the command (insmod st_drv.ko, uim&, insmod btwilink.ko). I'm guessing this might be the reason of device not getting detected.

    Thanks
    Brajesh

  • Hi Brajesh,

    After inserting the btwilink.ko module, do you see the hci0 interface (via "hciconfig -a" command)? If you see the hci0 interface, then please issue: "hciconfig hci0 up" command. This should set "install" to "1" and turn on BT.

    If you don't see the hci0 interface after insmod btwilink.ko, then this means that the driver probe is not called. This indicates some issue with the platform code.

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    Thanks. And You are right, I can't see any hci0 interface (via "hciconfig -a" command) after inserting btwilink.ko. And i have put debug prints in btwilink driver and have noticed that the driver probe function is not getting called which is the reason why hci0 interface has not generated.

    But when i just use hci tools as follows :

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

    root@DM365_IPNC:~# hciattach /dev/ttyS1 any
    Device setup complete
    root@DM365_IPNC:~# hciconfig -a
    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

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

    The above command generates hci0 interface showing UART interface which i think indicates that UART initialization, pin muxing are fine in board file. And may be UART pins also connected fine to board. What part of platform code do you see, can be issue here.

    And i also see there might be some issues with platform code, the following chip_enable function is not getting called.

    ---------------------------------------
    int plat_kim_chip_enable(struct kim_data_s *kim_data)
    {
    printk(KERN_DEBUG "INSIDE %s \n",__FUNCTION__);
    gpio_request(kim_data->nshutdown, "bt_enable");
    gpio_direction_output(kim_data->nshutdown, 0);
    gpio_set_value(kim_data->nshutdown, 0);
    // msleep(1);
    gpio_direction_output(kim_data->nshutdown, 1);
    gpio_set_value(kim_data->nshutdown, 1);
    gpio_free(kim_data->nshutdown);
    return 0;
    }
    int plat_kim_chip_disable(struct kim_data_s *kim_data)
    {
    gpio_direction_output(kim_data->nshutdown, 0);
    gpio_set_value(kim_data->nshutdown, 0);
    return 0;
    }

    struct ti_st_plat_data wilink_pdata = {
    .nshutdown_gpio = BT_EN,
    .dev_name = "/dev/ttyS1", /*Write node for bluetooth*/
    .flow_cntrl = 1,
    //baud_rate = 115200,
    .baud_rate = 3000000,
    .resume = plat_kim_resume,
    .suspend = plat_kim_suspend,
    .chip_disable = plat_kim_chip_disable,
    .chip_enable = plat_kim_chip_enable,
    // .irq = gpio_to_irq(MX6SL_PAD_EPDC_D6),
    };

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

    Can you please point out exactly where am i missing ? or is it a hardware issue ?

    Thanks

    Brajesh

  • Hi Brajesh,

    "hci0" is created by the hci_register_dev() call. In case of btwilink this is called during the "driver_probe" function. This is why when you insmod btwilink, hci0 is not created (because probe is not called).

    Can you confirm if "platform_driver_register" is getting called during btwilink insmod?

    I don't see any problem with any of the code snippet you have given. resume/suspend/chip_disable/chip_enable are all optional fields. st_kim_start() is the one that toggles BT_EN GPIO.

    Regards,
    Gigi Joseph.
  • Yes Joseph, insmod btwilink.ko , registers the driver successfully as i have put debug prints inside driver and can see it comes out of platform_driver_register function successfully. But nothing happens after that.
  • And also if chip_enable function is optional and doesn't need to be called then i don't think that there is anything wrong with the driver. Cause i can see the platform_driver_register function getting called and successfully exiting. Do you see anything else that can be reason behind this issue.
    Thanks
    Brajesh
  • Hi Brajesh,

    If platform_driver_register is getting called, then the corresponding probe should be called as well. If it does not, then you need to check your platform code...

    Regards,
    Gigi Joseph.
  • Ok but what exactly in platform code... ?? Can you be please precise
  • Hi Brajesh,

    This is not part of the TI release, but if I'm right, platform_driver_register() calls driver_attach(). And driver_attach() in turn calls driver_probe_device() - which will call the btwilink probe.

    Obviously, one of the things is not happening for you. The only way to find out is to check this path.

    Regards,
    Gigi Joseph.
  • "hciattach /dev/ttyS1 any" command generates hci0 uart interface that i think indicates that UART1 is initialized properly, right ?
  • Like I mentioned earlier, it means that the hci0 interface is created via hci_register_dev(). It does not mean that BT is On or UART is initialized. AFAIK, it does not send any command to the chip. So cannot confirm if UART is initialized.

    Regards,
    Gigi Joseph.
  • yes i understand and i appreciate your help on this. I'll check the path and will update you. Thanks for inputs. :)
  • Hi Joseph,

    I have checked and debug inside platform_driver_register() function. It goes till bus_for_each_dev() in driver_attach() function. But it doesn't call device_probe function still.
  • Hi Joseph,
    Following command response indicates that UART1 is properly initialized , right ?

    -------------------------------------------------------------------------------
    root@DM365_IPNC:~# cat /proc/tty/driver/serial
    serinfo:1.0 driver revision:
    0: uart:16550A mmio:0x01C20000 irq:40 tx:5320 rx:175 RTS|CTS|DTR|DSR
    1: uart:16550A mmio:0x01D06000 irq:41 tx:0 rx:0 RTS|CTS|DTR|DSR
    --------------------------------------------------------------------------------

    And following is part of platform init code.
    -------------------------------------------------------------------------------
    board-davinci_dm365_mcam.c

    davinci_cfg_reg(DM365_UART1_TXD);
    davinci_cfg_reg(DM365_UART1_RXD);
    davinci_cfg_reg(DM365_UART1_RTS);
    davinci_cfg_reg(DM365_UART1_CTS);
    davinci_cfg_reg(DM365_GPIO48);
    davinci_serial_init(&uart_config);
    platform_device_register(&mxc_bt_rfkill);
    dm365evm_emac_configure();

    & in dm365.c

    //MUX_CFG(DM365, I2C_SDA, 3, 23, 3, 2, false)
    //MUX_CFG(DM365, I2C_SCL, 3, 21, 3, 2, false) (Since I2C and UART1 are multiplexed)

    MUX_CFG(DM365, UART0_RXD, 3, 20, 1, 1, false)
    MUX_CFG(DM365, UART0_TXD, 3, 19, 1, 1, false)
    MUX_CFG(DM365, UART1_RXD, 3, 17, 3, 2, false)
    MUX_CFG(DM365, UART1_TXD, 3, 15, 3, 2, false)
    MUX_CFG(DM365, UART1_RTS, 3, 23, 3, 1, false)
    MUX_CFG(DM365, UART1_CTS, 3, 21, 3, 1, false)


    -------------------------------------------------------------------------------
    Please give your inputs on above code.

    Thanks
    Brajesh
  • Hi Joseph,

    I debugged into kernel and driver and have noticed that the following api in kernel (drivers/base/dd.c) gets called when btwlink.ko is inserted but it returns from driver_match_device(). Can you please give me some idea why so ?
    If it can go beyond this API, it'll go and invoke driver_probe_device() API for btwilink driver.

    -------------------------------------------------------------------------------------------------
    static int __driver_attach(struct device *dev, void *data)
    {
    struct device_driver *drv = data;

    pr_info("%s_entry\n",__func__);
    /*
    * Lock device and try to bind to it. We drop the error
    * here and always return 0, because we need to keep trying
    * to bind to devices and some drivers will return an error
    * simply if it didn't support the device.
    *
    * driver_probe_device() will spit a warning if there
    * is an error.
    */

    if (!driver_match_device(drv, dev))
    return 0; (btwilink.ko returns from here)

    if (dev->parent) /* Needed for USB */
    device_lock(dev->parent);
    device_lock(dev);
    pr_info("dev->driver:%x\n",dev->driver);
    if (!dev->driver)
    driver_probe_device(drv, dev);
    device_unlock(dev);
    if (dev->parent)
    device_unlock(dev->parent);

    pr_info("%s_exit\n",__func__);
    return 0;
    }
    -------------------------------------------------------------------------------------------------

    Can you give me some suggestions how shall i debug this issue?

    Thanks
    Brajesh
  • Hi Joseph,

    I debugged into kernel and driver and have noticed that the following api in kernel (drivers/base/dd.c) gets called when btwlink.ko is inserted but it returns from driver_match_device(). Can you please give me some idea why so ? 
    If it can go beyond this API, it'll go and invoke driver_probe_device() API for btwilink driver.

    -------------------------------------------------------------------------------------------------
    static int __driver_attach(struct device *dev, void *data)
    {
    struct device_driver *drv = data;

    pr_info("%s_entry\n",__func__);
    /*
    * Lock device and try to bind to it. We drop the error
    * here and always return 0, because we need to keep trying
    * to bind to devices and some drivers will return an error
    * simply if it didn't support the device.
    *
    * driver_probe_device() will spit a warning if there
    * is an error.
    */

    if (!driver_match_device(drv, dev))
    return 0; (btwilink.ko returns from here)

    if (dev->parent) /* Needed for USB */
    device_lock(dev->parent);
    device_lock(dev);
    pr_info("dev->driver:%x\n",dev->driver);
    if (!dev->driver)
    driver_probe_device(drv, dev);
    device_unlock(dev);
    if (dev->parent)
    device_unlock(dev->parent);

    pr_info("%s_exit\n",__func__);
    return 0;
    }
    -------------------------------------------------------------------------------------------------

    Can you give me some suggestions how shall i debug this issue?

    Thanks
    Brajesh

  • Hi Brajesh,

    Then it looks to me that you don't have the board file changes.

    struct ti_st_plat_data wilink_pdata = {
    .nshutdown_gpio = GPIO_TO_PIN(3, 21), /* default setting for AM335x EVM and SK */
    .dev_name = "/dev/ttyO1",
    .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 am335xevm_init_st_platform_data(void)
    {
    platform_device_register(&wl12xx_device);
    platform_device_register(&btwilink_device);
    }

    It is explained in: processors.wiki.ti.com/.../WL18xx_Platform_Integration_Guide

    Regards,
    Gigi Joseph.
  • Hi Joseph
    Thanks a lot, that hci0 interface is created and visible in "hciconfig -a" but without BD Address.
    Following are responses of commands :
    ---------------------------------------------------------------------------------------
    root@DM365_IPNC:~#insmod st_drv.ko
    root@DM365_IPNC:~#uim &
    root@DM365_IPNC:~#insmod btwilink.ko
    ---------------------------------------------------------------------------------------
    root@DM365_IPNC:~# hciconfig hci0 up
    [ 112.318244] Calling st_register
    [ 112.332880] (stc): st_register(0)
    [ 112.336158] (stc): chnl_id list empty :0 Calling st_kim_start
    [ 112.350789] (stk) : st_kim_start
    [ 112.358778] (stk) : Configuring gpio_no 48 to HIGH STATE Configuring gpio_no 48 to HIGH STATE
    [ 112.669482] (stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 1 from install

    uim:
    [ 112.680235] kref_get
    @ st_uart_config[ 112.683242] kref_get

    uim: signal re[ 112.686800] kref_get
    ceived, opening /dev/ttyS1
    uim:@ set_baud_r[ 112.719707] (stc): st_tty_open ate
    uim:set_bau
    [ 112.723668] (stk) : line discipline installed d_rate() done
    uim:Installed N_TI_WL Line displine
    uim:begin polling...

    [ 113.528801] (stk) : waiting for ver info- timed out
    [ 113.538749] (stk) :kim: failed to read local ver
    [ 113.543424] (stk) :download firmware failed
    [ 113.563557] (stk) :ldisc_install = 0uim:poll broke due to event 10(P
    [ 113.569730] (stk) : Configuring gpio_no 48 to HIGH STATERI:2/ERR:8)

    u Configuring gpio_no 48 to HIGH STATE
    im:read 0 from install

    uim:@ st_uart_config
    uim:Un-Installed N_TI_WL Line displine
    uim:begin polling...
    [ 113.865613] (stk) :ldisc_install = 1uim:poll broke due to event 10(P
    [ 113.883712] kref_get
    RI:2/ERR:8)

    u[ 113.887054] kref_get
    im:read 1 from install

    uim:@ st_uart_config
    uim: signal received, opening /dev/ttyS1
    [ 113.911737] kref_get
    uim:@ set_baud_rate
    uim: Can't get port settings
    uim:set_baudrate() failed
    uim:begin polling...
    [ 114.888929] (stk) :line disc installation timed out
    [ 114.898805] (stk) :ldisc_install = 0uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 0 from install

    uim:@
    [ 114.908776] (stk) : Configuring gpio_no 48 to HIGH STATE st_uart_config
    uim:Un-Installed N_TI_WL Line d Configuring gpio_no 48 to HIGH STATE
    ispline
    uim:begin polling...
    [ 115.226171] (stk) :ldisc_install = 1uim:poll broke due to event 10(P
    [ 115.239767] kref_get
    RI:2/ERR:8)

    u[ 115.242893] kref_get
    im:read 1 from install

    uim:@ st_uart_config
    uim: signal received, opening /dev/ttyS1
    [ 115.257252] kref_get
    uim:@ set_baud_rate
    uim: Can't get port settings
    uim:set_baudrate() failed
    uim:begin polling...
    [ 116.238760] (stk) :line disc installation timed out
    [ 116.245812] (stk) :ldisc_install = 0uim:poll broke d
    [ 116.255307] (stk) : Configuring gpio_no 48 to HIGH STATEue 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...
    Configuring gpio_no 48 to HIGH STATE
    [ 116.583768] (stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 1 from
    [ 116.594666] kref_get
    install

    uim:[ 116.597270] kref_get
    @ st_uart_config
    uim: signal received, opening /dev/ttyS1
    [ 116.606212] kref_get
    uim:@ set_baud_rate
    uim: Can't get port settings
    uim:set_baudrate() failed
    uim:begin polling...
    [ 117.598765] (stk) :line disc installation timed out
    [ 117.606888] (stk) :ldisc_install = 0uim:poll broke d
    [ 117.625472] (stk) : Configuring gpio_no 48 to HIGH STATEue 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...
    Configuring gpio_no 48 to HIGH STATE
    [ 117.909927] (stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 1 from
    [ 117.920330] kref_get
    install

    uim:[ 117.922931] kref_get
    @ st_uart_config
    uim: signal received, opening /dev/ttyS1
    [ 117.931720] kref_get
    uim:@ set_baud_rate
    uim: Can't get port settings
    uim:set_baudrate() failed
    uim:begin polling...
    [ 118.918780] (stk) :line disc installation timed out
    [ 118.928754] (stk) :ldisc_install = 0uim:poll broke d
    [ 118.933580] (stk) : Configuring gpio_no 48 to HIGH STATEue to event 10(PRI:2/ERR:8)

    uim:read 0 from install

    uim:@ st_uart_config
    uim:Un-Installed N_TI_WL Line d Configuring gpio_no 48 to HIGH STATE
    ispline
    uim:begin polling...
    [ 119.205402] (stk) :ldisc_install = 1uim:poll broke due to event 10(P
    [ 119.213091] kref_get
    RI:2/ERR:8)

    u[ 119.216441] kref_get
    im:read 1 from install

    uim:@ st_uart_config
    uim: signal received, opening /dev/ttyS1
    [ 119.228802] kref_get
    uim:@ set_baud_rate
    uim: Can't get port settings
    uim:set_baudrate() failed
    uim:begin polling...
    [ 120.218773] (stk) :line disc installation timed out
    [ 120.223616] (stk) :ldisc_install = 0uim:poll broke d
    [ 120.236394] ti_st_open: failed to get ST write func pointer
    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[ 120.253520] Unable to handle kernel NULL pointer dereference at virtual address 00000018
    in polling...
    [ 120.271023] pgd = c6d28000
    [ 120.278786] [00000018] *pgd=00000000
    [ 120.282432] Internal error: Oops: 5 [#1] PREEMPT
    [ 120.287072] last sysfs file: /sys/devices/platform/kim/install
    [ 120.292926] Modules linked in: btwilink st_drv version_ctrl ppp_deflate ppp_generic netconsole slhc tun loop usbmon iscsi_tcp libiscsi_tcp m
    [ 120.315860] CPU: 0 Not tainted (2.6.37_IPNC_DM365_5.1.0+ #42)
    [ 120.321994] pc : [<bf0975dc>] lr : [<bf0983b8>] psr: a0000013
    [ 120.322021] sp : c7b71e48 ip : c7b71e30 fp : c7b71e6c
    [ 120.333515] r10: 00000000 r9 : c7b70000 r8 : c6d20400
    [ 120.338765] r7 : c7b7cc00 r6 : c6d08380 r5 : 00000000 r4 : ffffffea
    [ 120.345317] r3 : c7be9180 r2 : 00000000 r1 : 00000000 r0 : c7bc8c00
    [ 120.351875] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
    [ 120.359039] Control: 0005317f Table: 86d28000 DAC: 00000015
    [ 120.364810] Process hciconfig (pid: 4030, stack limit = 0xc7b70270)
    [ 120.371102] Stack: (0xc7b71e48 to 0xc7b72000)
    [ 120.375505] 1e40: c03be300 c7be9180 ffffffea 00000000 c6d08380 c7b7cc00
    [ 120.383740] 1e60: c7b71e8c c7b71e70 bf0a03e4 bf0975c0 c7b7cc00 400448c9 c7b7ce24 c7a42180
    [ 120.391974] 1e80: c7b71eac c7b71e90 c0379dd0 bf0a02f0 c004c860 400448c9 400448c9 00000000
    [ 120.400209] 1ea0: c7b71eec c7b71eb0 c037f41c c0379d2c c0061cc0 c0453e84 bef0cf34 c7b71fb0
    [ 120.408440] 1ec0: 80000005 400ff5b4 00000000 00000003 400448c9 00000000 c7a42180 00000000
    [ 120.416673] 1ee0: c7b71f0c c7b71ef0 c02cc95c c037f354 c7b71fac 00000003 c7a42180 400448c9
    [ 120.424907] 1f00: c7b71f7c c7b71f10 c00b1a08 c02cc75c c7b71f38 c7b71f2c c7b71f64 c7b71f28
    [ 120.433140] 1f20: c02cdccc c00a4238 c7486580 00000000 00000000 c042c70d c78063c0 c749d180
    [ 120.441371] 1f40: 00000000 00000003 400fdfb4 00000119 c002e1a4 00000003 00000000 400448c9
    [ 120.449605] 1f60: c7a42180 c002e1a4 c7b70000 00000000 c7b71fa4 c7b71f80 c00b1ab8 c00b14a8
    [ 120.457837] 1f80: c02ce7dc 00000000 4011c83c bef0cf34 400fdfb4 00000036 00000000 c7b71fa8
    [ 120.466071] 1fa0: c002e020 c00b1a88 4011c83c bef0cf34 00000003 400448c9 00000000 4012f17c
    [ 120.474303] 1fc0: 4011c83c bef0cf34 400fdfb4 00000036 00000000 00000000 401e2000 bef0cca4
    [ 120.482533] 1fe0: 00000000 bef0cc78 400ff5f4 4029eb0c 60000010 00000003 00000000 00000000
    [ 120.490729] Backtrace:
    [ 120.493201] Function entered at [<bf0975b0>] from [<bf0a03e4>]
    [ 120.499057] r7:c7b7cc00 r6:c6d08380 r5:00000000 r4:ffffffea
    [ 120.504785] Function entered at [<bf0a02e0>] from [<c0379dd0>]
    [ 120.510636] r7:c7a42180 r6:c7b7ce24 r5:400448c9 r4:c7b7cc00
    [ 120.516361] Function entered at [<c0379d1c>] from [<c037f41c>]
    [ 120.522211] r6:00000000 r5:400448c9 r4:400448c9
    [ 120.526881] Function entered at [<c037f344>] from [<c02cc95c>]
    [ 120.532731] r8:00000000 r7:c7a42180 r6:00000000 r5:400448c9 r4:00000003
    [ 120.539513] Function entered at [<c02cc74c>] from [<c00b1a08>]
    [ 120.545365] r6:400448c9 r5:c7a42180 r4:00000003
    [ 120.550031] Function entered at [<c00b1498>] from [<c00b1ab8>]
    [ 120.555884] Function entered at [<c00b1a78>] from [<c002e020>]
    [ 120.561735] r7:00000036 r6:400fdfb4 r5:bef0cf34 r4:4011c83c
    [ 120.567485] Code: eb00036d e51b3020 e3530000 0a000002 (e5d53018)
    [ 120.928066] ---[ end trace a86845181cd56360 ]---
    Segmentation fault
    -----------------------------------------------------------

    Can you please suggest your valuable inputs for above errors.

    Thanks
    Brajesh
  • Hi Brajesh,

    The below lines:

    [ 113.528801] (stk) : waiting for ver info- timed out
    [ 113.538749] (stk) :kim: failed to read local ver
    [ 113.543424] (stk) :download firmware failed

    indicates that the driver is not able to get a response from the wl18xx chipset. This usually means some problem with the UART communication. Please also confirm the boot up sequence as given in: processors.wiki.ti.com/.../WL18xx_Module_Schematic_Checklist

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    As you suggested that the issue might be the BT_EN toggling. And as i probed the pin, found out that BT_EN is not toggling when i give command "hciconfig hci0 up". Earlier i had gpio configurations (gpio_request & gpio_direction_output) in board file while gpio toggling was in (st_kim.c)., which i thought could be a problem so i shifted gpio configurations (gpio_request & gpio_direction_output) in driver itself when i toggle the gpio which is as follows.

    ------------------------------------------------------------------------------------------
    /* Configure BT nShutdown to HIGH state */
    if (gpio_request(kim_gdata->nshutdown, "bt_enable") ||

    gpio_direction_output(kim_gdata->nshutdown, 0))

    pr_err("Error initializing the BT wl12xx enable gpio\n");

    pr_err(" Configuring gpio_no %ld to HIGH STATE", kim_gdata->nshutdown);//brajesh
    printk(" Configuring gpio_no %ld to HIGH STATE\n", kim_gdata->nshutdown);//brajesh

    gpio_set_value(kim_gdata->nshutdown, GPIO_LOW);
    mdelay(2000); /* FIXME: a proper toggle */
    gpio_set_value(kim_gdata->nshutdown, GPIO_HIGH);
    mdelay(1000);

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

    But earlier gpio configurations was not failing but when i shifted it in driver(st_kim.c), it is giving error when given command "hciconfig hci0 up". The error is as follows :
    "Error initializing the BT wl12xx enable gpio"

    Shall i go back configuring gpio in board file and toggling in driver which gave the error i showed you in previous post ? or shall i stick with this one ?
    And about UART communication, i'll probe UART lines whether there is any issue and will update you.

    Thanks
    Joseph
  • Hi Joseph,

    I got the issue of GPIO_BT_EN solved now. That pin was driven low all the time due to other reasons. Now only problem that i see is UART Communication.

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

    root@DM365_IPNC:~# hciconfig hci0 up
    [ 112.318244] Calling st_register
    [ 112.332880] (stc): st_register(0) 
    [ 112.336158] (stc): chnl_id list empty :0 Calling st_kim_start
    [ 112.350789] (stk) : st_kim_start
    [ 112.358778] (stk) : Configuring gpio_no 48 to HIGH STATE Configuring gpio_no 48 to HIGH STATE
    [ 112.669482] (stk) :ldisc_install = 1uim:poll broke due to event 10(PRI:2/ERR:8)

    uim:read 1 from install 

    uim:
    [ 112.680235] kref_get
    @ st_uart_config[ 112.683242] kref_get

    uim: signal re[ 112.686800] kref_get
    ceived, opening /dev/ttyS1
    uim:@ set_baud_r[ 112.719707] (stc): st_tty_open ate
    uim:set_bau
    [ 112.723668] (stk) : line discipline installed d_rate() done
    uim:Installed N_TI_WL Line displine
    uim:begin polling...

    [ 113.528801] (stk) : waiting for ver info- timed out 
    [ 113.538749] (stk) :kim: failed to read local ver
    [ 113.543424] (stk) :download firmware failed
    [ 113.563557] (stk) :ldisc_install = 0uim:poll broke due to event 10(P
    [ 113.569730] (stk) : Configuring gpio_no 48 to HIGH STATERI:2/ERR:8)

    u Configuring gpio_no 48 to HIGH STATE
    im:read 0 from install 

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

    & after some time segmentation Fault.


    Now i guess there are some issues with UART lines (RTS/CTS). I'll check it and update you. Can you share proper initialization of UART lines in board file ?

    Thanks

    Brajesh Sharma

  • Hi Brajesh,

    On the AM335x, it is as below:

    static struct pinmux_config uart1_wl12xx_pin_mux[] = {
    {"uart1_ctsn.uart1_ctsn", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT},
    {"uart1_rtsn.uart1_rtsn", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
    {"uart1_rxd.uart1_rxd", OMAP_MUX_MODE0 | AM33XX_PIN_INPUT_PULLUP},
    {"uart1_txd.uart1_txd", OMAP_MUX_MODE0 | AM33XX_PULL_ENBL},
    {NULL, 0},

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    I have checked UART1 configurations. It's a bit different than that of AM3xx that you shared but i can't see anything wrong in it. And now when i probe RTS and CTS lines ... both are as expected low to allow proper UART communication. 

    And also when i probe TX/RX lines of DM365 both are continuously high which indicates there is not transaction happening. But when i check following command, it shows there has been some transaction.

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

    root@DM365_IPNC:~# cat /proc/tty/driver/serial
    serinfo:1.0 driver revision:
    0: uart:16550A mmio:0x01C20000 irq:40 tx:7851 rx:175 RTS|CTS|DTR|DSR
    1: uart:16550A mmio:0x01D06000 irq:41 tx:12 rx:11 fe:1 RTS|CTS|DTR|DSR

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

    I'v recently corrected the enum field for pin muxing by removing I2C pins from enum to maintain same sequence but still it didn't help much.

    Can you please suggest something to me on this ?

    Thanks

    Brajesh

  • Hi Joseph,

    I'm stuck at UART communication debugging. After UART configurations and pin muxing, the error is same "Reading Info ver timed out.... download firmware failed". Though when i echo some pattern to that ttyS1, i don't get the exact pattern on the bus when i probe it. Even echoing "00" to ttyS1 shows some non zero pattern on scope on TX line, which clearly is the reason of "download firmware failed" error. Can you please give me some inputs on this how can i debug this issue of UART ?

    Thanks

    Brajesh

  • Hi Brajesh,

    For UART issues, please raise a query on the DM3xx forum.

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    I have posted the issue on forum. But i doubt if it is lonely UART issue. Cause when i do echo to ttyS1, i get some data on bus. But when i do command "hciconfig hci0 up" which ends saying
    "[ 94.721065] (stk) : waiting for ver info- timed out
    [ 94.730238] (stk) :kim: failed to read local ver
    [ 94.741052] (stk) :download firmware failed"
    , nothing comes on TX of DM365, which meant DM365 didn't even start the UART transaction. So we can't expect wilink device to respond.
    Now can it be just UART issue which shows in TX data when given echo "pattern" command, but doesn't show anything while getting interface up ?
    Can you please give you comments on this ?

    Thanks
    Brajesh
  • Hi Brajesh,

    Since you are sure that BT_EN is up, and you have confirmed the power up sequence is as per: processors.wiki.ti.com/.../WL18xx_Module_Schematic_Checklist the only possible issue is with UART communication.

    Regards,
    Gigi Joseph.
  • Hi Joseph,
    Thanks for replying. And yes i have confirmed both things. But my doubt is that with the same UART configurations, echoing ttyS1 shows data on TX bus while hciconfig hci0 up doesn't show anything ?
  • Hi Joseph,

    I have a query regarding HCI_UART_RTS/CTS signal. According to datasheet of WL12xx/18xx device, the valid UART transacation is done when RTS is pulled low. As shown in attachment. And according to that I can see in scope that my RTS/CTS signals are low all the time.. is that alright ? are those pins need to be high ?

    Cause in other setup that we have with WL1273, i can see the RTS/CTS lines high when the device is scanning mode(means uart transaction happening) , i can;t figure out this when it is mentioned in datasheet of 1273L that transamission needs to stop when RTS/CTS are high. 

    Can you please guide me on this ?

    Thanks

    Brajesh

  • Hi Joseph,

    I have posted my querry in Davinci forum but no one seems to reply over there "e2e.ti.com/.../416349". Can you please help me out on this ?

    Thanks
    Brajesh
  • Hi Gigi,

    I'v finally moved on a bit and 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,

    I believe this is same as: e2e.ti.com/.../417014 . If so, please close this. We will track it on the other thread.

    Regards,
    Gigi Joseph.