Other Parts Discussed in Thread: CCSTUDIO
Hi
I am trying to create a Matlab GUI that uses the debug server. The problem I am having is that the GUI works as expected when I run it the first time, but the second time I run it I get an error on
script = ScriptingEnvironment.instance();
There is obviously some java object still defined in Matlab's environment that doesn't get cleared when GUI is ended.
To create a simpler test, I created the function below. It has the same problem. I checked the scripting env API and there does not seems to be a method that can tell me the instance is present (kinda like isWithinCCS() ).
Restarting Matlab works.
Perhaps there is a java command that destroys the singleton created by ScriptingEnvironment.instance()?
??? Java exception occurred:
java.lang.ClassCastException: com.ti.ccstudio.scripting.environment.DirectedConsoleHandler cannot be cast to
com.ti.ccstudio.scripting.environment.DirectedConsoleHandler
at
com.ti.ccstudio.scripting.environment.ScriptingEnvironment.initializeParentLogger(ScriptingEnvironment.java:117)
at com.ti.ccstudio.scripting.environment.ScriptingEnvironment.<init>(ScriptingEnvironment.java:77)
at com.ti.ccstudio.scripting.environment.ScriptingEnvironment.instance(ScriptingEnvironment.java:60)
Error in ==> startDebugServer at 24
script = ScriptingEnvironment.instance();
************ Function ************************
function startDebugServer()
disp ('SetupCcsDebugServer');
DEBUG_DIR = 'C:/Program Files/Texas Instruments/ccsv4/DebugServer';
%TARGETCFG_DIR = 'C:/Program Files/Texas Instruments/ccsv4/emulation/boards/evmc6472/target_configuration';
%TARGET_EMULATOR = '/EVM6472_XDS100USB.ccxml';
javaaddpath([ DEBUG_DIR '/packages/ti/dss/java/js.jar' ]);
javaaddpath([ DEBUG_DIR '/packages/ti/dss/java/dss.jar' ]);
javaaddpath([ DEBUG_DIR '/packages/ti/dss/java/com.ti.debug.engine_1.0.0.jar' ]);
javaaddpath([ DEBUG_DIR '/packages/ti/dss/java/com.ti.ccstudio.scripting.environment_3.1.0.jar' ]);
javaaddpath([ DEBUG_DIR '/packages/ti/dss/java/com.ti.ccstudio.scripting.rtdx_1.0.0.jar' ]);
javaaddpath([ DEBUG_DIR '/../eclipse/startup.jar' ]);
import com.ti.ccstudio.scripting.environment.*;
import com.ti.debug.engine.scripting.*;
import java.lang.System;
import java.lang.Object;
System.setProperty('XPCOM.RUNTIME',[ DEBUG_DIR '/win32' ]);
%global script;
script = ScriptingEnvironment.instance();
display('Done')