Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640, BLE-STACK
Hi all,
I'm in the process of porting our code from the CC2640 (BLE Statck 2.1) to the CC2640R2 (BLE Stack 3.0/3.1). I followed the instruction from the TI porting guide, and the system boots properly, most of the feature are working except the pairing/bonding.
I used a the passkey entry configuration as described in the documentation and example (Simple BLE peripheral)
#elif BLE_PAIRINGMODE == BLE_PAIRING_PASSKEY
uint8_t pairMode = GAPBOND_PAIRING_MODE_INITIATE;
uint8_t mitm = TRUE;
uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
GAPBondMgr_SetParameter(GAPBOND_PAIRING_MODE, sizeof(uint8_t), &pairMode);
GAPBondMgr_SetParameter(GAPBOND_MITM_PROTECTION, sizeof(uint8_t), &mitm);
GAPBondMgr_SetParameter(GAPBOND_IO_CAPABILITIES, sizeof(uint8_t), &ioCap);
GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &bEnabled);
uint8_t Enabled = TRUE;
GAPBondMgr_SetParameter(GAPBOND_BONDING_ENABLED, sizeof(uint8_t), &Enabled);
And I am sure my PasscodeProcess callback is properly executed at the application layer
// This app uses a default passcode. A real-life scenario would handle all
// pairing scenarios and likely generate this randomly.
uint32_t passcode = 1134;
uint16_t connectionHandle;
GAPRole_GetParameter(GAPROLE_CONNHANDLE, &connectionHandle);
// Send passcode response
if (GAPBondMgr_PasscodeRsp(connectionHandle, SUCCESS, passcode) != SUCCESS)
CMSIS_RTOS_errorHandler(RTOS_LOG_CRITICAL, 0);
m_processCounter++;
However, my pairing/bonding sequence never complete, and stay stuck at 'GAPBOND_PAIRING_STATE_STARTED' until timeout. On the host side, I'm pending on a bond status message until timeout
I've been working on this issue for almost a week now, and I checked the following points
- I have checked the stack, heapManager, task, etc. System is stable and recovers from the failed paring.
- I have a LaunchPad Dev board, and the connection is successful with the same parameters.
- I have tried to connect with a wrong passkey. Device reject the connection successfully with the appropiate error message (bond status sent properly)
- I have tried using an incompatible configuration (changing parameters mitm, iocap, etc). Device reject the connection successfully with the appropiate error message (bond status sent properly)
- When pairing/bonding is disabled, connection is successful
I'm running out of ideas to debug this issue. It looks like the issue is somewhere in the BLE Stack after sending the GAPBondMgr_PasscodeRsp, but I don't know how to identify it.
Thanks for your help,
Best regards,
Val