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.

Linux/DRA744: Bluetooth bringup on dra74xx interfacing with wl1837

Part Number: DRA744
Other Parts Discussed in Thread: WL1837,

Tool/software: Linux

Hi,

I am able to bring up WiFi on dra744 interfacing with wl1837 (NF3108).

I am using processor SDK.

For Bluetooth, I did following changes,

1. On dts file (configure the UART3 and BT_EN pin)
---------------------------------------------------
&uart3 {  
    pinctrl-names = "default";  
    pinctrl-0 = <
        0x248   (PIN_INPUT | MUX_MODE0)  /* uart3_Rx */
        0x24c   (PIN_OUTPUT | MUX_MODE0) /* uart3_Tx */
        0x338   (PIN_INPUT  | MUX_MODE1) /* uart3_CTS */
        0x3cc   (PIN_OUTPUT | MUX_MODE1) /* uart3_RTS */
    >;  
    status = "okay";  
    fsl,uart-has-rtscts;

    gpio = <&gpio5 4 0>;    /* BT Enable : BT_EN */
    startup-delay-us = <70000>;
    enable-active-high;
};

2. After boot up, run the following script to create a port :
---------------------------------------------------------------------------
    echo <bt_en> /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio<bt_en>/direction
    echo 0 > /sys/class/gpio/gpio<bt_en>/value
    echo 1 > /sys/class/gpio/gpio<bt_en>/value
    gpio="nshutdown_gpio=16"
    tty="tty=/dev/ttyS2"
    flow="flow_cntrl=1"
    baud_rate="baud_rate=3000000"
    mkdir /home/root/tibt
    echo $gpio > /home/root/tibt/config
    echo $tty >> /home/root/tibt/config
    echo $flow >> /home/root/tibt/config
    echo $baud_rate >> /home/root/tibt/config

3. Attach the ttyS2
---------------------
    hciattach /dev/ttyS2 any 3000000
    
    got the following logs,
    [  197.406076] Bluetooth: HCI UART driver ver 2.3
    [  197.410722] Bluetooth: HCI UART protocol H4 registered
    [  197.416376] Bluetooth: HCI UART protocol BCSP registered
    [  197.421791] Bluetooth: HCI UART protocol LL registered
    [  197.427077] Bluetooth: HCI UART protocol Three-wire (H5) registered
    [  197.555125] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
    [  197.560650] Bluetooth: BNEP filters: protocol multicast
    [  197.566320] Bluetooth: BNEP socket layer initialized
    [  199.463449] Bluetooth: hci0 command 0x1003 tx timeout
    [  201.463452] Bluetooth: hci0 command 0x1001 tx timeout
    [  203.463447] Bluetooth: hci0 command 0x1009 tx timeout

    root@dra7xx-evm:~/uart# 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:12 acl:0 sco:0 commands:3 errors:0

When i run the following command getting error,

root@dra7xx-evm:~/uart# hcitool scan
Device is not available: No such device
root@dra7xx-evm:~/uart# hcitool lescan                                                                                                         
Set scan parameters failed: File descriptor in bad state

I have checked the BT_EN pin with scope and its got getting enabled.
I have enabled BT_EN pin manually.

Please help us with where I did wrong.

Thanks,
Lal









  • You, may check couple of things -
    a) With, hciattach you need to specify the controller type.
    hciattach /dev/ttyS2 texas 3000000

    b) Ensure that the tty number and GPIO is matching with the UART port and GPIO wired to the WL18xx BT port.

    Thanks
  • Hi,

    Thanks for the reply,

    a)hciattach /dev/ttyS2 texas 3000000

    Return timeout error.

    b) I have re-checked the tty number.

    I struck here,. I did pin-mux changes in dts file for uart3 along with bt_en pin (mentioned the dts file changes above).

    After boot up, BT_EN pin is not configured, validated by reading the bt_en pin registers.

    Please help me and guide me to configure the tty port (bt_en and Uart3 pins).

    Thanks,

    Lal

  • HI,

    I did following experiment ,

    1.Attach serial port for texas
    		root@dra7xx-evm:~# hciattach /dev/ttyS2 texas 115200
    		Wanted to write 4 bytes, could only write 0. Stop
    		Can't initialize device: Success
    
    	2.UART3 Register values
    		root@dra7xx-evm:~# ./omapconf read 0x48020018  //UART_MDR1
    		00000030
    		root@dra7xx-evm:~# ./omapconf read 0x48020010  //UART_MSR
    		00000003
    		root@dra7xx-evm:~# ./omapconf read 0x48020000  //UART_DLL
    		0000001D
    		root@dra7xx-evm:~# ./omapconf read 0x48020004  //UART_DLH
    		0000000D
    		root@dra7xx-evm:~# ./omapconf read 0x4802000C  //UART_LCR
    		00000013
    	3.Following fuction and files are get called
    		hci_uart_tty_ioctl() : drivers/bluetooth/hci_ldisc.c
    		hci_uart_tty_write() : drivers/bluetooth/hci_ldisc.c
    	4.Scan function
    		root@dra7xx-evm:~# hcitool scan
    		Device is not available: No such device
    UART3 registers are getting configured, But I am unable to scan the BT devices.

    I dont have any clue, how to proceed further.
    Please guide us.

    Thanks,
    Lal Bosco

  • Hi Lal,

    Since, you seem to have basic UART connection issue with the device, i would suggest probing the UART lines between the host and the controller. You may use a scope. Initially it starts with 115200 baud to read controller type and version to download the firmware..
    You can also connecting BT logger to BT_UART_DBG pin..
    Please, check below -
    www.ti.com/.../swru437.pdf
    www.ti.com/.../WILINK-BT_WIFI-WIRELESS_TOOLS

    Thanks
  • Hi,
    Thanks for your reply.
    I have checked the UART pins with Oscilloscope and it not probing.
    and I found that there is a problem with UART pin-mux.
    I am continue to debug that issue and Thanks for your help.

    Thanks,
    lal Bosco