Creating new CCS v5 Project with Stellarisware

From Texas Instruments Wiki
Jump to: navigation, search

This wiki describes step by step guide to create new project in CCS v5 using Stellarisware and Stellaris Launchpad (EK-LM4F120XL) is used as the hardware platform.

Prerequisites

Installing CCSTUDIO (Code Composer Studio)

Download and install CCSTUDIO (Code Composer Studio) from the following link.


Install StellarisWare for EK-LM4F120XL

Download and install Stellarisware for Stellaris Launchpad (SW-EK-LM4F120XL). The default target folder is "C:\StellarisWare", however it is also possible to give other folder such as "C:\ti\Stellaris\StellarisWare". After successful installation, the following directory structure should appear on the PC file system:

CCSv5 NewPrj Stellarisware Guide DirStructure.PNG


Import the driverlib from Stellarisware

  • In CCSTUDIO, go to "Project" -> "Import Existing CCS Eclipse Project", and then select the folder under <INSTALL_DIR>\StellarisWare\driverlib
CCSv5 NewPrj Stellarisware Guide Import Driverlib 01.PNG
  • There should be two projects found: "driverlib-cm3" (for LM3S devices with ARM Cortex M3 core) and "driverlib-cm4f" (for LM4F devices with ARM Cortex M4 core - used in this project with Stellaris Launchpad), both shall be imported into the CCSTUDIO workspace
CCSv5 NewPrj Stellarisware Guide Import Driverlib 02.PNG
  • Build the "driverlib-cm4f" which will be used in this guide with the Stellaris Launchpad board. The compilation shall succeed without any error.


Install Stellaris In-Circuit Debug Interface (ICDI) and VirtualCOM Port

Refer to the following guide: spmu287.


Creating CCS v5 Project with Stellarisware

Creating New CCS v5 Project

In CCSTUDIO, go to "File" -> "New" -> "CCS Project" and create a project with the following settings:

CCSv5 NewPrj Stellarisware Guide CreateNewPrj.PNG


Adding startup_css.c Source Code

Go to the <INSTALL_DIR>\StellarisWare\boards\ek-lm4f120xl\project0 directory and copy the startup_css.c file into the newly created project from the previous step.

CCSv5 NewPrj Stellarisware Guide CopyStartupCcsC 01.PNG


CCSv5 NewPrj Stellarisware Guide CopyStartupCcsC 02.PNG

as example code, the content of project0.c from the same directory can be copied into the main.c of the newly created project.

Adding Environment Variable Pointing To StellarisWare Folder

Go to "Project" -> "Properties" -> "Build" -> "Environment" and create a new environment variable e.g. SW_ROOT (Stellaris Root Folder name) pointing to the StellarisWare installation folder <INSTALL_DIR>.

CCSv5 NewPrj Stellarisware Guide AddEnvVar.PNG


Adding Include Path

Add the following include directory paths in the project setting based on the new environment variable from the previous step:

  • StellarisWare device general headers : "${SW_ROOT}"
  • Board specific headers(in this case for EK-LM4F120XL) : "${SW_ROOT}/boards/ek-lm4f120xl"
CCSv5 NewPrj Stellarisware Guide AddIncPath.PNG


Including The driverlib Library

Add the library in the project setting which has been created in the last prerequisite step above also based on the new environment variable from two steps before.

CCSv5 NewPrj Stellarisware Guide AddLib.PNG


Compiling the Project

After adding the library, the project shall be be able to be compiled without error.

CCSv5 NewPrj Stellarisware Guide CompilePrj.PNG