.. _cc2340r5-cc2340r22-migration-guide:

CC2340R5 to CC2340R22 Porting Guide
**********************************

This section will describe, in general terms, how to migrate
a project developed for the |DEVICE_LOW_PLUS| device to a
|DEVICE_LOW_PLUS_FLASH_DOWN| device running the |SDK|. However, it is important to first
assess the differences between both devices to make sure that the
project migration is possible.

The primary difference between |DEVICE_LOW_PLUS| and |DEVICE_LOW_PLUS_FLASH_DOWN|
is the Flash size, as specified in their respective datasheets.
|DEVICE_LOW_PLUS| has 512kB Flash, and |DEVICE_LOW_PLUS_FLASH_DOWN| has 256kB Flash.

Migration Guide
===============

The recommended migration path is to start with a |DEVICE_LOW_PLUS| 
based example project from the |SDK| and follow the next steps:

1. Import the project into Code Composer Studio.

2. Open SysConfig, go to ``Device View`` and click on ``SWITCH``.

.. _deviceview_switch_configuration_1:
.. figure:: resources/DeviceView_Switch.png
    :align: center

    SysConfig - Switch Device.

3. Once the ``Switch Board or Device`` window is opened, select the
   |DEVICE_LOW_PLUS_FLASH_DOWN| board, or |DEVICE_LOW_PLUS_FLASH_DOWN| device and click on ``CONFIRM``.
   Make sure to save the project changes so that the migration takes place.

.. _deviceview_switch_configuration_2:
.. figure:: resources/Select_R22device.png
    :align: center

    SysConfig - Select |DEVICE_LOW_PLUS_FLASH_DOWN| device.

4. Build the project.

5. Check the Memory Allocation to confirm that the correct changes have occurred.
   To do this, click the project, then in the CCS Toolbar:
   ``Window`` |rarr| ``Show View`` |rarr| ``Memory Allocation``
   
   This will open up the following view:

.. _cc2340r22_mem_allocation:
.. figure:: resources/cc2340r22_memory_allocation.png
    :align: center

    CCS - Memory Allocation.