C2000 Getting Started with Code Composer Studio v4

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Chinese (中文) translation

Contents

Introduction

Because Code Composer Studio v4.0 (CCSv4) is now based on the open-source Eclipse 3.2 IDE, there are a number of changes between Code Composer Studio v3.x (CCSv3.x) upon which all legacy C2000 collateral is based. This wiki explains in detail how C2000 collateral can be migrated from CCSv3.x to CCSv4, and helps users get started with their first CCSv4.0 programs.

For all generic CCSv4 topics which are not C2000-specific, or to better understand CCSv4 in more detail, please visit the Code Composer Studio Wiki at:

Starting Up CCSv4

Select a workspace

When you first open CCSv4, a dialog box will prompt you to select a workspace. This is a folder where all of your CCSv4 custom settings will be saved for your specific personal computer. This includes all of your project settings, macros, and views when you shut down CCSv4. For instance, if you have several projects + memory windows + graph window + watch variables that you were working with when you closed CCSv4, these same projects and settings will be available when you re-open CCSV4.

1 workspace launcher.jpg

Workspaces save automatically when you close CCSv4. If you don't want to overwrite the settings you have for a current workspace, you can open/ switch to a new workspace by going to: "File-> Switch Workspace".

Note that workspaces are not portable in CCSv4 because they contain data specific to your computer system. So you cannot save a workspace, zip it up, and send it to another user.

Run Your First C2000 Project in CCSv4

Open the CCSv4 cpu_timer project included with the C2833x/2823x C/C++ Header Files and Peripheral Examples (v1.30 or later)


2 import existing.jpg



3 import ccsv4 existing.jpg



4 example projectview.jpg


Set up the Target Configuration Options for Device Emulation

5 target configuration.jpg



6 basic target config setup.jpg


7 link target config.jpg


Build and Load Project


8 debug toolbar.jpg



9 build active project.jpg



10 launch debugger.jpg



11 connect target.jpg


Reset the CPU

Select “Target->Reset->Reset CPU” to reset the device. To restart the program, select “Target->Restart”.

Add Watch Variables to Watch Window


12 debug perspective.jpg



13 add watch exp.jpg


Enable real-time mode to monitor the watch variables as they are changing

14 realtime options.jpg


15 cont refresh interval.jpg

16 refresh icon.jpg

Run the program

17 run icon.jpg

18 example watchwindow.jpg


Migrating C2000 Projects from CCSv3.3 to CCSv4

Code Composer Studio v4 allows users to migrate projects from CCSv3.3 to CCSv4. The user has the flexibility of migrating a single project at a time or multiple projects at once. This way, if there are many projects in a single directory which need conversion from CCSv3.x to CCSv4, in one run, all the projects can be easily migrated.

To start the migration process, go to “Project->Import Legacy CCSv3.3 Project” to open the Project Migration Wizard.

19 migrate project.jpg

Migrating a Single Project from CCSv3.3 to CCSv4

20 select pjt migrate.jpg

21 migrate codegentools.jpg

22 migrate dspbios.jpg

23 singleproject commonroot.jpg

  1. .cdtproject
  2. .cdtbuild
  3. .project
  4. Any source files and header files (.c,.asm,.h,.inc,.cmd,.lib, etc.) in the project directory

There is no need to keep the CCSv3.3 .pjt file.


Migrating Multiple Projects at Once from CCSv3.3 to CCSv4

Migrate multiple pjts.jpg

Multiple pjts common root.jpg

For instance, the below figure shows the directory file structure for the projects being migrated. All projects to be migrated for this example are located in individual folders in the “DSP2833x_examples” directory. All of these projects include common header, source files, and libraries, under the DSP2833x_common and DSP2833x_headers directories which, in turn, are located under the “v130” root directory.

Directory structure.jpg

Because all the projects being migrated use common files under the “C:/tidcs/c28/DSP2833x/v130” root directory, the “Path” specified should be “C:/tidcs/c28/DSP2833x/v130”. Select also, a unique “Path-variable name”, which serves as a macro/replacement name for typing out the entire path. For this example, we have chosen “INSTALLROOT_2833X_V130”.

Note: In a given workspace, a path variable name/macro can only be defined only once for a particular path. In other words, “INSTALLROOT_2833X_V130” cannot be defined again for another project for a different path in the same workspace. Instead, a different path variable/macro must be defined. You can read more about macros and their usefulness when transferring projects from user to user or PC to PC on the following page: Portable Projects in CCSv4 for C2000.

When finished, click the “Finish” button.

  1. .cdtproject
  2. .cdtbuild
  3. .project
  4. Any source files and header files (.c,.asm,.h,.inc,.cmd,.lib, etc.) in the project directory

