I have many scripts that I run for unit tests from Matlab (rather than javascript).
When I try to start CCS in these scripts it gives me the following with a java.lang.ClassNotFoundException
getServer: Getting definition for: CCSServer.1
getServer: Constructing server
getServer: RETURN com.ti.ccstudio.scripting.CCSServer@515783
WARNING: CCSServer.openSession() failed. DSS was unable to launch Code Composer Studio, however script execution will continue. java.lang.ClassNotFoundException: com.ti.ccstudio.apps.scripting.ScriptUtils
Is there a package that I need to import or dir I need to add to the javapath so that this class will be found? I can't find a file in the install with a similar name. Here is the Matlab code I am using. The CCS session stuff is what is new and not working.
javaaddpath([ ds_dir 'packages\ti\dss\java\dss.jar' ]); import com.ti.debug.engine.scripting.*; import com.ti.ccstudio.scripting.environment.*; import com.ti.ccstudio.apps.scripting.*; import com.ti.ccstudio.apps.scripting.ScriptUtils.*; script = ScriptingEnvironment.instance(); script.traceBegin('CCSSession.xml', 'DefaultStylesheet.xsl') script.traceSetConsoleLevel(TraceLevel.ALL) //% script.traceSetFileLevel(TraceLevel.ALL) ccsServer = script.getServer('CCSServer.1'); ccsSession = ccsServer.openSession('.*'); this.debug_server = script.getServer('DebugServer.1'); this.debug_server.setConfig(target_config_loc); this.debug_session = this.debug_server.openSession('.*'); //% Load the program this.debug_session.memory.loadProgram(program_loc);
Here is the javascript example included with the install for bringing up CCS from a script:
// Import the DSS packages into our namespace to save on typing importPackage(Packages.com.ti.debug.engine.scripting) importPackage(Packages.com.ti.ccstudio.scripting.environment) importPackage(Packages.java.lang) // Create our scripting environment object - which is the main entry point into any script and // the factory for creating other Scriptable ervers and Sessions var script = ScriptingEnvironment.instance() script.traceBegin("CCSSession.xml", "DefaultStylesheet.xsl") // Log everything script.traceSetConsoleLevel(TraceLevel.ALL) script.traceSetFileLevel(TraceLevel.ALL) // Start up CCS ccsServer = script.getServer("CCSServer.1") ccsSession = ccsServer.openSession(".*")
Does anyone know where this missing class is or how it is found by the Javascript but not the Matlab script?
Thank you
Chris
---------------------------EDIT----------------------------
After adding:
javaaddpath([ 'C:\ti5\ccsv5\eclipse\plugins\com.ti.ccstudio.apps_5.5.0.201308270800.jar' ]);
WARNING: CCSServer.openSession() failed. DSS was unable to launch Code Composer Studio, however script execution will continue. java.lang.reflect.InvocationTargetException: null
I think this is where the class is defined.
---------------------------EDIT----------------------------
I believe that this link about Python/Jython for DSS applies to Matlab. It is essentially a scripting language with a JRE so java classes can be imported and instantiated:
http://processors.wiki.ti.com/index.php/Python_Scripting_with_DSS#Setting_up_the_Environment
It says "any language that supports importing and using Java classes can be used with DSS". I think that any help on Jython would also apply to Matlab.
New question: Is it possible to run the CCS session from a DSS Jython script? Has anyone got this working?
It does not seem that the imported jars in the Jython DSS wiki page are sufficient to load CCS.
Thank you for any answers you can share with me. We have a whole unit test framework based on DSS in Matlab and this would make working with it so much more powerful.