Code Composer Studio v4

Tips & Tricks

• • • • • • Introduction Resources Getting support Tips & Tricks Troubleshooting Q&A

Code Composer Studio
• Why Eclipse?
– – – – Quickly becoming a standard for IDEs Excellent software architecture Ability to leverage the work of others Wide selection of 3rd party plug-ins available

• What device families does CCS support?
– MSP430, C6000, C5000, C28x, DaVinci, Sitara, OMAP, TMS470, TMS570, CortexR4F, Stellaris…

• Future Direction
– CCSv5 will be based on the latest version of Eclipse
• Provide more capabilities to customers • Better compatibility with other Eclipse based tools • We will not make changes to standard Eclipse components

– Linux host support



Key Features & Benefits
• Superior code development environment speeds design and troubleshooting with an advanced editor and features such as code completion, code folding, local history of source changes, markers and the ability to associate tasks with source lines. Advanced GUI framework simplifies data and project management through the creation of perspectives with full customization of menus, toolbars and 'fast views' that enable developers to define the functionality and views appropriate to specific tasks. Extend the environment with a wide selection of plug-ins including static code analysis, source code control, modeling and scripting development. Multi-processor debugging intelligently manages status and information from multiple cores without the confusion that arises when each core requires its own separate debugger. Debug server scripting interface enables the automation of common tasks such as code validation and profiling. Update manager tool automatically manages tool updates.

• •

• •

#1 Resource for Information
• CCSv4 Mediawiki
– mposer_Studio_v4 – Documentation – FAQs – License info – Training – Downloads

• Tip: Offline version
– • Before posting a question check if the question is already answered – Check the FAQs and topics on the wiki – Search the e2e forums • Check the status of a bug – https://cqweb. factory engineers and customers all working together • Support forums – Post a question or issue to the Code Composer Studio or TI C/C++ Compiler forums on e2e community – www.html – Can create your own queries to track issues important to you .com/pages/SDO-Web.Getting Support • Community support model – Collaboration – FAEs.ext. applications engineers.


Basics • Main working folder for CCSv4 • Contains information to manage all the projects defined to it – The default location of any new projects created • User preferences. custom perspectives. etc all stored in the workspace • Multiple workspaces can be maintained – Only one can be active within each CCS instance – The same workspace cannot be shared by multiple running instances of CCS • Good idea to use multiple workspaces! .Workspaces . cached data for plug-ins.

Using Multiple Workspaces • Multiple Users: Keep separate workspaces for each user on a shared machine – Custom preferences. etc will be maintained on a per user basis – Each user can be working on specific project(s) that would only be applicable to a their workspace • Project Organization: Break up all your CCS projects into separate workspaces for better maintenance – A workspace for each software release – A workspace for each module/feature of a release – etc • Performance: The larger the contents of the workspace (number of open projects). the greater the impact on performance of CCS . layouts.

Detached: Like having float in main window off in CCSv3 .Window Types Editor: Only editor windows are part of this group Tab Group: Several windows grouped together Fast view: Hidden until you click on the button to restore them. Click on another window to hide.

Windowing tips • Double-clicking on the title bar of a window will maximize the window – Double-clicking again will restore it to its previous size • Fast-view windows are great for windows you use infrequently but need a lot of space when you do use them • The window that has focus is indicated by a blue border and heading Current window .

Customizing Perspectives • You can customize the menu items and toolbars in your perspective – Right click on the toolbar – select customize perspective • Change keyboard shortcuts – Window->Preferences – search for “keys” .

Accessing Views • To open a new view go to the Windows -> Show View Menu – Common views for the current perspective – Recently opened views • To access views that are not listed select Other… • The ‘View’ main menu has a subset of the most popular views .