There is no need to keep any CCSv3.3 .pjt files.

Known Migration Issues

"No rule to make target" Error

The following build error(s) may occur with some imported projects:

C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake -k all

C:\Program Files\Texas Instruments\ccsv4\utils\gmake\gmake: *** No rule to make target `myFile.obj', needed by `myApp.out'.

...

In those cases, right-click on the project with errors and select "Build Properties" from the menu. Under "C2000 Compiler->Directory Specifier:", examine the contents of the "Object file directory (default is .)(--obj_directory, -fr)". If the directory is identical to the contents of "Temporary file directory" or "Assembly file directory" (i.e. "<path>/Debug"), then there will be an error.

You can resolve the issue by:

  1. Changing this path to any other location.
  2. Delete contents of the box.
Fig. 15: Build Properties - Object File Directory

Missing Source Files Caused by References to DSP BIOS

By default, DSP/BIOS is not supported in the Microcontroller Core (code-size limited) version of CCStudio v4.0.0 as of RTM (July 20, 2009).

The problem is:

  1. If you are using the Microcontroller Core (code size limited) version of CCStudio v4.0, while migrating your project which has the reference to Tool="DspBiosBuilder" at the top of the .pjt file, you will receive a screen titled "Select DSP/BIOS Tools" with your example name next to a "Tool Version" of "0.0.0". The project appears to finish migrating, but none of your source files will link properly to your project, and building the project will fail.
  2. If you are using the full Platinum version of CCStudio V4.0, your project will migrate fine, and the migration tool will automatically fill in the DSP/BIOS tool version with whatever version fo DSP/BIOS has been installed with CCStudio v4.0. The project will also build fine. BUT: if you send your CCSv4 project to anyone using the Microcontroller Core version of CCStudio v4.0, they will not be able to build the project.

If your .PJT file has the text: Tool="DspBiosBuilder" near the top under the [Project Settings] category:

  1. Remove this before running the project migration tool in Code Composer Studio v4.x. OR
  2. Download DSP/BIOS 5.40 and XDCtools/RTSC into the same directory as your /ccsv4/ folder (default is C:/Program Files/Texas Instruments/) and restart CCSv4. The download link is: Download DSP/BIOS and XDCtools/RTSC here.

NOTE: This issue will be resolved in Code Composer Studio v4.0.1 which will be issued to Code Composer Studio v4.0.0 users via an auto-notification patch download. At that time, the Microcontroller Core (Code-size limited) version of Code Composer Studio will no longer have migration issues with CCSv3.3 projects which included references to the DspBiosBuilder tool.

Errors with "hello world" project using F281x Devices

Users who attempt to build the generic "hello world" template project via Code Composer Studio v4 Getting Started while setting any of the 281x (2812, 2811, 2810) devices as the target processor, may see the following errors:

"../2812_RAM_lnk.cmd", line 86: error: placement fails for object ".text", size

0x182a (page 0). Available ranges:

PRAMH0 size: 0xffe unused: 0xf89 max hole: 0xf89

error: errors encountered during linking; "Test.out" not built

This is because the "printf" command used in the "hello world" project takes a large amount of memory which is not available on the 2812 devices. The 281x linker command file, 2812_RAM_lnk.cmd, by default does not define enough memory for code (.text) to support the "printf" command.

For getting started on the 2812, users should instead start with the CCSv4 peripheral examples in the 2812 C/C++ Header Files and Peripheral Examples software package. A good "first project" to get started with is the "cpu timer" project following the same instructions on this wiki page as were used for 2833x devices.

Portable Projects in CCSv4 for C2000 (macros/linked variables/etc.)

Refer to: Portable Projects in CCSv4 for C2000.

Target Configurations: Device Target and Emulation Setup

With Code Composer Studio v3.3, in order to configure the device emulation settings for a target, the user must open the Setup CCStudio v3.3 utility, which is independent of the Code Composer Studio IDE to select the correct emulator and device GEL file for CCStudio. This then requires the user to close the CCStudio IDE and run the setup utility every time the target or emulator changes.

Code Composer Studio v4 includes emulator target configuration within the CCSv4 IDE itself. The user can specify different target configurations for different emulators and device settings either for general use, or for specific projects.

To see existing Target Configurations on your computer:

  1. Go to “View-> Target Configurations”.
  2. Any target configurations you have created will be under “User Defined”.

Target configurations view.jpg

