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.
Code Composer Studio v5 Users Guide
Return to the Sitara Linux Software Developer's Guide
Contents
- 1 Overview
- 2 Updated Toolchain
- 3 Locating the CCSv5 Installer
- 4 Starting the CCSv5 Installer
- 5 CCSv5 Installation Steps
- 6 Installing Emulator Support
- 7 Launching CCS
- 8 Enabling CCS Capabilities
- 9 Importing Qt Projects
- 10 Importing C/C++ Projects
- 11 Creating a New Project
- 12 Remote System Explorer
- 13 Using GDB Server in CCSv5 for Linux Debugging
- 14 Archived versions
Overview[edit]
Code Composer Studio v5.3 is currently provided with the Sitara Software Development Kit. It uses the Eclipse backend and includes the Remote System Explorer plug-in that provides tools to provide access to the remote target board.
Updated Toolchain[edit]
Starting with Sitara Linux SDK 6.0 the location of the toolchain has changed and for non ARM 9 devices a new Linaro based toolchain will be used. Details about the change in toolchain location can be found here. Also details about the switch to Linaro can be found here.
AM18x users are not affected by the switch to Linaro. Therefore, any references to the Linaro toolchain prefix "arm-linux-gnueabihf-" should be replaced with "arm-arago-linux-gnueabi-".
Locating the CCSv5 Installer[edit]
Using the SD Card Provided with the EVM[edit]
When the SD card provided in the box with the EVM is inserted into an SD card reader attached to a Linux system three partitions will be mounted. The third partition, labeled START_HERE, will contain the CCS installer along with the Sitara Linux SDK installer. The CCS installer is located inside of the CCS directory and there is a helper script called ccs_install.sh available to help call the installer.
Downloading from the Web[edit]
The CCS installer is available for download as a compressed tarball (tar.gz) file on the same page as the Sitara Linux SDK download. The installer can be located by browsing to http://www.ti.com/tool/linuxezsdk-sitara and selecting the device being used. On the individual SDK download page you can find the CCS installer under the Optional Addons section. i.e.
Clicking this link will prompt you to fill out an export restriction form. After filling out the form you will be given a download button to download the file and you will receive an e-mail with the download link. Download the tarball and save it to your Linux host development system.
Starting the CCSv5 Installer[edit]
Using the Sitara Linux SDK Installer[edit]
The Sitara Linux SDK installer has the capability of launching the CCSv5 installer during the SDK installation. In order for the installer to launch the CCSv5 installer the CCS directory and ccs_install.sh script must be located in the same directory as the Sitara Linux SDK installer. When installing from the SD card found in the EVM box this directory and script are already located in the same directory as the Sitara Linux SDK installer. However, if you downloaded the CCS installer tarball from the ti.com website as mentioned above, then you will need to:
- Place the CCS tarball (the .tar.gz file) in the same directory as the Sitara Linux SDK installer
- Extract the CCS tarball using a command like:
- tar xzf CCS_<version>_Sitara_ARM.tar.gz
- Where <version> is the version string of the CCS installer
After the CCS installer files are located in the same directory as the Sitara Linux SDK installer you can execute the SDK installer to begin SDK installation. During the SDK installation you will see a scree similar to the one below. The option to Install Code Composer is enabled by default.
NOTE: If the Install Code Composer option is selected and the CCS install files are not located in the same directory as the Sitara Linux SDK installer you will be given a message that the installer could not be located and the SDK installation will continue as normal. To install CCS later you can follow the steps in the next section to bypass the Sitara Linux SDK installer.
From Linux Command Line[edit]
If you want to install CCSv5 apart from the Sitara Linux SDK installer, or if you decided not to install it as part of the SDK install and want to install it now, you can install CCS using the following commands:
- Open a Linux terminal and change directory to the location where the CCS files are located. This may be the START_HERE partition of the SD card, or the location where you downloaded the tarball file from the ti.com website.
- If the CCS files are still in a compressed tarball extract them using the command
- tar xzf CCS_<version>_Sitara_ARM.tar.gz
- Where <version> is the version string of the CCS installer
- Invoke the CCS installer using the ccs_install.sh script located in the START_HERE directory (copy the script to your current directory).
- ./ccs_install.sh $PWD
- NOTE: You can also invoke the CCS installer using in the CCS directory using the commands:
- cd CCS
- ./ccs_setup*.bin --setupfile ccs_installini.xml
CCSv5 Installation Steps[edit]
NOTE: The "Limited 90-day period" language in the CCS installer license agreement applies only for the case of using high-speed JTAG emulators (does not apply to use of the XDS100v2 JTAG emulator or an on-board emulator). If a debug configuration is used that requires a high-speed JTAG emulator, you will be prompted to register your software for a fee. All use of CCSv5 (excluding use of high-speed JTAG emulators) is free and has no 90-day time limit.
When the CCSv5.3 installer runs you can greatly reduced the install time and installed disk space usage by taking the defaults as they appear in this CCS installer. The screen captures below show the default installation options and the recommended settings when installing CCSv5.
- The License Agreement screen will prompt you to accept the terms of the license agreement. Please read these terms and if you agree select I accept the terms of the license agreement. If not then please exit the installation.
- At the Choose Installation Location screen do NOT check Add TI plug-ins into an existing Eclipse install
- At the Processor Support screen make sure to select the AMxx Cortex-A and ARM9 processors option
- At the Select Components screen do NOT select TI ARM Compiler Tools. These tools are the TI compiler tools for ARM devices, whereas for Linux the Sitara Linux SDK uses the open source GCC compiler.
- At the Select Emulators screen make sure that JTAG Emulator Support is enabled but you do not need to select individual emulators unless you require support for that model of JTAG. To install those drivers later see the Installing Emulator Support section below.
- At the CCS Install Options screen verify that the options look correct and then select Next to begin installation.
- After the installation has completed click Finish
Installing Emulator Support[edit]
If during the CCSv5 installation, you selected to install drivers for the Blackhawk or Spectrum Digital JTAG emulators a script must be run with administrator privileges
to allow the Linux Host PC to recognize the JTAG emulator. The script must be run as "sudo" with the following command:
sudo <CCSv5_INSTALL_PATH>/ccsv5/install_scripts/install_drivers.sh
where <CCSv5_INSTALL_PATH> is the path that was chosen when the CCSv5 installer was run.
Launching CCS[edit]
After the CCS installer has finished executing you should have an icon on your desktop call Code Composer Studio v5 like:
To launch CCS you should:
- Double-Click the CCS icon on the desktop. You will see the CCSv5 splash screen appear while CCS loads
- The next window will be the Workspace Launcher window which will ask you where you want to locate your CCSv5 workspace. You can take the default here or choose a custom directory.
- CCS will load the workspace and then launch to the default TI Resource Explorer screen
- Close the TI Resource Explorer screen. This screen is useful when making TI CCS projects which use TI tools. The Sitara Linux SDK uses open source tools with the standard Eclipse features and therefore does not use the TI Resource Explorer. You will be left in the Project Explorer default view.
Enabling CCS Capabilities[edit]
Each time CCSv5 is started using a new workspace, additional capabilities need to be enabled so that perspectives for those capabilities will be selectable in the Window -> Open Perspectives list.
After opening CCSv5 with a new workspace:
- Open the Window -> Preferences menu
- Go to the General -> Capabilities menu
- Select the RSE Project Capability
- Click Apply and then OK
This enables the perspectives in the Window -> Open Perspective -> Other menu as shown below and is needed to make the Remote System Explorer plug-ins selectable.
Note: The Qt C++ Perspective is not compatible with this version of Eclipse. Instead Qt projects are to be built using the Makefiles inside of the project as will be detailed in the later sections of this guide.
Importing Qt Projects[edit]
Since the Qt plugin does not work with the latest version of Qt the example projects have been modified to use a Makefile to handle the build step. You can use projects like the matrix-gui-browser project as a reference for how to configure a Qt project to build using a Makefile. The following steps detail the changes that should be made for an existing Qt project to use a Makefile to build.
Importing matrix browser project[edit]
- First import the Qt project using the File -> Import... menu
- Select the Qt -> Qt Project option
- Press the Next > button
- On the Import Qt Project screen click the Browse... button and locate the matrix_browser.pro file within the <SDK INSTALL DIR>/example-applications/matrix-gui-browser-x.x directory
- Click OK
- You should now see the matrix_browser project listed as being selected for import into CCS
- Click Finish to import the matrix-gui-browser project
- You should now see the matrix_browser project in the Project view
- Now you will need to add the Qt version found in the SDK to CCS. This can be done using Window -> Preferences and selecting the Qt' menu item
- Select the Add... button
- In the Add new Qt version dialog fill in:
- Click Finish
- Click Apply
- When prompted that Qt versions have changed select Yes
- Click OK
Changing the Make Target[edit]
By default the debug target is compiled when you selected to rebuild the Qt projects due to the Qt version change above. You can build the release version by doing:
- Right Click matrix_browser project
- Select Make Targets -> Build...
- Highlight Qt Release Build and click the Build button
- You will find the matrix_browser executable built in the matrix_browser project.
Creating a New Make Target[edit]
You may want to create additional make targets for steps like the installation step. In this example we will make an install target that installs the release version of the matrix_browser executable.
- Right click matrix_browser project and select Make Targets -> Create...
- In the dialog box set:
- Click OK
You can now build the install target using the steps in the Changing the Make Target section above.
Using a Makefile[edit]
In order for the above steps to work a Makefile.build Makefile was created in the matrix-gui-browser directory. This Makefile.build has some key points that are worth mentioning.
- The Rules.make file is included from the top-level of the Sitara Linux SDK. This is to provide access to variables like DESTDIR for installing the built executable.
-include ../../Rules.make
- There is a variable called ENV_SETUP that points to the environment-setup script in the linux-devkit directory. The qmake target, which is used by the release and debug targets will first source the environment-setup script to get access to qmake2 and configure the build to use the Qt version inside of the Sitara Linux SDK
qmake : matrix_browser.pro //qmake target depends on matrix_browser.pro @ . ${ENV_SETUP}; \ //source the environment-setup script using a shell qmake2 CONFIG+=debug_and_release QMAKE_CXXFLAGS_DEBUG+=-D${PLATFORM_DEFINE} QMAKE_CXXFLAGS_RELEASE+=-D${PLATFORM_DEFINE} matrix_browser.pro //call qmake2 to make the project Makefiles
Installing to the Target File System[edit]
Depending on your file system type you can use the methods below to install the matrix_browser executable. If the file system is NFS you should have first run the SDK Setup Script
- Create a Make Target using the steps in the Creating a New Make Target section above
- Browsing to the <SDK INSTALL DIR>/example-applications/matrix-gui-browser-x.x/ directory in a terminal and typing make -f Makefile.build install
- For all file system types you can also transfer the file using the drag-and-drop method of Remote System Explorer. See the Remote System Explorer section below for more details
Importing C/C++ Projects[edit]
Importing the Projects[edit]
The following instructions will help you to import the example C/C++ application projects into CCSv5. For instructions on importing Qt application see the Importing Qt Projects section above.
- From the main CCSv5 window, select File -> Import... menu item to open the import dialog
- Select the General -> Existing Projects into Workspace option
- Click Next
- On the Import Projects page click Browse
- In the file browser window that is opened navigate to the <SDK INSTALL DIR>/example-applications directory and click OK
- The Projects: list will now be populated with the projects found.
- NOTE: The matrix_browser, qtquickplayground, refresh_screen, and thermostatdemo projects should be un-checked since they are Qt projects and should be imported using the steps in the Importing Qt Projects section above.
Your Sitara SDK installation probably contains other Qt projects which need to be unchecked when importing C/C++ projects. You can tell which are the Qt
projects. Qt projects have a .PRO project file.
Select the projects you want to import. The following screen capture shows importing all of the example projects for an ARM-Cortex device, excluding the Qt projects.
- Click Finish to import all of the selected projects.
- You can now see all of the projects listed in the Project Explorer tab.
Building C/C++ Projects[edit]
- Right-Click on the project in the Project Explorer
- Select the build configuration you want to use
- For Release builds: Build Configurations -> Set Active -> Release
- For Debug builds: Build Configurations -> Set Active -> Debug
- Select Project -> Build Project to build the highlighted project
- NOTE: You can use Project -> Build All to build all of the projects in the Project Explorer
Installing C/C++ Projects[edit]
There are several methods for copying the executable files to the target file system:
- Use the top-level Makefile in the SDK install directory. See the Top-Level Makefile section for details of using the top-level Makefile to install files to a target file system.
- NOTE: The top-level Makefile uses the install commands in the component Makefiles and can be used as a reference for how to invoke the install commands.
- For all file system types you can also transfer the file using the drag-and-drop method of Remote System Explorer. See the Remote System Explorer section below for more details
Creating a New Project[edit]
This section will cover how to create a new cross-compile project to build a simple Hello World application for the target.
Configuring the Project[edit]
- From the main CCSv5 window, select File -> New -> Project... menu item
- in the Select a wizard window select the C/C++ -> C Project wizard
- Click Next
- In the C Project dialog set the following values:
- Click Next
- In the Command dialog set the following values:
- Tool command prefix: arm-linux-gnueabihf-. Note the the prefix ends with a "-". This is the prefix of the cross-compiler tools as will be seen when setting the Tool command path
- Tool command path: <SDK INSTALL DIR>/linux-devkit/sysroot/i686-arago-linux/usr/bin. Use the Browse.. button to browse to the Sitra Linux SDK installation directory and then to the linux-devkit/bin directory. You should see a list of tools such as gcc with the prefix you entered above.
- Click Next
- In the Select Configurations dialog you can take the default Debug and Release configurations or add/remove more if you want.
- Click Finish
Adding Sources to the Project[edit]
- After completing the steps above you should now have a helloworld project in your CCS Project Explorer window, but the project has no sources.
- From the main CCSv5 window select File -> New -> Source File menu item
- In the Source File dialog set the Source file: setting to helloworld.c
- Click Finish
Cross-Compiling the Sources[edit]
- After completing the steps above you will have a template helloworld.c file. Add your code to this file like the image below:
- Change the build configuration to Release by selecting Project -> Build Configurations -> Set Active -> Release
- Compile the helloworld project by selecting Project -> Build Project
- The resulting executable can be found in the Release directory
- You can now install the executable to the target file system using Remote System Explorer, NFS, or any other method you want.
Remote System Explorer[edit]
CCSv5 as installed with this SDK includes the Remote System Explorer (RSE) plug-in. RSE provides drag-and-drop access to the target file system as well as remote shell and remote terminal views within CCS. Refer to How to Setup and Use Remote System Explorer to establish a connection to your target EVM and start using RSE.
Using GDB Server in CCSv5 for Linux Debugging[edit]
In order to debug Linux code using Code Composer Studio v5, you first need to configure the gdbserver on both the host and target (EVM) side.
Please refer to Running GDB Server on CCSv5 for more information.
Archived versions[edit]
- Sitara SDK 08.00 CCSv5 User Guide (archived)
- Sitara SDK 05.07 CCSv5 User Guide (archived)
- Sitara SDK 05.03 CCSv5 User Guide (archived)
- Sitara SDK 05.02 CCSv5 User Guide (archived)