2.1. Migrating armcl CCS Projects to tiarmclang

One of the challenges you may face when transitioning an existing armcl application in order to build the application with the tiarmclang compiler is in mapping armcl compiler options into their corresponding tiarmclang compiler options. If your armcl application exists as a CCS project, then CCS can help with the mapping of armcl compiler options to tiarmclang options.

The process of migrating an armcl CCS project to use the tiarmclang compiler is relatively straightforward:

  1. Import the armcl CCS project into a CCS workspace

  2. In the Project Explorer window, left-click on the armcl project name that you want to migrate to make it the active project, then right-click on the armcl project name and select Show Build Settings

../../_images/CCS_tutorial_1.png
  1. You will then see a Properties pop-up dialog box for the armcl project

../../_images/CCS_tutorial_2.png

Before migrating the armcl project to use the tiarmclang compiler, you can check the armcl option settings. In this example, the Processor Options show that -mv7m4 and --float_support=FPV4SPD16 options have been selected:

../../_images/CCS_tutorial_3.png

Also, the -O3 and -mf0 options have been selected among the Optimization options:

../../_images/CCS_tutorial_4.png
  1. Left-click on the General category along the left-hand side of the dialog box and find the Compiler version drop-down menu near the middle of the dialog box, then Change the compiler selected from the current armcl compiler to the tiarmclang compiler (may be denoted as “TI Clang <version string>”):

../../_images/CCS_tutorial_5.png
  1. Click on Apply and Close at the bottom of the dialog box:

../../_images/CCS_tutorial_6.png

You will see a Confirmation Needed pop-up dialog asking if you’d like to proceed with the creation of a new build configuration:

../../_images/CCS_tutorial_7.png

When you click OK in the Confirmation Needed dialog box, the migration process is started.

Unless all armcl compiler options were migrated flawlessly to their tiarmclang compiler counterparts, you will see a Warning pop-up dialog box explaining that some issues were encountered when creating the new build configuration:

../../_images/CCS_tutorial_8.png

You can then click OK and proceed to view a project.log file in the CCS source file window.

The project.log file will provide details about each of the armcl to tiarmclang option mappings that were enacted during the migration step. The armcl compiler options that CCS was not able to migrate into a functionally equivalent tiarmclang compiler option will be listed with a !WARNING message in the project.log file. You will want to review the mappings listed in the project.log file to ensure that each armcl compiler was mapped to a tiarmclang option as you expected. For this tutorial we can see that the armcl -mv7m4 option was mapped to the -mcpu=cortex-m4 option,

../../_images/CCS_tutorial_9.png

the armcl --float_support=FPV4SPD16 option was mapped to the tiarmclang -mfloat-abi=hard and -mfpu=fpv4-sp-d16 options,

../../_images/CCS_tutorial_10.png

and the armcl -O3 and -mf0 options were mapped to the tiarmclang -Oz option:

../../_images/CCS_tutorial_11.png

To further ensure that the armcl options were properly converted to tiarmclang options, you can check the build settings for the newly created TICLANG configuration of your project. Right-click on the project name and select Show Build Settings to bring up the Properties dialog box associated with the TICLANG configuration of your project.

../../_images/CCS_tutorial_12.png

For this tutorial, we can see the Processor Options for the tiarmclang compiler show that -mcpu=cortex-m4, -mfloat-abi=hard, and -mfpu=fpv4-sp-d16 options have been selected, as expected:

../../_images/CCS_tutorial_13.png

Also, the Optimization options view shows that the tiarmclang -Oz option has been selected:

../../_images/CCS_tutorial_14.png

Further details about mapping armcl compiler options to tiarmclang compiler options are provided in the remainder of this chapter.