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/PROCESSOR-SDK-AM335X: WL18xx TI Bluetooth Stack PANM Demo App

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: TMDXEVM3358, WL1837MOD, WL1835MODCOM8B, WL1837, WL1835, TI-BT-4-2-STACK-LINUX-ADDON

Tool/software: Linux

Our customer is trying the following demos.

http://processors.wiki.ti.com/index.php/WL18xx_TI_Bluetooth_Stack_PANM_Demo_App

But they may encounter errors after communicating large amounts of data.

The demo requires a patch for AM335x, but the patch is currently not available for download.

http://processors.wiki.ti.com/index.php/WL18xx_TI_Bluetooth_Stack_PANM_Demo_App#Running_the_Bluetooth_Code

The customer's HW and SW environments are as follows:

HW: TMDXEVM3358 + WL1837MOD

SW: TI-SDK  ti-processor-sdk-linux-am335x-evm-04.01.00.06
 Bluetopia AM335xBluetopiaLinuxProduction-4.2.1.0.1.0
 BT-SP  TIInit_11.8.32.bts

For the latest Processor SDK (PROCESSOR-SDK-LINUX-AM335X  04_01_00_06),

http://software-dl.ti.com/processor-sdk-linux/esd/AM335X/latest/index_FDS.html

Are these SW combinations valid?

Is the above patch required?

The same patch seems to be able to download below, but it is not required for a newer SDKs.

http://processors.wiki.ti.com/index.php/WL18xx_Platform_Integration_Guide#UART_Initialization

Best regards,