*) .C/C++ Projects View • Displays all projects defined in the active workspace • The view is mostly a representation of the file system of the project folder – Linked files are marked with a special arrow graphic in the icon • Use filters to hide various file types to reduce clutter in the view – Default is to filter CCS generated project files (.

make sure to uncheck the ‘Use Default Location’ option when creating a new project.g. in a source controlled directory). The user can then specify the location of where to create the project • Adding file to project – Copies the file into your project folder • Linking file to project – Makes a reference to the file in your project – File stays in its original location .Project Tips • Projects are created inside the workspace directory by default – To create a CCS project outside of the workspace directory (e.

they are easily shared – The entire project folder can be distributed to another “as-is” – The user who receives the project can import it into their workspace using ‘Project -> Import Existing CCE/CCS Project’ and selecting the copied folder – This would work well for relatively simple projects that do not refer to other projects or files outside the file structure of the project .Sharing Projects – Simple Projects • For projects that conform to standard Eclipse behaviour (no linked files).

What happens is that it will import the project into your workspace. Project -> Import Existing CCS/CCE Eclipse Project Change the radio button selection at the top to "Select archive file" Browse to and select your archive file It will list all of the projects found in the archive.Sharing Projects – Linked File Projects • Use the CCS Export Project to create an archive (zip) file that contains the project folder and all project linked source files Exporting your project – – – – – – These instructions cover how to archive your project on the source computer. Click "Next" The dialog that appears allows you to select which projects you wish to export to the archive. Check the box beside the project to indicate that you want to archive it. then click "Finish" You now have a zip file on your computer containing the project. The are all selected by default. For linked/referenced resources it will copy those files from the archive in place then at the same path where they were located on the original computer. File -> Export Expand "General" and select "Archive File". Not only did it copy in the files that are physically located in your project directory but it also copied in your linked/referenced resources • • Importing the project on another machine – These instructions cover how to import the project from the archive. Specify a name for your archive and select either zip or tar. When you select a project it will show you on the right hand side all of the items it is going to export. Select the ones you want and click "Finish" The project is now in your workspace – – – – – • Note that this technique will fail if Linked Path variables are used! .

Portable Projects – Linked Files • When you link files it creates an absolute path in the project file – Not a problem if you plan on exporting your project + source (see previous slide) – Otherwise it can cause problems sharing just the project file(s) only • Avoid this by using Linked Path variables to contain the paths and have the project reference the linked file using the path .

Portable Projects – Linked Files • Link your file to the project using the variable via ‘New->File’: #4: Select the variable and hit ‘Extend’ #5: Select the desired file in that variable path and hit ‘OK’ #1: Click ‘Advanced’ #2: Check this option #3: Click ‘Variables’ .

Portable Projects – Linked Files • The project will reference the linked file using the Linked Path variable. instead of an absolute path • Looking at the file properties for the linked source file will show that is using the Linked Path variable .

ini’ file .ini is found in the root project location. it will auto-add any variables defined in the file to the Linked Resources list – TIP: Relative paths are supported in the ‘macro.Portable Projects – Automated Definition of Linked Path Variables • Use ‘macro.ini’ files to enable auto-definition of Linked Path variables on project import into another workspace – When a project is being imported (via Import Wizard) and a macros.

Portable Projects – Environment Variables Macros • Avoid absolute paths in the build options by using Environment Variables and Macros • Every project automatically defines a number of different macros that can be used in build options .

Portable Projects – Using Macros • There are Configuration and Project level macros – User may also define their own macros similarly to how linked resource path variables are defined .

settings folder is a standard Eclipse folder that contains settings that apply to the project.launches directory is generated when you start a debug session. It is not related to the build of your project and is not necessary to check in – The contents of the project configuration folder (Debug/Release) does not need to be checked in .project are all Eclipse CDT project files and should be checked in – . This folder should be checked in – .cdtproject.cdtbuild.ccsproject is a CCS specific project file that should be checked in – .Version Control – Check in Which Files? • Several files/folders are generated by CCS inside the project folder – . . .

Advanced Editor Features • Code Completion – – – – – – – – Complete word Auto-member information Auto-parameter information … Back/Forward buttons Back to last edit button Go to definition Go to declaration • Navigation • Show line numbers • Code Folding – Collapse functions .

Local History • • CCS keeps a local history of source changes You can compare your current source file against any previous version or replace it with any previous version – – Double-click on a revision to open it in the editor Right-click on a revision to compare that revision to the current version File Comparer ‘History’ view .

Edit Markers • If you have the line number column on it also indicates changes in your source file since your last save Modified lines Deleted lines Inserted lines .

copied and opened for inspection (XML files) • Quick way of starting a debugger is to right click on target configuration in Target Configuration View and select “Launch Selected Configuration” • Launch TI Debugger will use target configuration that is identified with [Default] tag in Target Configurations View – Right click on a file and select “Set as Default” to make it the default .Target Configurations • Target configurations easily deleted.

ccxml and select Debug As ->Debug Session .Project Specific • Debug Active project will use projects [Active] configuration or [Default] if [Active] does not exist • [Active] configuration may be set only in a project • There may be multiple target configurations in a project but only one that is [Active] • Quick way of starting only a debugger with project configuration is to right click on .Target Configurations .

Target Configurations .Basic • Basic tab is intended for majority of users where simpler choices are provided to configure targets • Use drop down menus to select: – Connection – Device • Use the filter box to filter the list of devices .

Target Configurations .Advanced • Adjust default properties of the target configuration: – – – – – Specify initialization files (GEL startup files) Specify IcePick subpath port numbers Bypass CPU Set JTAG TCLK Frequency etc… .

Advanced • The ‘Advanced Setup’ utility can be used when the desired options for the 'Connection' or 'Device' are not be available for a specific emulator and device combination in the ‘Basic’ tab – Select from a list of available 'Connections' to specify the connection type – Then select from the list of components ('Devices'. 'CPUs'.Target Configurations . 'Routers') to add to the connection to complete the configuration • Use the ‘Advanced Setup’ to create a single target configuration using two emulators • The 'Advanced Setup' utility requires the user to have good knowledge of the device they are building their configuration for .

CCS Project Debug Properties • The project debug properties defines the debugger settings when starting a debug session for the project (“Debug Active Project”) .

CCS Debug – Main Options • Use the ‘Main’ tab to specify the executable to load when starting a debug session – Default name is the name of the executable generated by CCS – This tab only exists for project debug session launches .

CCS Debug – Debugger Options • Use the ‘Debugger’ tab to: – Specify which CPU to load the executable on (for multi-core devices) – Specify to load the program (default) or just symbols only (to debug code in flash. etc) .

autoconnect to a HW target. program verification on load. real-time options.CCS Debug – Target Options • The ‘Target’ tab can be used to set a variety of debug options like auto-run to main. etc… .

CCS Debug – Source Options • The ‘Source’ tab allows you to add additional source lookup search paths – All paths to any source files in your project are automatically added by default .

CCS Debug – Common Options • The ‘Common’ tab contains a bunch of miscellaneous options – Can specify the debugger to send all CIO to a file instead of the console .

Launching the Debugger • Debug Active Project – Automated debugger launch • Connects to appropriate target in your system setup • Loads program • Runs to main (optional) • Launch TI Debugger – Manual debugger launch (no other actions performed) for the default configuration – Also launched from the Target Configuration view context menu • Automatic perspective switch – CCS switches to the debug perspective when the debugger is launched (configurable) .

Launching the Debugger • When a debug session is first started. it caches the information on which target configuration to use. debug settings. This is a launch • A launch entry will appear in the list of most recent launches and a debug session can be started by selecting a launch • Launch options can be modified with the ‘Debug’ option . etc.

it will be indicated in the editor The ‘Locate the Source File…’ button can be used to browse the location of the source file – The debugger can then find other source files in the same location or use relative path information to find files relative to the current file The location selected will be remembered by the debugger upon loading the same executable • – .Source Lookup Paths: Method #1 (recommended) • If a source file cannot be found during debug.

Source Lookup Paths: Method #2 – Per Debug Context • Source lookup paths can also be explicitly specified for each debug context Right-click in the ‘Debug’ view and select ‘Edit Source Lookup…’ in the context menu To add a file system path. select ‘File System Directory’ to browse to and add paths For multi-core debugging. each debug context has its own set of source lookup paths • • • .

Source Lookup Paths Method #2 – Launch Configuration • Debug Properties->CCS Debug->Source • The ‘Source’ tab allows you to add additional source lookup search paths – All paths to any source files in your project are automatically added by default .

Source Lookup Paths Method #2 – Global Setting • Source lookup paths can also be set globally to apply for all debug contexts (in a multi-core environment) and debug sessions – ‘Windows->Preferences…->C/C++->Debug->Common Source Lookup Path .

the source file will be opened in the debugger .More Debugging: Source Lookup Paths • Once the path is known to the debugger (using either method).

Disassembly View Enter starting address or expression Switch between ASM only and mixed-mode Assembly stepping Scroll within current block .

3) – Control Profiling (set profile halt/resume points) – File I/O (Probe Points) – Run a GEL expression .Breakpoints View • View all available breakpoints • Can group breakpoints by CPU (multicore device) • Specify various actions when the breakpoint is triggered – Refresh All Windows or update a specific view (replaces “Animate” in CCS 3.

Console View • Multiple contexts – When the CPU is selected it operates as a GEL command interface to the debugger – When CIO is selected it shows CIO output – Automatically switches contexts • Can use the “pin” option to prevent this • You can open multiple console windows – Printfs in one and command interface in another .

Scripting Console • Command line operation of CCS • View->Scripting Console • Press TAB for a list of commands – Press TAB for partially typed commands for auto-complete feature • To get documentation for a command – js:> help <command> • JavaScript shell and has access to all DSS APIs • Create your own custom commands – Create a JavaScript function in a *.js file – Load the custom Javascript file • loadJSFile <full path>/myCustomConsoleCmd.js • Optional boolean second parameter that will auto-load the script – The function can now be called by name from inside the Scripting Console .

Scripting Console • Both the Scripting Console and GEL can be used for automation • GEL can be used only within an active debug session and (mostly) apply to a debug context • The Scripting Console can be used anytime (though certain commands will not work without a debug session) • Scripting Console and GEL can both add menus to the custom ‘Scripts’ – GEL: hotmenu <function> – Scripting Console: hotmenu.addJSFunction .

Little Endian". // configure for a TCI6488 Symmetric Simulator. debugSessionCPU1 = ds. "tci6488_be_sim()"). debugSessionCPU3 = ds. } … .addJSFunction("Launch TCI6488 Simulator.openSession("*". "C64+_0"). // Path to folder with target setup ccxml files var setupConfigFileFolder = "C:/Documents and Settings/login/user/CCSTargetConfigurations".openSession("*". "C64+_1"). debugSessionCPU2 = ds.ccxml").Scripting Console // Add entries to the 'Scripts' menu hotmenu.setConfig(setupConfigFileFolder + "/tci6488_le_sim. Big Endian". "tci6488_le_sim()"). hotmenu.addJSFunction("Launch TCI6488 Simulator.openSession("*". Little Endian function tci6488_le_sim() { ds. "C64+_2").

Debugger Options • Many debugging features (real-time mode. auto-run to main. etc) can be enabled from the Debugger Options • There are three places to configure the Debugger Options – Global: Windows->Preferences->CCS->Debug->Debugger Options->Generic – Debug/Launch Properties: (project)->Debug Properties – Current Session: Tools->Debugger Options->Generic Debugger Options • Use the “Remember My Settings” option to have the settings apply for subsequent debug sessions .

Eclipse Plug-ins . editors. etc) – Plug-ins strictly related to the IDE have good compatibility (code analysis. Perl development…) . modelling.1 – Look for plug-ins that support those versions for best chance of compatibility • CCSv4 is using modified version of Eclipse and CDT – Plug-ins related to debugging will have the most compatibility issues and are not recommended with CCSv4 (breakpoints. source code control.eclipseplugincentral.2 and CDT • CCSv4 is based off Eclipse 3.Basics • CCSv4 is based on Eclipse and is able to leverage many Eclipse of the huge selection of 3rd party plug-ins available – http://www.

Eclipse Plug-ins .\ccsv4\eclipse folder .Installation • Use the Eclipse Update Manager – Help->Software Updates->Find and Install->Search for new updates to install (specify remote site (URL) or local site (directory) • Many plug-ins are simply downloaded and copied into the .


metadata’ folder .Troubleshooting – User Interface • CCS user interface issues – Reset Perspective • Will reset the arrangement of windows. menus and toolbars to the TI defaults • Window -> Reset Perspective – Cleaning the workspace • Will remove metadata from the workspace which can get corrupted • Add –clean to the desktop shortcut (recommended) or • Delete the ‘.

cache file in the same directory as your .0 and 4.1. Occasionally this can get out of sync.1.1. debug settings… • Go to the down arrow beside the bug Select “Debug…” • Under “Project Debug Session” select the name of your project and press Delete – Register Cache • CCS creates a cache file of xml register data to speed launch time.Troubleshooting – Debugging • Issues with launching a debug session – Delete the debug “launch” • A launch is something that Eclipse creates when a debug session is created it caches the information on which target configuration to use.dat file – \ccsv4\common\targetdb (v4.TI (v4.1) – C:\Documents and Settings\<user>\Local Settings\Application Data\.ccxml file • Targetdb.2+) . • There is a .

Sign up to vote on this title
UsefulNot useful