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

From Texas Instruments Wiki
Jump to: navigation, search

TIBanner.png

Return to the Sitara Linux Software Developer's Guide


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.

Download-page.png

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:

  1. Place the CCS tarball (the .tar.gz file) in the same directory as the Sitara Linux SDK installer
  2. 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.

Sitara-Linux-CCS-Install-SDK.png

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:

  1. 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.
  2. 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
  3. 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.

  1. 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.
    Sitara-Linux-CCS-Install-License.png
  2. At the Choose Installation Location screen do NOT check Add TI plug-ins into an existing Eclipse install
    Sitara-Linux-CCS-Install-Location.png
  3. At the Processor Support screen make sure to select the AMxx Cortex-A and ARM9 processors option
    Sitara-Linux-CCS-Install-Processor.png
  4. 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.
    Sitara-Linux-CCS-Install-Components.png
  5. 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.
    Sitara-Linux-CCS-Install-Emulator.png
  6. At the CCS Install Options screen verify that the options look correct and then select Next to begin installation.
    Sitara-Linux-CCS-Install-Options.png
  7. 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:

Sitara-Linux-CCS-icon.png

To launch CCS you should:

  1. Double-Click the CCS icon on the desktop. You will see the CCSv5 splash screen appear while CCS loads
    Sitara-Linux-CCS-splash-screen.png
  2. 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.
    Workspace-Launcher.png
  3. CCS will load the workspace and then launch to the default TI Resource Explorer screen
    Sitara-Linux-CCS-resource-explorer.png
  4. 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.
    Sitara-Linux-CCS-project-explorer.png

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:

  1. Open the Window -> Preferences menu
    Sitara-Linux-CCS-window-preferences.png
  2. Go to the General -> Capabilities menu
    Sitara-Linux-CCS-general-capabilities.png
  3. Select the RSE Project Capability
    Sitara-Linux-CCS-enable-rse.png
  4. 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.


Sitara-Linux-CCS-open-perspective.png

 

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]

  1. First import the Qt project using the File -> Import... menu
  2. Select the Qt -> Qt Project option
    Sitara-Linux-CCS-import-qt.png
  3. Press the Next > button
  4. 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
    Select-Qt-Project-File.png
  5. Click OK
  6. You should now see the matrix_browser project listed as being selected for import into CCS
    Qt-Import-Wizard.png
  7. Click Finish to import the matrix-gui-browser project
  8. You should now see the matrix_browser project in the Project view
    Sitara-Linux-CCS-matrix-browser.png
  9. 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
    Preferences-1.png
  10. Select the Add... button
  11. In the Add new Qt version dialog fill in:
    Version Name: AMSDK Qt
    Bin Path: <SDK INSTALL DIR>/linux-devkit/sysroot/i686-arago-linux/usr/bin
    Include Path: <SDK INSTALL DIR>/linux-devkit/sysroot/armv<board specific value>-oe-linux-gnueabi/usr/include/qtopia
    New-Qt-Version.png
  12. Click Finish
  13. Click Apply
  14. When prompted that Qt versions have changed select Yes
  15. 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:

  1. Right Click matrix_browser project
  2. Select Make Targets -> Build...
    Sitara-Linux-CCS-make-target.png
  3. Highlight Qt Release Build and click the Build button
    Sitara-Linux-CCS-release-build.png
  4. You will find the matrix_browser executable built in the matrix_browser project.
    Sitara-Linux-CCS-matrix-build.png

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.

  1. Right click matrix_browser project and select Make Targets -> Create...
    Sitara-Linux-CCS-make-target.png
  2. In the dialog box set:
    Target name: install
    Check Same as the target name for the Make Target
    un-check Use builder settings
    Change Build command: to make -f Makefile.build install
    Sitara-Linux-CCS-make-install.png
  3. 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

  1. Create a Make Target using the steps in the Creating a New Make Target section above
  2. Browsing to the <SDK INSTALL DIR>/example-applications/matrix-gui-browser-x.x/ directory in a terminal and typing make -f Makefile.build install
  3. 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.

  1. From the main CCSv5 window, select File -> Import... menu item to open the import dialog
  2. Select the General -> Existing Projects into Workspace option
    Import C projects-1.png
  3. Click Next
  4. On the Import Projects page click Browse
    Sitara-Linux-CCS-import-c.png
  5. In the file browser window that is opened navigate to the <SDK INSTALL DIR>/example-applications directory and click OK
    Example-applications.png
  6. The Projects: list will now be populated with the projects found.
    Import-2.png 

 

  • 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.


Import-Qt.png


  1. Click Finish to import all of the selected projects.
  2. You can now see all of the projects listed in the Project Explorer tab.
    Projects-imported.png

Building C/C++ Projects[edit]

  1. Right-Click on the project in the Project Explorer
  2. Select the build configuration you want to use
    • For Release builds: Build Configurations -> Set Active -> Release
    • For Debug builds: Build Configurations -> Set Active -> Debug
  3. 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:

  1. 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.
  2. 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]

  1. From the main CCSv5 window, select File -> New -> Project... menu item
  2. in the Select a wizard window select the C/C++ -> C Project wizard
    Sitara-Linux-CCS-new-c-project.png
  3. Click Next
  4. In the C Project dialog set the following values:
    Project Name: helloworld
    Project type: Cross-Compile Project
    Sitara-Linux-CCS-cross-compile.png
  5. Click Next
  6. 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.
    Sitara-Linux-CCS-command-setup.png
  7. Click Next
  8. In the Select Configurations dialog you can take the default Debug and Release configurations or add/remove more if you want.
    Sitara-Linux-CCS-select-configurations.png
  9. Click Finish

Adding Sources to the Project[edit]

  1. After completing the steps above you should now have a helloworld project in your CCS Project Explorer window, but the project has no sources.
    Sitara-Linux-CCS-empty-helloworld.png
  2. From the main CCSv5 window select File -> New -> Source File menu item
  3. In the Source File dialog set the Source file: setting to helloworld.c
    Sitara-Linux-CCS-helloworld-c-file.png
  4. Click Finish

Cross-Compiling the Sources[edit]

  1. After completing the steps above you will have a template helloworld.c file. Add your code to this file like the image below:
    Sitara-Linux-CCS-helloworld.png
  2. Change the build configuration to Release by selecting Project -> Build Configurations -> Set Active -> Release
  3. Compile the helloworld project by selecting Project -> Build Project
  4. The resulting executable can be found in the Release directory
    Sitara-Linux-CCS-helloworld-built.png
  5. 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]



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 Code Composer Studio v5 Users Guide 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 Code Composer Studio v5 Users Guide here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Code Composer Studio v5 Users Guide here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Code Composer Studio v5 Users Guide here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Code Composer Studio v5 Users Guide here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Code Composer Studio v5 Users Guide here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Code Composer Studio v5 Users Guide here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Code Composer Studio v5 Users Guide here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Code Composer Studio v5 Users Guide 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