To create a new target configuration (this MUST be done prior to anything you do on any device):

  1. Go to “Target-> New Target Configuration” OR in the Target Configurations window, click on the “New” icon (leftmost icon in toolbar at top of window): Target config new icon.jpg
  2. Select a File Name for your target configuration (for instance, F28335_XDS510USB.ccxml, if you are using an F28335 device and an XDS510USB emulator).
  3. Then select the “Use shared location” checkbox to save your new target configuration to the default location on your PC where CCSv4 looks for target configuration files, OR uncheck the box and select a project to associate the target configuration file to a particular project in the workspace.
  4. Hit the “Finish” button and follow the instructions on the “Cheat Sheet” that appears to select your “Connection” (emulator) and “Device”.

Programming to C28x Flash

An improvement in CCSv4 over CCSv3.3 is that the flash-programmer plug-in is now built into CCSv4. When you debug a project which has its source code and command linker file configured for flash memory, you no longer need to load the symbols only and then separately use the flash programmer plugin to program the code to flash. Instead, as long as the correct device target configuration is loaded, if CCSv4 detects that there is code in flash memory via the command linker file in your project, it will automatically program the relevant code to flash when you load your program.

To set up the flash programming settings and program to flash memory in CCSv4:

  1. First ensure that your target configuration is set up properly for your device.
  2. Go to "Target-> Launch TI Debugger"
  3. In Debug view, go to "Tools->On-chip Flash"
  4. Configure Flash settings – you can erase Flash from here as well.
  5. Then you can either: Click on the Debug “bug” icon, or Go to "Target->Debug Active Project", OR Go to "Target->Load program" and select the .out file you want to program. The CCSv4 IDE will automatically program/load the code to the appropriate memory locations in flash and/or RAM, similar to how code is automatically loaded to RAM for RAM-based projects.


Flash options.jpg


Note: Source code and linker command files still have to be pre-configured for Flash options the same as with CCSv3.3 (For instructions on how to do this, see your device-specific C/C++ Header Files and Peripheral Examples Quickstart Readme document located in the /docs folder of the install package)

For more information on Flash Programming for the 28x with CCSv4, visit the Code Composer Studio v4 Wiki page link: Flash_Programming_F28x

C2000 GEL File Migration

The device gel files from CCSv3.3 still work with CCSv4.0. Calls to manipulate projects (i.e. Build Project) and “WatchAdd()” functions to add variables to the watch window are no longer supported. GEL hotmenu items now appear in the “Scripts” pull-down menu.

More information on GEL files, including how to load GELs and which GEL functions are still supported can be found at the CCSv4 GEL Wiki page here: GEL

Register WatchAdd() in Device GEL Replaced by View->Registers

The C2000 device GEL files include “WatchAdd()” functions to all the peripheral registers, allowing the user to quickly add any peripheral’s registers to the watch window in CCSv3.x when not using the TI-provided C/C++ header files. Because the WatchAdd() function no longer works in CCSV4, the peripheral registers are now available via the Registers window, which can be accessed from "View->Registers". If using the TI-provided C/C++ header files (downloadable from device product folders on the TI website) while debugging, register structures defined in the header files can also be added to the Watch Window same as before. Expanding these register structures allows access to individual bit fields as well (i.e., adding "AdcRegs" to the Watch Window, will display all the ADC registers and their bit field expansions).

Enabling Function Profiling with CCSv4 for C28x Devices

HW Function Profiling is breakpoint based and not recommended for cases where there are a limited amount of breakpoints available (such as code in persistent memory like flash).
Note that function profiling for C28x is not officially supported (untested).
For other profiling options please visit the Profiling on C28x Targets wiki page.
If you wish to try this feature, enable it by taking the following steps:
  1. Browse to <INSTALL DIR>\ccsv4\DebugServer\bin\win32\SerializedProfileActivities
  2. Open 'ProfileFunctionsHW.prof_ini' in a text editor
  3. Under the list of ISA, add 'TMS320C28' to the list
  4. Save file and restart CCSv4
  5. The 'ProfileFunctionsHW.prof_ini' would now look something like:
[Name]
Profile all Functions for CPU Cycles 

[Events]
dataclass.pcdt.events.Cycles
dataclass.pcdt.events.CPU Cycles
dataclass.pcdt.events.cycle.Total

[EventClasses]
pcdt

[ISA]
TMS320C28
TMS320C56
TMS320C55
TMS320C621x
TMS320C641x
TMS320C671x
TMS470R1
TMS470R2
TMS470R3
TMS470Rd
TMS470Re

Other Resources

To discuss technical questions, the E2E Community is a great resource. Visit e2e.ti.com.




Forums on the E2E site include:

and many more...


CN C2000 Getting Started with Code Composer Studio v4

E2e.jpg For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article C2000 Getting Started with Code Composer Studio v4 here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox