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: the phone doesnt pop pairing dialog during pairing.

Part Number: CC2640R2F

Hi,

I face an issue when I trying to pair with my android phone but it didnt pop passcode input dialog then pairing fail.

I am using BLE5 peripheral mode with these setting:

#if defined(GAP_BOND_MGR)
// Setup the GAP Bond Manager. For more information see the GAP Bond Manager
// section in the User's Guide:
// software-dl.ti.com/.../
{
// Don't send a pairing request after connecting; the peer device must
// initiate pairing
uint8_t pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;//GAPBOND_PAIRING_MODE_INITIATE;
// Use authenticated pairing: require passcode.
uint8_t mitm = TRUE;
// This device only has display capabilities. Therefore, it will display the
// passcode during pairing. However, since the default passcode is being
// used, there is no need to display anything.
uint8_t ioCap = GAPBOND_IO_CAP_DISPLAY_ONLY;
// Request bonding (storing long-term keys for re-encryption upon subsequent
// connections without repairing)
uint8_t bonding = TRUE;

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), &bonding);
}
#endif

These codes is working on simple peripherial example code, but I conuld not understand why it fail on my side.

Any idea to debug it??

Thanks

  • Hello,

    Thank you for posting on the E2E forums. I have assigned this thread to an expert. In the meantime, what SDK version are you using?

    Best,

    Nima

  • i am using cc2640R2F SDK 5.3.

    I am using this code and port to cc2640R2F with some changes like reduce stack size for task and disable unnecessary task to me.

    https://github.com/TexasInstruments/HOGP-BLE-HID-EXAMPLE

  • Hi,

    First of all, I would recommend to make sure to clean up the bonded devices list on the phone. When re-flashing a same device, this may be an issue.

    I would then recommend to verify if the Android phone manages to pair with a non-modified simple_peripheral example.

    After that, depending on the results, a review of the differences between the projects may be relevant.

    I hope this will help,

    Best regards,

  • Hi,

    Just found strange way to fix it. (SDK and non-modify demo code is great)

    One of my task allocate 4096 K stack size (HIDEMUKBD_TASK_STACK_SIZE) and after I change it to 1024, it works well now.

    But I cant understand why allocate too many memory will cause passcode call back cant be called....?(pairing call back is working).