NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

How to Convert a Project from IAR to CCS

From Texas Instruments Wiki
Jump to: navigation, search
MAVRK Banner.png

MAVRK is no longer an active TI evaluation platform. Please contact TI application support if you need further information on TI products or support.

Purpose[edit]

Depending on the creator of the project, some projects may be written in IAR and some in CCS. However, since CCS is the only software provided in the MAVRK starter kit, you may sometimes need to convert a project from IAR to CCS. This page will guide you through the steps to successfully make that conversion. We will use My First App as an example.

What You Will Need[edit]

  • MB-PRO-MVK - MAVRK Pro Motherboard
  • MCU-430F5438A-MVK- MSP430F5438A Processor Component
  • MAVRK Software installed on PC. Please see  MAVRK Software Installation Guide.
  • An existing and working IAR project
  • Code Composer Studio v4 software installed on PC
  • MSP-FET430UIF - MSP430 USB Debug Interface
  • USB Cable (A to Micro AB) to power the MAVRK Pro motherboard
  • AFE_BREAKOUT_MVK Device

Creating a New CCS Project[edit]

Once you are in the CCS window, select File --> New --> CCS Project to Create a new project

New project.jpg

In the settings, set the Project name to be the same as the IAR project name. Uncheck the "Use default location" box and browse to select and use the folder that contains your IAR project files.

New proj settings.jpg

You can see your CCS files on the left side in the Project Explorer. Notice that by creating a new project, CCS has created a new main.c file. However, we will be using the same main file as the one we used for IAR, so you can right mouse click on the new main.c file and delete it.

Delete main.jpg

Adding Library Files[edit]

Now open up the same project on IAR. Notice that in the workspace on the left and under files there are a few folders (ie. Board Support, Common Files). Click on the + box next to Board Support and you should see 2 .c files drop down. We will need to add these to the CCS project.

Board support files.jpg

Now let's go back to the CCS window. Right now, we do not have the library folders. To add a folder under the project, right mouse click on the project folder --> New --> Folder.

New folder.jpg

For now, let's do an example with Board Support, so name your new folder "Board Support". We want to add to the CCS Board Support folder all the files that we see under the IAR Board Support folder. To do that, right mouse click on the Board Support folder in CCS --> New --> Files

New file.jpg

When we add these library files, we want to link them instead of just adding them so that when other users open the same project on another computer, the project will redirect itself to find the same folder on their computer. Check the "Link to file in the file system" box and click on "Variables".

Link file.jpg

Since we are adding library files, select LIBRARIES_DIR and then click on "Extend"

Extend.jpg

In the Variable Extension window you can expand all the folders to find the files that you want to link and add. For example purposes, click on the plus sign next to Board Support and you should find the two files "F5438_ProMB_Com_Port_Functions.c" and "F5438_ProMB_Modular_EVM_IO_Functions.c". Select a file and click on OK and then Finish. This will link and add the selected file to your CCS project.

Now repeat this step for the files in all the folders you see in IAR except for "Config Files" and "Output". In other words, create folders for "Board Support", "Common Files", "MSP Template Files", and "Peripheral Support" and then add all the files in those folders.

macros.ini File[edit]

In order for some of the configurations to work, we must include a configuration file that we will call "macros.ini". Create a new Notepad file and save it in your project folder as "macros.ini". Copy exactly what is shown below into the file and save.

Macros.jpg

Config.ini File[edit]

We need to add another config file to ensure that our initial project settings are set. Open another Notepad file and as convention we will save it as Projectname_CCS_Config.ini. For this example it would be "Basic_MAVRK_MSP430F5438_Template_CCS_Config.ini". You should also find in your project folder a config file that is used for IAR project. It will end with "IAR.cfg". For this example, it will be the "Basic_MAVRK_MSP430F5438_Template_Project_Settings_IAR.cfg" file. Open this file and scroll to the bottom. Copy all the -D commands you see in the .cfg and paste them into your Config.ini file. If they are commented, keep them commented in the ini file, but keep in mind that the // convention will not work for CCS. You must use the /* Comment */ syntax. After you have copied over all the -D commands, save and quit.

Back in the CCS window, let's link the config.ini file to our project. Right mouse click on the project and select properties.

Ccs properties.jpg

Under CCS Build select MSP430 Compiler --> Command Files. Click on the add button and enter the address of your Config.ini file. In this example it would be: "${PROJECT_DIR}\System_Demo_Projects\Basic_MAVRK_MSP430F5438_Template\Basic_MAVRK_MSP430F5438_Template_CCS_Config.ini"

Command file ccs.jpg

Include Files[edit]

Now the final step is to add the include files. This will make use of the macros.ini file, and in order to use the effects of the macros.ini file we must re-open the project. So let's close the project and import it before we deal with the include files.

Next, we want to go into the project properties again, so right mouse click on the project and select properties. Then under CCS Build select MSP430 Compiler --> Include Options.

Under the "Add dir to #include search path" we will add all the include paths. The syntax for adding include file folders is with: "${LIBRARIES_DIR}/Folder/Folder"

For example, to include the Board_Support folder we would add to the directory "${LIBRARIES_DIR}/Board_Support"

To include the MSP430F5438_Template folder under Components we would add to the directory "${LIBRARIES_DIR}/Components/MSP430F5438_Template"

Think back at all the .c files that you added in the Adding Library Files section. Each folder that contains the .c file you added must be included in your project. After you have added all the includes you are done and ready to run the project on CCS!

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article How to Convert a Project from IAR to CCS here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article How to Convert a Project from IAR to CCS here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article How to Convert a Project from IAR to CCS here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article How to Convert a Project from IAR to CCS here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article How to Convert a Project from IAR to CCS here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article How to Convert a Project from IAR to CCS here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article How to Convert a Project from IAR to CCS here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article How to Convert a Project from IAR to CCS here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article How to Convert a Project from IAR to CCS here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity