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.

HCI_LE_Transmitter_Test on HostTestApp image

Other Parts Discussed in Thread: CC2540

Hi, 

I'm trying to put CC2540 USB dongle in DTM mode. I've programmed it with HostTestApp image (CC2540 USB configuration) and communicate with it through terminal over VCP.

  • I send the  HCI_LE_Transmitter_Test command 01 1E 20 03 xx yy zz (xx=02, yy=02, zz=02) as explained on the PTM wiki
  • In response I get :
    • On the 1st attempt:  04 0E 04 00 1E 20 00
    • On next attempts: 04 0E 04 00 1E 20 21
    • The wiki page states that the expected response should be: 04 0E 04 01 1E 20 00

As can be seen the 4th byte returns 00 instead of 01 and the 7th byte returns correctly (00) once but subsequent commands it returns 21

I probably missing here something, but what it is ???

  • You must end the previous test before the next test can be started using the HCI_LE_Test_End command.

  • Thanks Timfor your prompt reply.

    Tim C said:

    You must end the previous test before the next test can be started using the HCI_LE_Test_End command.

    Still, sending the exact byte sequence as in the PTM wiki: "01 1E 20 03 xx yy zz" (my case 01 1E 20 03 02 02 02)

    and the USB dongle responds with "04 0E 04 00 1E 20 00"  while the wiki mentions it should return "04 0E 04 01 1E 20 00

    Looking at the core spec (v4.1) I decipher the status message as follows:

    • 04 - Status Event
    • 0E - Event type: Command Complete
    • 04 - Num of allowed HCI packets (what is this exactly ?)
    • 00  - ??? Can't figure out ... its kind of 'stuck in the middle...' with no meaning 
    • 1E 20 - opcode of the command which caused this event (HCI_LE_Transmitter_Test  command is 1E 20)
    • 00 - return parameter - Success

    Any advice would be appreciated.

    Thanks

    NB - The image was built with CC254x_BLE_HCI_TL_Full.lib

  • From the Vendor Specific API Guide, event packets are constructed as such:

    The 0x0E (command complete event) has the following parameters (from the BT spec):

    So your response should be read as:

    04 - Event

    0E - Command Complete Event

    04 - Parameter Length

    00 - Num of allowed HCI packets

    1E 20 - opcode

    00 - Success

    Regarding the "num of allowed HCI" packets...this is used for flow control from controller to host. It should always return 1.  However, there was a bug in the 1.4.0 stack where it always returned 0 (even though there was actually always 1 command available to be sent).  If this bothers you, I would recommend upgrading to the 1.4.1 stack which always returns 1 here.