BLE5-Stack 1.00.00 to BLE5-Stack 1.00.01ΒΆ

This section will describe a way to migrate a project from BLE5-Stack 1.00.00 to a BLE5-Stack 1.00.01 project.

For this migration guide, simple_peripheral from BLE5-Stack 1.00.00 will be ported over to BLE5-Stack 1.00.01. Because the directory structure is nearly identical between the two releases, the recommended approach is to start with a BLE5-Stack 1.00.01 project that contains the same base functionality as the porting target project and merge in any custom functionality.

  1. Choose a BLE5-Stack 1.00.01 example project that contains your target project’s base functionality.

    For reference, see available sample projects that start with simple_

    In this example, we’re going to use simple_peripheral as the starting BLE5-Stack 1.00.01 sample project.

  2. Transfer all modified application files from BLE5-Stack 1.00.00 into the BLE5-Stack 1.00.01 example project.

    In this example, the following files from BLE5-Stack 1.00.00 were moved into simple_peripheral BLE5-Stack 1.00.01 example:

    • simple_peripheral.c
    • simple_peripheral.h
    • simple_gatt_profile.c
    • simple_gatt_profile.h
  3. If your code contains any #ifdef USE_CORE_SDK, remove these.

  4. Modify main.c in the BLE5-Stack 1.00.01 example if additional tasks were added in the BLE5-Stack 1.00.00 project.

  5. Please do not add any DV42_FEATURES defines to build_config.opt in BLE5-Stack 1.00.01. If you want to enable or disable sec-secure-connections, please use the GAPBOND_SECURE_CONNECTION parameter. (Secure Connections is enabled by default in BLE5-Stack 1.00.01.)

    uint8_t gapbondSecure = GAPBOND_SECURE_CONNECTION_NONE;
    GAPBondMgr_SetParameter(GAPBOND_SECURE_CONNECTION, sizeof(uint8_t), &gapbondSecure);
    
  6. In BLE-Stack BLE5-Stack 1.00.01, heap management has been updated. Please see Dynamic Memory Allocation for details on how to optimize your heap.

  7. If you are using the GAPBondMgr, make sure a passcode callback function is defined and sent to the GAPBondMgr. This is mandatory in BLE5-Stack 1.00.01.

    // GAP Bond Manager Callbacks
    // These are set to NULL since they are not needed. The application
    // is set up to only perform justworks pairing.
    static gapBondCBs_t simpleBLEPeripheral_BondMgrCBs =
    {
        (pfnPasscodeCB_t) SimpleBLEPeripheral_passcodeCB, // Passcode callback
        SimpleBLEPeripheral_pairStateCB                   // Pairing / Bonding state Callback
    };
    

    The passcode can be defined as follows:

    /*********************************************************************
    * @fn      SimpleBLEPeripheral_passcodeCB
    *
    * @brief   Passcode callback.
    *
    * @return  none
    */
    static void SimpleBLEPeripheral_passcodeCB(uint8_t *deviceAddr, uint16_t connHandle, uint8_t uiInputs, uint8_t uiOutputs)
    {
        uint8_t *pData;
    
        // Allocate space for the passcode event.
        if ((pData = ICall_malloc(sizeof(uint8_t))))
        {
            *pData = uiOutputs;
    
            // Enqueue the event.
            SimpleBLEPeripheral_enqueueMsg(SBP_PASSCODE_NEEDED_EVT, 0, pData);
        }
    }
    
  8. If necessary, update the project to use the newer TI-RTOS drivers that are supplied with the SimpleLink CC2640R2 SDK.

    The following drivers have changed from BLE5-Stack 1.00.00. Please see the changes to these drivers by comparing the supplied headers between those in simplelink_cc2640r2_sdk_1_30_00_25 and those in the SimpleLink CC2640R2 SDK.

    • ADC
    • NVS
    • Display

    Attention

    The display folder should in BLE5-Stack 1.00.01 be included with the path <ti/display/Display.h>, not <ti/mw/display/Display.h>.

    #include <ti/display/Display.h>
    
  9. Refer to the Upgrade and Compatibility Information for additional information and the TI-RTOS examples included with SimpleLink CC2640R2 SDK.

    For additional information on how BLE5-Stack 1.00.01 uses TI-RTOS see TI-RTOS Overview

    For any utilized TI Drivers, review `TI-RTOS Kernel Users Guide`_ and Driver APIs.