Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.
- 1 Scripting Frequently Asked Questions
- 1.1 CCStudio Scripting Utility
- 1.1.1 Q: Does the CCStudio Scripting Utility support other COM based scripting languages?
- 1.1.2 Q: Is the behavior of TargetEvalExpression() synchronous or asynchronous?
- 1.1.3 Q: How come CCStudio Scripting gives an error when I try to use the built-in enumerators in my script?
- 1.1.4 Q: How can I make CCStudio Scripting use a specific CCStudio installation on a machine with multiple installations of CCStudio?
- 1.1.5 Q: My computer has multiple versions of CCStudio installed. How can I specify which installation gets launched by the CCStudio Scripting Utility?
- 1.1.6 Q: Why do my Perl scripts fail to work with the CCStudio Scripting Utility? I am using the latest version of the Scripting Utility.
- 1.1.7 Q: Why does the CCS Script running through a Perl or a Visual Basic script look to be hung when the target is running?
- 1.1.8 Q: Is there any way to script the Component Manager?
- 1.2 Debug Server Scripting
- 1.2.1 Q: Where do I get DSS?
- 1.2.2 Q: Which scripting languages are supported?
- 1.2.3 Q: Where are the DSS help files?
- 1.2.4 Q: What about existing GEL and CommandWindow? functionality?
- 1.2.5 Q: What is Rhino?
- 1.2.7 Q: Why are the generated log files XML?
- 1.1 CCStudio Scripting Utility
Scripting Frequently Asked Questions
CCStudio Scripting Utility
Q: Does the CCStudio Scripting Utility support other COM based scripting languages?
Q: Is the behavior of TargetEvalExpression() synchronous or asynchronous?
All the CCStudio Scripting API’s, including TargetEvalExpression(), are synchronous in behavior. TargetEvalExpression() waits for notification that the GEL function was evaluated then returns. However it is important to understand the GEL call being passed to TargetEvalExpression() because for built-in GEL calls that have asynchronous behavior, this notification returns right away whether the actual action is fully completed or not (such as GEL_Load() ). For synchronous GEL calls and custom GEL functions/actions, TargetEvalExpression() will wait until the call (and associated action) has been completed since notification will come then. For more understanding on the behavior of GEL and a list of asynchronous built-in GEL calls, please refer to the FAQ: Is the behavior of GEL synchronous or asynchronous?
Q: How come CCStudio Scripting gives an error when I try to use the built-in enumerators in my script?
When you use a scripting language that supports early binding, your code can refer to the built-in enumerators provided by CCS Scripting. If you use a scripting language that supports late binding, you must define these constants in your code by looking up the enumerator values in the documentation.
Perl and Visual Basic (both VB and VBA) are examples of scripting languages that support early binding (VB and VBA supports both early and late binding). Windows Script Host JScript and VBScript are examples of scripting languages that only support late binding.
For more information regarding the differences between VB, VBA and VBScript, please refer to this FAQ on the MSDN Library: http://msdn.microsoft.com/isv/technology/vba/faq/default.aspx
Q: How can I make CCStudio Scripting use a specific CCStudio installation on a machine with multiple installations of CCStudio?
CCStudio Scripting will use the last CCStudio installation that ran on the machine. If there is only one installation of CCStudio, then it will always run the same installation. To make sure CCStudio Scripting calls the correct installation of CCStudio, manually open and close the installation of CCStudio that you would like to script.
Q: My computer has multiple versions of CCStudio installed. How can I specify which installation gets launched by the CCStudio Scripting Utility?
For computers with multiple installations of CCStudio, the Scripting Utility will launch the version of CCStudio that was run last. There is no explicit way to have the Scripting Utility launch a particular installation. To ensure that a desired installation of CCStudio is launched, launch that CCStudio version and close it before running the scripts.
Versions 1.4 or greater of the Scripting Utility can connect to a running instance of CCStudio. One can have the script or batch file launch the desired installation of CCStudio (run the ‘<Install Dir>\cc\bin\cc_app.exe’ for the desired installation) and then have the Scripting utility then connect to the currently running instance of CCStudio (with the same CCSOpen() / CCSOpenNamed() API).
Q: Why do my Perl scripts fail to work with the CCStudio Scripting Utility? I am using the latest version of the Scripting Utility.
A common cause for Perl scripts to fail with the CCStudio Scripting Utility is that the environment is not configured correctly. Three places to check are:
- Make sure the version of ActivePerl installed is the same version that was selected when installing the CCStudio Scripting Utility (5.6 or 5.8)
- Make sure the paths in <CCStudio Install>\bin\utilities\ccs_scripting\CCS_Scripting_Perl.bat are correct and that the batch file is executed before running the Perl scripts
- Make sure that if you have multiple versions of Perl installed (ex. ActivePerl and Perl via Cygwin) that when the Perl interpreter is called, that the correct version of Perl that will work with the Scripting Utility is used. (do a ‘perl –v’ from the command line to confirm this).
Q: Why does the CCS Script running through a Perl or a Visual Basic script look to be hung when the target is running?
The Perl Script or Visual Basic Script looks to be hung when it tries to read or write to the DSP memory location. The CCS cannot read or write to a memory location when the DSP is running and so the scripting API cannot do the same. The API script which tries to read/write to a memory location would not return unless the target is halted through the break point or manually halted through the CCS. One solution for this is to set a break point through the script, read/write to the memory and run the target again.
Q: Is there any way to script the Component Manager?
The CCStudio Component Manager can be used to switch between different installations of the Code Generation Tools or DSP/BIOS that is used by CCStudio when building a project. Unfortunately the Component Manager cannot be automated by CCScripting. However, you can automate what the Component Manager basically does: modify the registry to point a CCStudio version to the version of cgtools/bios that you wish to use.
Example for automating switching between two different installations of the codegen tools for C64x (C6000 6.1.0A3 and C6000 6.0.8):
Open up the registry and browse to:
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Texas Instruments
And select an installation of CCStudio (ex. CCS_C:|CCStudio_v3.3|). Under the CCStudio entry, select a Device (ex. TMS320C64xx) and export the registry key for 'Build Tools'. Save it to a *.reg file (ex. C6000cgtools610A3.reg).
Next use Component Manager to select the other cgtools installation to be used with C64x. Once this is done, repeat the steps above, except make sure you export the registry key to a *.reg file of a different name (ex. C6000cgtools608.reg).
Once you have all your reg files you can just run the one you need (just type in the *.reg file name in the command line) to configure CCStudio to use for a particular build. This can be automated in a batch file. To silently update the registry without any dialogs popping up use "regsvr32 regfile.reg -s".
Debug Server Scripting
Q: Where do I get DSS?
DSS is currently available as part of the CCStudio v4 release and can be downloaded from the CCStudio v4 main page.
Note - DSS is truly independent of the CCS GUI (unlike CCScripting) - the CCSv4 release is simply the mechanism by which you obtain the DSS product.
Q: Which scripting languages are supported?
Q: Where are the DSS help files?
You can find the DSS Release notes and API Reference Guide under <install dir>\scripting\docs
You can bring up the API Reference Guide by opening docs\API\index.html in your Internet browser. This API guide is automatically generated via javadoc so it should always be up to date with respect to the latest source.
Q: What about existing GEL and CommandWindow? functionality?
Several GEL commands (such as GEL_MapAdd, etc.) already have equivalent commands in the scripting API set. Others are supported through the expression.evaluate() method. CommandWindow? functions are more complicated as the CCS CommandWindow? plugin has its own parser and execution engine that is not implemented in debug server. If there is a method that you require but is not available please log an item in ClearQuest?.
Q: What is Rhino?
Note: Even though the package is called com.ti.ccstudio.debug.server.scripting don't forget the prefix Package. and do not wrap the package name in quotes or you'll get an error Function importPackage must be called with a package; had "Packages.com.ti.ccstudio.debug.server.scripting" instead.
- On machines that have multiple JRE installed, make sure that JRE v1.5.0 is being referenced. This can be checked by invoking:
If the wrong JRE is being referenced, update the environment so the correct JRE (1.5.0) is referenced or explicitly call the java.exe in your 1.5.0 installation.
Q: Why are the generated log files XML?
We recognize that everyone will have slightly different logging needs. By producing standardized XML log files it is easy to transform XML using XSLT (XML StyLesheet Transforms) into any custom format (comma-delimited text, HTML, etc.).