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.

WL1837MOD: HCITester: Error when executing BTS file

Part Number: WL1837MOD
Other Parts Discussed in Thread: WL1837

Background:

  • I'm trying to setup HCITester for Bluetooth regulatory testing, but run into a timeout error immediately after I execute the BTS file.
  • I already edited the BTS code as instructed in the HCI user guide: "Replace the “0x00” value in the “Number of HCI Commands” parameter to “any”.
  • I'm currently running an embedded Linux platform, and I transferred the BTS file (TIInit_11.8.32.bts) to /lib/firmware on my device as instructed.
  • The device is connected via serial port.

Some questions:

  • Do I need to edit the BTS file on the device to match that used in HCITester?
  • Do I need to add any other files on my device, or edit any other configurations to have this file run?
  • Any ideas on how to fix the error I'm running into?
  • Are there any other tools other than HCITester that I can use to control bluetooth for regulatory testing, or any terminal commands?
  • Hi,

    Are you failing on both, HCITester and Linux platform?

    With HCITester, are you able to connect to the COM port and send a command before loading the BTS script?

    For example, if you run "Send_HCI_VS_Get_System_Status 0xFE1F"

    Shlomi

  • Hi Shlomi, 

    Here's a screenshot after running Send_HCI_VS_Get_System_Status 0xFE1F

    Here's a screenshot when I run the BTS script:

    BTS Script failing:

    Here are my COM port settings:

  • Also, is there a way to issue commands for bluetooth regulatory testing from within Linux? Do I have to use HCITool to issue these commands?

  • Hi Essam,

    Seems to me like the BT_EN is not asserted so the BT section in the chip is powered off.

    Regardless, the UART should use hardware flow control and you have it set to None.

    Have you made sure it is on?

    Not clear from the thread whether you have it working via Linux. Please clarify?

    Basically you can do HCI commands from Linux as well but it is less convenient.

    From Linux you can use hcitool as you suggested.

    It has some built-in commands but also a generic one:

    cmd<ogf> <ocf> [parameters]Submit an arbitrary HCI command to local device. ogf, ocf and parameters are hexadecimal bytes

    Regards,

    Shlomi

  • Hi Shlomi,

    The issue persists with hardware flow control option enabled.

     

    I am able to send commands via hcitool cmd <ogf> <ocf> [parameters] on linux. But no way to confirm if it is actually working. 

    How do I manually load the initialization file in Linux terminal? I currently have it in /lib/firmware. Or does it run automatically on device startup?

    Thanks,

    Essam

  • Do I have to recompile Linux after uploading the .bts file to the /lib/firmware directory?

  • Essam,

    Looks like it is the first time you try to make BT works.

    The question is if you want to try and enable it via HCITester or Linux.

    With Linux, it needs to reside under /lib/firmware/ti-connectivity.

    Also, you need to trigger the hciattach utility, for example: 'hciattach < the right /dev/tty> texas 115200'.

    You can see many threads in this forum that explain it.

    Of course that your DTS file should also be updated to configure the BT_EN pin and UART pins.

    Regards,

    Shlomi

  • Hi Shlomi,

    I will try it on Linux and let you know how it goes.

    Do I also have to update the DTS file to make it work via HCITester, or is this just if I want to use Linux?

    Thanks,

    Essam

  • Hi Essam,

    DTS file is required for Linux only. It sets all the GPIOs for the platform.

    HCITester uses a different path but in order to make it work you need to have control over the UART lines and BR_EN line which are usually connected between the host processor (platform) and the WiLink chipset. So usually Linux integration is required and then you can manually control the lines via Linux but this is not mandatory if you can control these lines externally.

    Shlomi

  • Hi Shlomi, 

    I will finally be testing the Linux approach this week. Can you confirm the following:

    • The Bluetooth service pack has 2 files:  TIInit_11.8.32 and TIInit_11.8.32BT4.2. Is it ok if I upload both to /lib/firmware/ti-connectivity ? I'm assuming TIInit_11.8.32BT4.2 is for bluetooth 4.2?
    • Do I need to make any changes to the .BTS file before uploading to /lib/firmware/ti-connectivity? 
    • Do I need to upload any other files besides the .BTS, or point any files to .BTS?

    Thank you,

    Essam

  • Hi,

    TIInit_11.8.32.bts is enough as the other one is for BT4.2 only. Should be located under /lib/firmware/ti-connectivity. No other file is required.

    If you use 115200 baud rate, you don't need to make any modifications to the bts file. However, if you want to increase to 3Mbps, you will need to add a command at the beginning of the bts file to set the baud rate in the BT controller, but let's start with the default 115200 and see how it goes.

    Regards,

    Shlomi

  • Shlomi, I'm still getting a time out error. See below:

    Bluetooth up and showing information: 

    root@am335x-evm:~# hciconfig
    hci0:   Type: Primary  Bus: UART
            BD Address: 30:45:11:36:08:DD  ACL MTU: 1021:6  SCO MTU: 180:4
            UP RUNNING
            RX bytes:3405 acl:0 sco:0 events:370 errors:0
            TX bytes:64222 acl:0 sco:0 commands:370 errors:0
    root@am335x-evm:~#  hciattach /dev/ttyS0 texas 115200
    Initialization timed out.
  • Hi,

    if hciconfig gives you hci0 instance, it means that the BT script is already loaded so you cannot load it again without toggling the reset pin.

    probably you have an automatic loading of BT as part of your initialization.

    if for example you will execute 'hcitool scan', you should see scanning working.

    Regards,

    Shlomi

  • Hi Shlomi,

    I will test the hci commands tomorrow. In the meantime, my FW team shared all the files on the TI connectivity directory:

    I noticed there are multiple .BTS scripts. Will they interfere with TIInit_11.8.32? 

    Apologies for the trivial questions, I'm working on an existing product with limited firmware support. Thank you!

  • sure, no worries.

    the only applicable bts files for wl1837 are the ones starting with 11.8.32.

    All the rest are for older types of the same family (i.e. wl12xx).

    Shlomi

  • Hi Shlomi,

    Good news. I've been able to run hcitool from command line and tested on spectrum analyzer. Not sure why it's still failing on the HCITester side though.

    I need help converting these commands to hcitool commands. Are you able to assist? 

    Bluetooth Classic

    Frequency / Channel: 2480 MHz / CH 78

    Modulation: GFSK

    Power: Maximum Output Power

    Data Rate: 1 Mbps

    Packet Type: 1DH5

    Continuous Tx with 100 % Duty Cycle.

     

    BT LE

    Frequency / Channel: 2480 MHz / CH 39

    Modulation: GFSK

    Power: Maximum Output Power 

    Data Rate: 1 Mbps

    Continuous Tx with 100 % Duty Cycle.

  • Hi,

    Can you open this url?

    https://processors.wiki.ti.com/index.php/WL18xx_Bluetopia_PM_Bluetooth_RF_Testing#Continuous_TX_2

    it contains many commands for doing RF test with HCI Tester.

    Let me know if this is sufficient.

    Regards,

    Shlomi

  • Hi Shlomi,

    I get the following error when I try to open the page you linked:

    This Page Does Not Exist

    The Processors Wiki was removed on January 15, 2021

    Please advise.

    Thanks,

    Essam

  • Hi,

    Probably this is internal.

    See some captures from this line below.

    Continuous TX (BT Classic)

    This is a non-packet continuous transmission with either GFSK (BR), π/4-DQPSK (2-EDR) or 8DPSK (3-EDR).

    Steps and the HCI commands to put the device in the constant TX mode are:

    Step 1:

    run init script.
    

    Step 2:

    #set TxMode: 0x0 = un-modulated Single carrier, 0x1 = GFSK, 0x2 = EDR2, 0x3 = EDR3, 0x4 = BLE, 0x5 = ANT
    TxMode = 1
    

    Step 3:

    Send_HCI_VS_DRPb_Enable_RF_Calibration_Enhanced 0xFDFB, 0x1, 0xFF, 0x00000000, 0x01
    Wait_HCI_Command_Complete_VS_DRPb_Enable_RF_Calibration_Enhanced_Event 5000, any,HCI_VS_DRPb_Enable_RF_Calibration_Enhanced, 0x00
    

    Step 4:

    Send_HCI_VS_DRPb_Tester_Con_TX 0xFDCA, 2402, TxMode, 0, 7, 0x00000000, 0x00000000 // For TxMode relevant value please see step2
    Wait_HCI_Command_Complete_VS_DRPb_Tester_Con_TX_Event 5000, any, HCI_VS_DRPb_Tester_Con_TX, 0x00

    The parameters for the HCI_VS_DRPb_Tester_Con_TX are:

    1. Opcode

    • 0xFDCA
    Typical test setup for Continuous TX mode

    2. Frequency

    • f=2402 ~ 2479

    3. Modulation scheme

    • 0=CW
    • 1=GFSK (BR)
    • 2=π/4-DQPSK (2-EDR)
    • 3=8DPSK (3-EDR)
    • 4=BLE
    • 5=ANT

    4. Test pattern

    • 0=PN9
    • 1=PN15
    • 2=Z0Z0
    • 3=all 1
    • 4=all 0
    • 5=F0F0
    • 6=FF00

    5. Power level index

    • 0-7 where 0 is the lowest and 7 is the highest

    6. Internal setting

    • 0x00000000

    7. Internal setting

    • 0x00000000


    To exit Continuous TX

    The HCI commands for Stopping continuous Tx mode are:

    TX Stop :

    Send_HCI_VS_Write_Hardware_Register 0xFF01, 0x20014044, 0x0010
    Wait_HCI_Command_Complete_VS_Write_Hardware_Register_Event 5000, any, HCI_VS_Write_Hardware_Register, 0x00
    
    Send_HCI_VS_Write_Hardware_Register 0xFF01, 0x20014048, 0x0014
    Wait_HCI_Command_Complete_VS_Write_Hardware_Register_Event 5000, any, HCI_VS_Write_Hardware_Register, 0x00
    

    Stop PN Generator:

    Send_HCI_VS_Write_Hardware_Register 0xFF01, 0x2001900C, 0x0000
    Wait_HCI_Command_Complete_VS_Write_Hardware_Register_Event 5000, any, HCI_VS_Write_Hardware_Register, 0x00


    BT LE Test Mode

    Below are the HCI commands from the Spec to place the device in BT LE test mode :

    Transmitter Test

    Send_HCI_BLE_Transmitter_Test 0x201e, 0x00, 0x00, 0
    Wait_HCI_Command_Complete_BLE_Transmitter_Test_Event 5000, any, HCI_BLE_Transmitter_Test, 0x00
    
    Send_HCI_BLE_Test_End 0x201f
    Wait_HCI_Command_Complete_BLE_Test_End_Event 5000, any, HCI_BLE_Test_End, 0x00, 0