Daisuke

  • Daisuke-san,

    The UART patch mentioned above was applicable to the ti-processor-sdk-linux-am335x-evm-01.00.00.00 (linux-3.14.26). To best of my knowledge, this patch should not be needed for the latest kernel in the ti-processor-sdk-linux-am335x-evm-04.01.00.06. but if the issue still exists please try the following.

    Modify the following line in the serial_omap_set_termios() function of the {kernel}/drivers/tty/serial/omap-serial.c file

            if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW) {
    

    change to : 

     if (termios->c_cflag & CRTSCTS) {

    Then, recompile the zImage as instructed on the wiki : processors.wiki.ti.com/.../WL18xx_TI_Bluetooth_Stack_PANM_Demo_App

    Moreover, the HW and SW combination is valid. Please refer to the following wiki for instructions on getting started with the Bluetopia-AM335xBluetopiaLinuxProduction-4.2.1.0.1.0 add-on.

    Best regards,

    Vihang

  • Vihang San

    My name is Masaya kikuchi.

    Thanks advaice. 

    I tried but it did not improve.

    We have 3 questions.

    Q1 (1) modify is collect ?
    Q2 (2) We use AM335x EVM and WL1835MODCOM8B and WL1837MODCOM8B.
           GPIO pin and BTS script is collect ?

    Q3 (3) is Error occurrence sitiuation. (WL1837 also Same error)
           (BT communication is hanged up. (ping is also))

           Is there a possibility that this situation will occur if hardware flow control does not work?

    P.S.
           It looks like Bluetooth Firmware is hanged up. Because we can recoved
           LinuxPANM command (WL1835MODCOM8B Power ON->OFF->ON and all init procedure.) without reboot Linux.

    (1) TI-SDK  ti-processor-sdk-linux-am335x-evm-04.01.00.06 omap-serial driver is
          drivers/tty/serial/8250/8250_omap.c  (  drivers/tty/serial/omap-serial.c is not use)
          So We modify  drivers/tty/serial/8250/8250_omap.c (line 450)  changed as follows.
                    if (termios->c_cflag & CRTSCTS) {
     
    Q1       Is this the correct fix?

    (2) Vnet & ./LinuxPANM message
          # ./driver/VNETInst/Kernel_2_6/VNETMInst.sh start
          Installing SS1 Virtual Network Driver: [  124.192444] printk
         NumberOfDevices 1
         [  124.203751] Allocate Memory for 1
         [  124.207135] Return Allocate Memory for 1  Ptr edb13800
         [  124.212317] alloc_chrdev_region returned 0
         [  124.235524] VNETCharacterDeviceMajorNumber returned 243 0
         Driver started and devices entries refreshed.

         # ./LinuxPANM

            PANM>1 1

            BTPM_Initialize() Success: 0.
            DEVM_RegisterEventCallback() Success: 5.
            PANM>9 1

            echo 117 > /sys/class/gpio/export
            sh: line 0: echo: write error: Device or resource busy
            echo out > /sys/class/gpio/gpio117/direction
            echo 0 > /sys/class/gpio/gpio117/value
            echo 1 > /sys/class/gpio/gpio117/value
            echo 0 > /sys/class/gpio/gpio117/value
            echo 1 > /sys/class/gpio/gpio117/value
            BT COMM PORT (/dev/ttyS1): 1
            Changing HCI baud rate to 3000000
                  [  174.844178] 8250_omap: CRTSCTS
            Status: Executing BTS Script /lib/firmware/TIInit_11.8.32.bts.
            Status: BTS Script successfully executed.
            DEVM_PowerOnDevice() Success: 0.
         
    Q2  We use AM335x EVM and WL1835MODCOM8B.
            GPIO pin and BTS script is collect ?

             PANM>
             Device Powered On.
             PANM>  RegisterAuthentication

             DEVM_RegisterAuthentication() Success: 5.
             PANM>PANRegisterEventCallback

             Attempting to Register for Events.
             PANM_Register_Event_Callback() Success. Callback ID: 1.
             PANM>ConnectRemoteServer 001bdc0dbbe5 1 1 0x3

              Attempting to Open Remote Server.
              PANM_Connect_Remote_Device() Success: 0.
              PANM>
              Remote Device Properties Changed.
              BD_ADDR:       001BDC0DBBE5
              Device Flags:  0x800000CD
              Connect State: TRUE
              PANM>
              Remote Device Properties Changed.
              BD_ADDR:       001BDC0DBBE5
              Device Flags:  0x800000DD
              Encrypt State: TRUE
              PANM>
              PANM: Connection Status
              BD_ADDR     : 001BDC0DBBE5
              Service Type: PAN User
              Status      : 5

              PANM>

               CTRL-Z
               # ifconfig ss1vnet0 169.254.2.171 netmask 255.255.0.0
               # ping 169.254.2.170
               PING 169.254.2.170 (169.254.2.170): 56 data bytes
               64 bytes from 169.254.2.170: seq=26 ttl=128 time=28.125 ms
               64 bytes from 169.254.2.170: seq=27 ttl=128 time=19.863 ms
               64 bytes from 169.254.2.170: seq=28 ttl=128 time=25.179 ms
               64 bytes from 169.254.2.170: seq=29 ttl=128 time=11.893 ms
               64 bytes from 169.254.2.170: seq=30 ttl=128 time=16.256 ms
               64 bytes from 169.254.2.170: seq=31 ttl=128 time=17.002 ms
               64 bytes from 169.254.2.170: seq=32 ttl=128 time=47.408 ms
               64 bytes from 169.254.2.170: seq=33 ttl=128 time=30.631 ms
               64 bytes from 169.254.2.170: seq=34 ttl=128 time=9.469 ms
              
               ping and low load is work.

    (3)     large amounts of data error
     iperf3 is typcal TCP/IP bench soft.

               # iperf3 -s
               -----------------------------------------------------------
              Server listening on 5201
              -----------------------------------------------------------
             Accepted connection from 169.254.2.170, port 49651
             [  5] local 169.254.2.171 port 5201 connected to 169.254.2.170 port 49652
            [ ID] Interval           Transfer     Bandwidth
            [  5]   0.00-1.00   sec  92.8 KBytes   760 Kbits/sec
            [  5]   1.00-2.00   sec   174 KBytes  1.42 Mbits/sec
            [  5]   2.00-3.00   sec   179 KBytes  1.46 Mbits/sec
            [  5]   3.00-4.00   sec   177 KBytes  1.45 Mbits/sec
            [  5]   4.00-5.00   sec   174 KBytes  1.43 Mbits/sec
            [  5]   5.00-6.00   sec   170 KBytes  1.39 Mbits/sec
            [  5]   6.00-7.00   sec   170 KBytes  1.39 Mbits/sec
            [  5]   7.00-8.00   sec   171 KBytes  1.40 Mbits/sec
            [  5]   8.00-9.00   sec   181 KBytes  1.49 Mbits/sec
            [  5]   9.00-10.00  sec   171 KBytes  1.40 Mbits/sec
            [  5]  10.00-11.00  sec   166 KBytes  1.36 Mbits/sec
            [  5]  11.00-12.00  sec   166 KBytes  1.36 Mbits/sec
            [  5]  12.00-13.00  sec   174 KBytes  1.42 Mbits/sec
            [  5]  13.00-14.27  sec   100 KBytes   644 Kbits/sec
            [  5]  14.27-15.00  sec  16.8 KBytes   189 Kbits/sec
            [  5]  15.00-16.00  sec   166 KBytes  1.36 Mbits/sec
            [  5]  16.00-17.00  sec   165 KBytes  1.35 Mbits/sec
            [  5]  17.00-18.00  sec   169 KBytes  1.38 Mbits/sec
            [  5]  18.00-19.00  sec   158 KBytes  1.30 Mbits/sec
            [  5]  19.00-20.00  sec   177 KBytes  1.45 Mbits/sec
            [  5]  20.00-21.00  sec   179 KBytes  1.47 Mbits/sec
            [  5]  21.00-22.00  sec   179 KBytes  1.46 Mbits/sec
            [  5]  22.00-23.38  sec  86.4 KBytes   512 Kbits/sec
            [  5]  23.38-24.00  sec  46.0 KBytes   609 Kbits/sec
            [  5]  24.00-25.00  sec  15.5 KBytes   127 Kbits/sec

    Q3 BT communication is hanged up here. (ping is also)

            [  5]  25.00-26.00  sec  0.00 Bytes  0.00 bits/sec
            [  5]  26.00-27.00  sec  0.00 Bytes  0.00 bits/sec
            [  5]  27.00-28.00  sec  0.00 Bytes  0.00 bits/sec
            [  5]  28.00-29.00  sec  0.00 Bytes  0.00 bits/sec
            [  5]  29.00-30.00  sec  0.00 Bytes  0.00 bits/sec
            [  5]  30.00-31.00  sec  0.00 Bytes  0.00 bits/sec
            [  5]  31.00-32.00  sec  0.00 Bytes  0.00 bits/sec
            [  5]  32.00-32.92  sec  0.00 Bytes  0.00 bits/sec
             - - - - - - - - - - - - - - - - - - - - - - - - -
            [ ID] Interval           Transfer     Bandwidth
            [  5]   0.00-32.92  sec  0.00 Bytes  0.00 bits/sec                  sender
            [  5]   0.00-32.92  sec  3.54 MBytes   902 Kbits/sec                  receiver
            iperf3: interrupt - the server has terminated

     # ping 169.254.2.170
            PING 169.254.2.170 (169.254.2.170): 56 data bytes

            --- 169.254.2.170 ping statistics ---
            3 packets transmitted, 0 packets received, 100% packet loss

    Best regards and Happy Holidays!

    Masaya Kikuchi

  • Masaya-san,

    Thanks for the update. If you suspect that the Bluetooth is crashing, we take a look at the BT FW logs.
    www.ti.com/.../swau058

    Additionally, if you have a Bluetooth sniffer (i.e. frontline or ellisys), the sniffer logs in conjunction with the BT FW logs will be helpful as well.

    Best regards,
    Vihang
  • Vihang-san

    Thank you for your response. 

    We got data with the suggested Logger application. (Measurement conditions are same as last time)

    H/W TMDXEVM3358 + WL1835MODCOM8B(BT-DBG port)

        Line 1-10228 Preconfiguration and Bluetooth session establishment.

        Line 10299 Start TCP Bench mark test.

        Line 12283 TCP benchmark software communication error occurred (simultaneous ping communication became impossible at the same time)

        Line 24687 WL1835 device power off ( No reboot linux)

        Line 24689  WL1835 device power on

        Line 24693  prepare and establish BT connection.

    > Additionally, if you have a Bluetooth sniffer (i.e. frontline or ellisys), the sniffer logs in conjunction with the BT FW logs will be helpful as well.

    We are sorry, we do not have a Bluetooth sniffer, so we can not monitor it.

    Please check the attached log file.
    Best regards,
    kikuchi



    20180109_PowerOn_to_login_PAN_stop.zip





  • Vihang-san.


    I am sorry.
    I made a mistake in setting the log tool. (ili setting) So. 

    21:29:52 - 21:29:57  Linux kernel booting

    21:31:47 - 21:31:58  PANM>SetDevicePower 1 ( TIInit_11.8.32.bts. )

    21:32:38 - 21:32:40  PANM>ConnectRemoteServer 001bdc0dbbe5 1 1 0x3

    21:35:00                    TCP Benchmark Soft (Heavy load to 3Mbps BT line)

    21:35:10                    IP hung up detect. ( No response TCP & ICMP) 

    Please check the attached log file.
    Best regards,
    kikuchi

    20180130_BTPAN_stopped.zip

  • Hi Kikuchi-san,

    According to the BT Logger traces, the controller stays active maintaining the connection throughout the capture. So it does not look like it is a firmware issue. It looks more like something crashes on the host MPU side.

    Best regards,
    Vihang
  • Hi Vihang-san,

    Thank you for your reply.

    For more support to this issue related to the TI Bluetooth Stack and the demos on Linux, should we post to the Sitara forum rather than here?

    TI-BT-4-2-STACK-LINUX-ADDON
    http://www.ti.com/tool/ti-bt-4-2-stack-linux-addon

    TI Bluetooth Stack for WL18xx - Demo Guide
    http://processors.wiki.ti.com/index.php/TI_Bluetooth_Stack_for_WL18xx_-_Demo_Guide

    Best regards,

    Daisuke

  • Hi Daisuke-san

    Did, you see any linux kernel messages, just before or after the transfer fails?
    Also, did you make any modifications to the UART1 in DTS/DTB (ex: enabling DMA etc)..

    Thanks
  • Hi Hari san,


    > Did, you see any linux kernel messages, just before or after the transfer fails?

    Before running the test, a message "omap_intc_handle_irq: spurious irq! " may be output.
    However, during load testing by iperf, "spurious irq" messages are not output and problems arise.

    > Also, did you make any modifications to the UART1 in DTS/DTB (ex: enabling DMA etc)..

    No modification except Hardware flow patch.

    We tested 2 cases with or without Hardware flow patch.
    (1) ‐Linux Processor SDK for AM335x 4.01.00.06 & ‐TI Bluetooth Stack version 4.2.1.0.1.0
    (2) ‐Linux Processor SDK for AM335x 3.01.00.06 & ‐TI Bluetooth Stack version 4.2.1.0.1.0

    In either case, if load is imposed by iperf, communication stops.

    Could you check the load test by using iperf etc. and confirm whether to reproduce it?

    P.S.
    SS1VNET.ko compiled according to each SDK environment is used.

    Best regards,

    kikuchi
  • Hi Hari san

    > Could you check the load test by using iperf etc. and confirm whether to reproduce it?

    As usual the problem is not solved.

    Problems also occur with flood ping and iperf.

    Best regards,

    kikuchi

  • Hi Hari san.

    > Problems also occur with flood ping and iperf.

    I send flood ping log.

    12:01:00 EVM Power ON

    12:03:30 PANM> setDevicePower ON

    12:05:00 PANM> connectRemoteServer

    12:05:00 ifconfig ss1vnet0 inet 169.254.2.171

    12:07:00 flood ping (from windows side) start

    12:08:30 WL18xx hung up detect.

    Check it please.

    Best regards,

    kikuchi

    1738.20180309_BTPAN_stopped.zip