.. |OLD_STACK_VER| replace:: |DEVICE| SDK 9.14.01
.. |NEW_STACK_VER| replace:: |DEVICE| SDK 9.14.02

|OLD_STACK_VER| to |NEW_STACK_VER|
==================================

This section will describe how to port a project from |OLD_STACK_VER| to
a |NEW_STACK_VER| project.

.. note:: Vulnerability reports and mitigations can be found on `Report potential product security vulnerabilities <https://www.ti.com/PSIRT>`_.

.. _ble-porting-sdk-9-14-02:

Porting Bluetooth LE Projects
-----------------------------

The recommended method for porting an existing project from |OLD_STACK_VER|
to |NEW_STACK_VER| is to modify the project using only the Code Composer Studio interface.
The following steps will detail the changes needed when porting an out of the box
example from the SDK such as ``basic_ble``:

1. Import the project into Code Composer Studio.

2. In order to modify the SDK version, corresponding SysConfig version, as well as the compiler version, 
right-click on the imported project folder inside the Project Explorer and select ``Properties``.

3. In ``General``, select ``Compiler`` and choose the correct version. Refer to the Dependencies section
in the SDK release notes

  .. figure:: ./resources/8.40_to_9.10_compiler.png
      :align: center

      Code Composer Studio - Change Compiler Version.

4. Go to ``Dependencies`` and double-click on ``SimpleLink Low Power F3 SDK`` and choose the correct version.
Then double-click on ``SysConfig`` and do the same. Refer to the Dependencies Section in the SDK release notes
for the correct versions.

  .. figure:: ./resources/8.40_to_9.10_sdk.png
      :align: center

      Code Composer Studio - Change SDK and SysConfig Version.

If the newest SDK is not available, it will need to be actualized. To do this, go to ``File`` => ``Preferences`` 
=> ``Code Composer Studio Settings``, and select ``Products``. Inside the ``Products`` tab, press the refresh
button, which should discover the latest version of the SDK that was installed.

A Few Noteworthy Changes from |OLD_STACK_VER| to |NEW_STACK_VER|
----------------------------------------------------------------

You can follow the guide above without addressing these updates; they are listed
for your information only. All fine grained details might not be mentioned.  

API Changes include: 

 * Ranging Library: 
    * `BleCsRanging_TimingParams_t` has been added to the `BleCsRanging.h` file. The new parameters 
      configure timing such as antenna switching time, time between CS tones, time between frequency changes
      and more. 
    * `BleCsRanging_Config_t` has been updated to remove `qq3Thresh`, `qq3Thresh2` and `NnPathLossThres`. Additionally, 
      `maxVelocity`, `dVarMax`, `resetHist`, `iirCoeff`, `BleCsRanging_TimingParams_t timingParams`, and `*pBuffer` were 
      added to the structure. 
    * `BleCsRanging_DebugResult_t` has been updated to remove `powerDelayProfile`. Additionally, `peakBinIFFT`, 
      `peakCountIFFT`, and `ifftValid` have been added to the structure. 
    * `BleCsRanging_Result_t` has been updated to add `velocity` to the structure. 
    * `BleCsRanging_estimatePbr()` has been updated to remove `BleCsRanging_PathLoss_t *pPathLoss`. Additionally, 
      `*pChannelIdxList` was added to the function. 
    * `BleCsRanging_getHeapSize()` was added to the `BleCsRanging.h` file. 
    
.. note:: When porting to CC2744R7-Q1, the NVS region must be changed to reflect the flash size decrease from CC2745R10-Q1 to CC2744R7-Q1. If 
          the NVS region is not altered, the application will enter the exception handler. 

Please refer to the |STACK| Release Notes for all the details.