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.

RTOS/CC2640R2F: Calling GAPCentralRole_EstablishLink does run into a timeout

Part Number: CC2640R2F

Tool/software: TI-RTOS

Hi all.

From time to time, GAPCentralRole_EstablishLink runs into a timeout instead of triggering GAP_LINK_ESTABLISHED_EVENT.

But on my sniffer I see a successful running connection.

I use simplelink_cc2640r2_sdk_1_35_00_33.

I have implemented a timeout counter which waits for 1 second, this does not change anything.

I have the advertisement interval of 220ms and a connection interval of 11.25ms.

Best regards

Michael

  • Hi Michael,

    Please attach your sniffer logs and more information on how you detect the timeout, like error code etc. To my knowledge, GAP_EstablishLinkReq doesn't have a timeout parameter, so I'm not sure what timeout you mean exactly.

    Best regards,
    Aslak
  • HI Aslak.
    Sorry, I was not very precise.
    After calling GAP_EstablishLinkReq with status SUCCESS I start a clock for 1 second to detect a failed connection estabishment:

    uint8 status = GAPCentralRole_EstablishLink(DEFAULT_LINK_HIGH_DUTY_CYCLE,
    DEFAULT_LINK_WHITE_LIST,
    Slave_Device_Status[reconn_slave_id].bondAddrType,
    Slave_Device_Status[reconn_slave_id].bondAddr);
    if (status != SUCCESS)
    {
    Send2Uart("Status:", 7, status);
    }
    Util_restartClock(&stopLinkReqCommandClock, DEFAULT_LINK_REQ_DURATION);

    But the normal event GAP_LINK_ESTABLISHED_EVENT is not triggered. Instead the clock runs into the timeout.

    Best Regards
    Michael
  • I assume you send a message to the application in that clock handler, to handle the timeout in application context? What does the timeout handler do?

    I can imagine a race condition is possible between the connection, which is asynchronous, and your timeout handler, also asynchronous (regardless of message or not).

    It's a bit odd that the ESTABLISHED event isn't sent though. You are sure that it's your master device you are seeing on that sniffer capture? If you have a much longer timeout, say 10 seconds, do you see the same issue?

    Depending on what else you have going on it's also not impossible that you have run out of heap and the stack didn't have enough memory to send you a message.

    Best regards,
    Aslak
  • Hi Aslak.

    Thanks for your help. I think I have seen the problem, the supervision timeout was too big. Now I have adjusted it and it works better. I test this now.

    Best regards
    Michael