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: How to remove pairing capabilities from simple_peripheral project

Part Number: CC2640R2F

CC2640R2 (BLE5)

Note: The following instructions have been written for SDK 3_40_00_10 but can be adapted to quite any SDK version (that is why I provided the sources but also the diff files)

At the end of this instruction, your project won’t be able anymore to pair. The goal is to save space in FLASH and RAM memory.
This modification is slightly more advanced but it's worth the money!

How to do this?

  1. Import the project you want (the OOB ble5_simple_peripheral or the project where you have already removed the display, the secondary advertisement, the auto PHY functionalities and the connection parameters update functionalities [see here])

  2. In simple_peripheral.c, set pairMode to GAPBOND_PAIRING_MODE_NO_PAIRING (instead of GAPBOND_PAIRING_MODE_WAIT_FOR_REQ)
    Here are the diff file and the file you are supposed to get if you also removed the display, the secondary advertisement, the auto PHY functionalities and the connection parameters update functionalities:
    simple_peripheral_remove_pairing.diff
    --- C:\ti\simplelink_cc2640r2_sdk_3_40_00_10\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral\src\app\simple_peripheral_without_connection_params_update.c	Wed Feb 12 15:55:05 2020
    +++ C:\ti\simplelink_cc2640r2_sdk_3_40_00_10\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral\src\app\simple_peripheral_SIMPLE.c	Wed Feb 12 17:29:48 2020
    @@ -524,9 +524,8 @@
       // section in the User's Guide:
       // http://software-dl.ti.com/lprf/ble5stack-latest/
       {
    -    // Don't send a pairing request after connecting; the peer device must
    -    // initiate pairing
    -    uint8_t pairMode = GAPBOND_PAIRING_MODE_WAIT_FOR_REQ;
    +    // Pairing is not possible
    +    uint8_t pairMode = GAPBOND_PAIRING_MODE_NO_PAIRING;
         // Use authenticated pairing: require passcode.
         uint8_t mitm = TRUE;
         // This device has no display capabilities.
    
       3173.simple_peripheral_SIMPLE.C
  3. In the stack project (named ble5_simple_peripheral_cc2640r2lp_stack_library), in the file TOOLS/ build_config.opt, remove the declaration of the symbol GAP_BOND_MGR
    Here is the diff file and the file you are supposed to get if you do the modification:

    build_config.diff
    --- C:\ti\simplelink_cc2640r2_sdk_3_40_00_10\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral\src\app\build_config.opt	Wed Feb 12 17:43:17 2020
    +++ C:\ti\simplelink_cc2640r2_sdk_3_40_00_10\examples\rtos\CC2640R2_LAUNCHXL\ble5stack\simple_peripheral\src\app\build_config_SIMPLE.opt	Wed Feb 12 17:27:47 2020
    @@ -122,7 +122,7 @@
     /* -DGATT_DB_OFF_CHIP */
     
     /* Include GAP Bond Manager */
    --DGAP_BOND_MGR
    +/* -DGAP_BOND_MGR */
     
     /* BLE v4.1 Features */
     /* -DV41_FEATURES=L2CAP_COC_CFG */
    
       build_config.opt

  4. Build the stack project and the application project

Test your program. Everything should still work smoothly!