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.

hcitool commands for test purposes

Other Parts Discussed in Thread: WL1271

Hi,

I was looking for some specific commands to influence the bluetooth functionality for testing purposes.  I listed the functionality that I am looking for below.  I guess the hcitool can be used for that, but I cannot seem to find the required arbitrary commands to do so.  I found the commands in the support pages, like "hcitool cmd 0x3F 0x0184 0x00 0x00 0x00 0x0f 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00", which briefly shows some kind of carrier, but not continuously, and I cannot change the frequency.

Required functionality:

1-disable hopping

2-set frequency (or channel)

3-set TX Continuous / Burst

4-set TX power TPC: transmit power control

Does anybody know which commands I need to use?

I am using the omap3evm board from Mistral in combination with the wl1271 daughter board running Android.

Best regards,

Hans

  • Hi Hans,

    i will forward that question to Bluetooth expert and you will get answer soon

    Regards,

    Eyal

  • I too have tried to find this information. It would seem that a document would be available with this information, however, I have not been able to find the document. Can you copy me on the answer please.

     

     

  • Hi,

           We are adding information in this wiki page: http://processors.wiki.ti.com/index.php/Bluetooth_FCC_Mode#WL1271_.2B_ARM_Platforms 

    Regards,

    ~Miguel

  • Hi Miguel,

    According to the latest info on that page, I can get continuous transmit with

    <setup BT>

    hcitool cmd 0x3F 0x0184 0x00 0x00 0x00 0x0F 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 // CW, PN9, freq index=0, power level 15

    hcitool cmd 0x3F 0x0180 0xFF 0xFF 0xFF 0xFF 0xFF 0x01  // internal setting #2, skipping internal setting #1 because the page says not required for CW

     

    I am still seeing brief transmit, not continuous transmit.  Are there additional setup required?

     

    Paul

     

  • Paul,

            Please verify that no other RF activity is running. You can execute  "hciconfig noscan" to disable page and inquiry scans. 

    Regards,

    ~Miguel

  • Hi Miguel,

    WIFI is off, and a "hciconfig noscan" is performed, I am still getting only a brief Tx.

    One thing that I am doing different from the page is that I use the Android menu to turn on bluetooth (followed by noscan), since I do not have the script file BT_init.sh.  Could you provide me with the script, or otherwise outline the equivalent hciconfig/hcitool commands to run?

     

    Thanks,

     

    Paul

  • Paul,

         The BT_Init.sh only turns on the BT controller, performs the hciattach and enables the bluetooth deamon. Nothing else. Could you run  'hciconfig'  to see the hci0 summary? It may be that some Inquiry activity may be happening. Please post the screenshot on this thread.

    Regards,

    ~Miguel

  • Hi Miguel,

     

    I had 

     

     

    hci0: Type: BR/EDR  Bus: UART

    BD Address: D0:37:61:B5:F2:26  ACL MTU: 1021:4  SCO MTU: 180:4

    UP RUNNING PSCAN 

    RX bytes:2713 acl:0 sco:0 events:94 errors:0

    TX bytes:3857 acl:0 sco:0 commands:87 errors:0

     

    ----
    I ran hciconfig hci0 noscan and now got 
    hci0: Type: BR/EDR  Bus: UART
    BD Address: D0:37:61:B5:F2:26  ACL MTU: 1021:4  SCO MTU: 180:4
    UP RUNNING 
    RX bytes:2726 acl:0 sco:0 events:96 errors:0
    TX bytes:3866 acl:0 sco:0 commands:89 errors:0
    I am just about to retest to see if continuous TX works.  
    I am still using Android settings to turn things on and off, could you give me the exact commands for enabling BT from the command line?

     

    Thanks,

     

    Paul

  • Paul,

         If using Android, you only need to execute the following command: "hciconfig hci0 up". That will take care of the BT controller initialization. You may need to do "start bluetoothd" if you need to interact with other BlueZ utilities.

         From your screenshot, the FCC commands should work after you send the "hciconfig hci0 noscan" command. Let us know.

    Regards,

    ~Miguel

  • Hi Miguel,

     

    Yes we verified the continuous Tx works after noscan is properly applied.  Thank you for the prompt support.

     

    Another question:  The power setting through hcitool (settings from 0x10 to 0x1f) seems to work on ~5dBm increments, are there other ways to fine tune the output?  We have a need to attenuate the output by about 1dBm.

     

    Thanks,

     

    Paul

  • Paul,

            These settings are predefined in the Bluetooth Service Pack. The reason to keep a 5dBm step size is to comply with Bluetooth specifications. Do you mean that you want to attenuate each of the levels by 1dBm? or you mean to have a step size of 1dBm.

    ~Miguel

  • Hi Miguel,

     

    I meant having a step size of 1dBm.  Not necessarily through hcitool either - I was thinking of something similar to tiwlan.ini where the boost can be adjusted.

     

    Our device has one case where the power is over by ~1dBm, which if not addressed would require us to go through additional testing.  I am looking for a way to decrease overall power output, but not @ 5dBm increments.

     

    Thanks,


    Paul

  • Paul,

            As mentioned earlier, the recommended step size is 5dBm. This is in order to comply with the BT specs (2dBm to 8dBm).

            The levels are defined inside the BT Service Pack file (BTS file). At this moment, we do not provide the option to modify them unfortunately. 

    Regards,

    ~Miguel

  • Hi Miguel,

    I'm working with Paul here on getting this Bluetooth FCC testing done.  Another thing we're still working on is demonstrating frequency hopping for the FCC test.  According to the FCC, the test's purpose is:

     "to ensure that the RF energy of frequency hopping systems is hopping at a minimum defined rate.  This helps ensure sufficient time off to enable other frequency hopping devices to co-operate within this allocated band."

    Therefore, we need a command in which to have Bluetooth continuously transmit and hop through all the available channels.  From what I understand of the information on the TI wiki: http://processors.wiki.ti.com/index.php/Bluetooth_FCC_Mode#WL1271_.2B_ARM_Platforms ,  the commands provided there only transmit on one defined channel, but we need to have transmission hopping through all channels.

     

     

    This is what we expect to see in the frequency domain on the spectrum analyzer (Here we're zoomed into 3 channels).

    Could you provide us with a command to satisfy this test?

    Thanks,

    Andre

  • I just went through this and use a scrpt "bt-spectrum":

    #!/bin/sh

    while [ 1 ]; do
    l2ping 00:11:22:33:44:55
    l2ping 00:11:22:33:44:A5
    l2ping 00:11:22:33:44:5F
    l2ping FF:FF:FF:FF:FF:FF
    l2ping FF:FF:FF:FF:FF:A5
    l2ping FF:FF:FF:FF:FF:F5
    done

    This caused it BT to x-mit on all channels,

  • Hi Bill,

    Thanks for you reply,  it got us very close!  We definitely have hopping on all channels now,  but since it's pinging (instead of transmitting) it's only doing short blips on each channel:

     

     

    It's only occupying each channel for a few microseconds at a time, but to demonstrate the FCC frequency occupancy requirement, we'll need to have each channel occupied for 675 microseconds as per Bluetooth spec.

     

    Would anyone happen to know how to make the Bluetooth chip "send" in the blind, without connecting to a real other device first?  I tried using l2test with the "connect and send" mode but since I had nothing to connect to, I couldn't get it to send.

     

    Thanks,

    Andre

  • Andre,

         You can use the following command:

    hcitool cmd 0x3F 0x0185 0xAA 0xBB 0xCC 0xDD 0xEE 0xFF 0xGG 0xHH 0xII 0xJJ 0xKK 0xLL

    where:

    0xAA = Frequency Mode (0x00 - Hopping, 0x03 - Single Freq)

    0xBB = TX Single Frequency Index (0x00 - 0x4E)

    0xCC = RX Single Frequency Index (0x00 - 0x4E, or 0xFF Disable RX)

    0xDD = ACL TX Packet Type (0x00 - DM1, 0x01 - DH1, 0x02 - DM3, 0x03 - DH3, 0x04 - DM5, 0x05 - DH5, 0x06 - 2-DH1, 0x07 - 2-DH3, 0x08 - 2-DH5, 0x09 - 3-DH1, 0x0A - 3-DH3, 0x0B - 3-DH5)

     

    0xEE = ACL TX Packet Data Pattern (0x00 - All 0, 0x01 - All 1, 0x02 - Z0Z0, 0x03 - F0F0, 0x04 - Ordered, 0x05 - PRBS9 Random)

    0xFF = Reserved (Shall be set to 0x00)

    0xHHGG = ACL Packet Data Length (0- Max Packet Length)

    0xII = Power Level Index

    0xJJ = Disable Whitening (0x00 - Enable, 0x01 - Disable)

    0xLLKK = PRBS9 Init (0x0000 - 0x01FF)

     

    Regards,

    ~Miguel

     

     

  • Andre,

         Please look at this thread: http://e2e.ti.com/support/low_power_rf/f/307/p/124304/521798.aspx#521798

    Regards,

    ~Miguel

  • Hi Miguel,

    Thank you for your reply, it was very helpful!

    The commands that we are using now are:

    HCI_VS_DRPb_Tester_Packet_TX_RX for hopping (0x00), disabled RX, DH5, PRBS9 Random, max packet length, power level 15, whitening disabled, and PRBS9 init to 0x0000

    hcitool cmd 0x3F 0x185 0x00 0x00 0xFF 0x05 0x00 0x00 0x00 0x00 0x0F 0x01 0x00 0x00

    followed by

    Send_HCI_VS_Write_Hardware_Register 0xFF01, 0x0019180c, 0x0101

    hcitool cmd 0x3F 0x0301 0x0C 0x18 0x19 0x00 0x01 0x01

    I have several observations here:

    1. The instruction to  set Frequency Mode is (0x00 - Single Freq, 0x03 - Hopping) but I found that 0x03 produced no transmission, but 0x00, 0x01, and 0x02 produced hopping.  Could you please clarify this?
    2. I tried setting Packet Data Length to 0xFFFF, but that crashed the device.  I suppose 0 for Max Data Length would be the option we should use?

    However, the two questions that we have are:

    1. From what we see right now, the psuedo random sequence of hopping through all channels doesn't restart every cycle.  What we would like is for every hopping cycle through all the channels, we would like the pseudo-random sequence to start again from the same seed (init).  This would let us calculate the hopping frequency by measuring the duration between two visits of the same channel ( = time for one complete cycle of hoping all channels).  For this to work, the channels need to be visited in the same order every cycle. 
    2. The pulse width at each frequency (duration for which each channel is held), was observed to be 50 - 100 microseconds.  We would like to have the pulse width set to 300 to 650 microseconds as per a typical Bluetooth device.

    Could you let us know whether the two questions I just mentioned could be solved through the setting of some parameter?

     

    Thanks,

    Andre

  • Andre,

    I made a mistake in the previous post. The correct parameters are (I have corrected the previous post now):

    0xAA = Frequency Mode (0x00 - Hopping, 0x03 - Single Freq)    

    I forgot to mention that for this command you do not need to send the HCI_VS_Write_Hardware_Register, but you must be sure that the initial conditions (no scans) are met.

    Regarding the "Packet Data Length", this would depend on the packet type that you select. For instance,  0-17 for DM1, 0-27 for DH1 and so on.

    For 1, the hopping sequence depends on different factors. Could you elaborate what you are trying to evaluate here?

    For 2, this will depend on the packet type.

    Regards,

    ~Miguel      

  • Thanks Miguel!  We finally got it to work with DH1 and Packet Data Length set to 27:

    hcitool cmd 0x3F 0x185 0x00 0x00 0xFF 0x01 0x01 0x00 0x1B 0x00 0x0F 0x01 0x00 0x00