CC2640连接时,打出timeout
各位好,
我使用CC2640和手机软件进行BLE连接时,有时就打出“”Time Out“”,然后连接就断开了。追溯代码中是这个地方:
请用以下代码追踪一下reason:
case GAP_LINK_TERMINATED_EVENT:
{
gapTerminateLinkEvent_t *pPkt = (gapTerminateLinkEvent_t *)pMsg;
GAPBondMgr_LinkTerm(pPkt->connectionHandle);
memset(gapRole_ConnectedDevAddr, 0, B_ADDR_LEN);
// Erase connection information
gapRole_ConnInterval = 0;
gapRole_ConnSlaveLatency = 0;
gapRole_ConnTimeout = 0;
gapRole_ConnTermReason = pPkt->reason;
// Cancel all connection parameter update timers (if any active)
Util_stopClock(&startUpdateClock);
Util_stopClock(&updateTimeoutClock);
notify = TRUE;
gapRole_ConnectionHandle = INVALID_CONNHANDLE;
// If device was advertising when connection dropped
if (gapRole_AdvNonConnEnabled)
{
// Continue advertising.
gapRole_state = GAPROLE_ADVERTISING_NONCONN;
}
// Else go to WAITING state.
else
{
if(pPkt->reason == LL_SUPERVISION_TIMEOUT_TERM)
{
gapRole_state = GAPROLE_WAITING_AFTER_TIMEOUT;
}
else
{
gapRole_state = GAPROLE_WAITING;
}
// Start advertising, if enabled.
gapRole_setEvent(START_ADVERTISING_EVT);
}
}
break;
然后对照蓝牙Core_V4.0中Volume 2, Part D的error code查找原因
Hi Viki Shi,
这个问题解决了,解决方式就是:把CC2640的外部无源32K的晶振接上了。因为我在main函数中已经禁止进入Standby 和 idle模式,我认为32k有没有都没有关系。可是实际情况是没有还不行。请您能帮我分析一下原因么?
RCOSC_LF有个问题,详细请看TI文档: http://www.ti.com/lit/er/swrz058a/swrz058a.pdf
Hi Viki shi,
谢谢你的帮助。