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.

CC2640R2F: Connection gets disconnected

Part Number: CC2640R2F

Hi,

I am working on host test with SDK 1.50.00.58... i added simple peripheral services in code and testing peripheral gap role through btool.

I am able to do advertisement able to make connection with mobile generic app (connection via mobile app) and its getting connected, but after sometime ( 30 sec ) connection gets disconnected and error comes on app debug log is "Error 34 : GATT CONN LMP TIMEOUT" 

Pl find screenshot below..

Pl find the sequence of commands i give

  • Device init ( Peripheral mode )
  • Set Adv tokens ( setting flags,Adv type 16 bit more,local complete name,slave connection interval range,power level )
  • Update Adv tokens
  • Make Discoverable

Best Regards,

Bhavin

  • Hi Bhavin,

    This seems to indicate a timeout in a LL control procedure. What does your BTool log look like for this connection? What phone and android version is it?

    Does it work with regular simple peripheral towards the phone?

    Best regards,
    Aslak
  • Hi,

    Yes it works with regular peripheral example.

    I use Motorola G5sPlus and Android version 7.1.1 i do use.

    See the below log....

    [1] : <Tx> - 02:26:26.811
    -Type : 0x01 (Command)
    -OpCode : 0xFE06 (GAP_MakeDiscoverable)
    -Data Length : 0x0A (10) byte(s)
    EventType : 0x00 (0) (Connectable Undirect Advertisement)
    InitAddrType : 0x00 (0) (Public)
    InitAddrs : 00:00:00:00:00:00
    ChannelMap : 0x07 (7) (Channel 37
    Channel 38
    Channel 39)
    FilterPolicy : 0x00 (0) (Allow Scan Requests From Any, Allow
    Connect Request From Any.)
    Dump(Tx):
    0000:01 06 FE 0A 00 00 00 00 00 00 00 00 07 00 ..............
    --------------------------------------------------------------------
    [2] : <Rx> - 02:26:26.831
    -Type : 0x04 (Event)
    -EventCode : 0x00FF (HCI_LE_ExtEvent)
    -Data Length : 0x06 (6) bytes(s)
    Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
    Status : 0x00 (0) (Success)
    OpCode : 0xFE06 (GAP_MakeDiscoverable)
    DataLength : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 06 FE 00 .........
    --------------------------------------------------------------------
    [3] : <Rx> - 02:26:26.841
    -Type : 0x04 (Event)
    -EventCode : 0x00FF (HCI_LE_ExtEvent)
    -Data Length : 0x03 (3) bytes(s)
    Event : 0x0603 (1539) (GAP_MakeDiscoverable)
    Status : 0x00 (0) (Success)
    Dump(Rx):
    0000:04 FF 03 03 06 00 ......
    --------------------------------------------------------------------
    [4] : <Info> - 02:26:30.723
    Device Connected
    Handle = 0x0000
    Addr Type = 0x01 (Static)
    BDAddr = 5D:81:04:50:D2:87
    --------------------------------------------------------------------
    [5] : <Rx> - 02:26:30.713
    -Type : 0x04 (Event)
    -EventCode : 0x00FF (HCI_LE_ExtEvent)
    -Data Length : 0x14 (20) bytes(s)
    Event : 0x0605 (1541) (GAP_EstablishLink)
    Status : 0x00 (0) (Success)
    DevAddrType : 0x01 (1) (Random)
    DevAddr : 5D:81:04:50:D2:87
    ConnHandle : 0x0000 (0)
    ConnRole : 0x04 (4) (Peripheral)
    ConnInterval : 0x0027 (39)
    ConnLatency : 0x0000 (0)
    ConnTimeout : 0x07D0 (2000)
    ClockAccuracy : 0x05 (5)
    Dump(Rx):
    0000:04 FF 14 05 06 00 01 87 D2 50 04 81 5D 00 00 04 .........P..]...
    0010:27 00 00 00 D0 07 05 '......
    --------------------------------------------------------------------
    [6] : <Rx> - 02:26:31.003
    -Type : 0x04 (Event)
    -EventCode : 0x00FF (HCI_LE_ExtEvent)
    -Data Length : 0x0D (13) bytes(s)
    Event : 0x0612 (1554) (GAP_LinkParamUpdateRequest)
    Status : 0x00 (0) (Success)
    ConnHandle : 0x0000 (0)
    MinConnInt : 0x0006 (6)
    MaxConnInt : 0x0006 (6)
    ConnLatency : 0x0000 (0)
    ConnTimeout : 0x07D0 (2000)
    Dump(Rx):
    0000:04 FF 0D 12 06 00 00 00 06 00 06 00 00 00 D0 07 ................
    --------------------------------------------------------------------
    [7] : <Info> - 02:27:30.970
    Device Disconnected
    Handle = 0x0000
    Addr Type = 0x01 (Static)
    BDAddr = 5D:81:04:50:D2:87
    --------------------------------------------------------------------
    [8] : <Rx> - 02:27:30.970
    -Type : 0x04 (Event)
    -EventCode : 0x00FF (HCI_LE_ExtEvent)
    -Data Length : 0x06 (6) bytes(s)
    Event : 0x0606 (1542) (GAP_TerminateLink)
    Status : 0x00 (0) (Success)
    ConnHandle : 0x0000 (0)
    Reason : 0x08 (8) (Supervision Timeout)
    Dump(Rx):
    0000:04 FF 06 06 06 00 00 00 08 .........
    --------------------------------------------------------------------

    Regards,
    Bhavin
  • Hi Bhavin,

    It looks like you didn't reply to the GAP_LinkParamUpdateRequest. Does that seem likely? When you are using HostTest you don't have the peripheral.c GAP Role abstraction to respond for you.

    The correct response here would be to send GAP_UpdateLinkParamReqReply, with the same parameters as you received.

    Best regards,
    Aslak
  • Hi Aslak,

    Done!!! Working ok now.

    Thanks and Regards,
    Bhavin
  • Hi Aslak,

    One more thing, if i add services from HCI commands in case DB_OFF_CHIP mode and advertise data and make connection with them...its get connected but services are not getting discovered so is it there any specific command need to give from outside what ?

    Regards,
    Bhavin
  • Hi Bhavin,

    I'm not sure what you mean exactly, but if you have GATT_DB_OFF_CHIP then the device should be forwarding all the discovery etc requests to your host over UART, and not in fact include a GATT server on-chip. Perhaps what you are looking for isn't GATT_DB_OFF_CHIP, but something more similar to this link: processors.wiki.ti.com/.../CC254X_WITH_EXT_MCU --> Network Processor Custom.

    BR,
    Aslak