.. |OLD_STACK_VER| replace:: |DEVICE| SDK 6.30
.. |NEW_STACK_VER| replace:: |DEVICE| SDK 6.40

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

This section will describe a way to migrate a project from |OLD_STACK_VER| to
a |NEW_STACK_VER| project.

.. note::

   The |NEW_STACK_VER| release introduces major changes to the sample projects
   included in the SDK. Specifically, the Simple Central, Simple Peripheral, and
   Multi Role examples have been removed, and the BLE Basic Example has been introduced.

   For this reason, we recommend to migrate |OLD_STACK_VER| projects by opening
   a new project from the |NEW_STACK_VER| and transferring your changes & application code
   over to the new example.

   Future SDK migrations will not require this process and will be more streamlined.



Migrating Bluetooth LE Projects
-------------------------------

For this migration guide, a peripheral project from |OLD_STACK_VER| will be 
ported over to |NEW_STACK_VER|. The recommended approach is to start with the
Basic BLE project on |NEW_STACK_VER| modify the base configuration to match the
peripheral configuration used in the |OLD_STACK_VER| project. Afterwards, the
custom application code should be transferred to the new project.

#. Import a |NEW_STACK_VER| BLE Basic project.

#. Change the default BLE Basic project configuration options in the BLE Module
   present in SysConfig to match the configuration used in the |OLD_STACK_VER| project.

#. Transfer all custom application logic from the |OLD_STACK_VER| into the
   |NEW_STACK_VER| basic BLE project.

#. Move any profiles and services that the application is using to the 
   |NEW_STACK_VER| project.

#. Transfer the SysConfig settings either visually through the GUI or open both 
   the old and the new project ``.syscfg`` files and copy-paste the desired 
   settings.

#. If necessary, update the project to use the newer TI drivers that are
   supplied with the |SDK|. Additional details are provided 
   in :ref:`noteworthy-ble-migration-sdk-6-40`.

#. Refer to the Core SDK release notes for additional information and the 
   FreeRTOS examples included with |SDK|. The Core SDK release notes may be
   found in ``{SDK_INSTALL_DIR}\docs\simplelink_mcu_sdk\release_notes_coresdk_cc23xx_x_xx_xx_xx.html``

   For additional information on how |NEW_STACK_VER| uses FreeRTOS see
   :ref:`sec-freertos-overview`.

   For any utilized TI Drivers, review |TI_DRIVERS_API|.

.. _noteworthy-ble-migration-sdk-6-40:

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, 
please refer to the specific example you need to port and do a compare between 
the old and new project files. Please refer to the |STACK| Release Notes for 
all the details.

*  Implemented on-chip OAD functionality.

*  Released Basic BLE example (OAD & non-OAD variants).

*  Removed Simple Peripheral, Simple Central, and Multi Role examples.

*  Integrated FreeRTOS code into SDK example projects, removing dependency on 
   ``freertos_builds_cc23x0_release_ticlang`` project

*  Bug fixes