Other Parts Discussed in Thread: CCSTUDIO
Hello,
I am working with DM814x board and XD510 emulator. I am creating .dll library in C++ which is starting virtual java machine and calling java functions like: open connection(), close connection(), load program() etc.
I wrote in java (using netbeans) 'test class' and implemented few methods (below is open connection() method example):
public class test {
private String DeviceName;
private String ProcName;
private String ConfigFile;
private String GelFile;
private String ProgramFile;
private DebugSession emuDebugSession;
private DebugServer emuDebugServer;
private ScriptingEnvironment script;
public test() {
System.out.println("constructor called");
DeviceName = "Spectrum Digital XDS510USB Emulator_0";
ProcName = "CortexA8";
ConfigFile = "/test3_target.ccxml";
GelFile = "GEL_LoadGel(\"/DM814x_PG1.x.gel\")";
emuDebugServer = null;
emuDebugSession = null;
ProgramFile = "/test6.out";
script = ScriptingEnvironment.instance();
IsConnected = false;
GelLoaded = false;
System.out.println("Object emulator for configuration" + " " + DeviceName + " " + ProcName + " " + ConfigFile + " " + "created");
}
public void OpenConnection(){
System.out.println("Open connection function invoked");
try
{
emuDebugServer = (DebugServer) script.getServer("DebugServer.1");
script.traceWrite("starting debug server...");
emuDebugServer.setConfig(ConfigFile);
script.traceWrite("loading config...");
emuDebugSession = emuDebugServer.openSession(DeviceName,ProcName);
emuDebugSession.target.connect();
script.traceWrite("connected");
IsConnected = true;
}
catch (Exception e)
{
e.printStackTrace();
}
}
I added the following libraries to my classpath:
- com.ti.ccstudio.scripting.environment_3.1.0.jar
- com.ti.debug.engine_1.0.0.jar
- dss.jar
Running program inside the IDE I can connect to target, load GEL, load program, disconnect. Later I created .jar file including my class and libraries. From my .dll I am creating new instance of 'test' and calling open connection() method. First I was getting error that class DebugServer cannot be found, so I added to my classpath all .jar files from DebugServer\packages\ti\dss\java. Now I am getting this error (at line emuDebugSession = emuDebugServer.openSession(DeviceName,ProcName);):
SEVERE: Can not connect to Debug Server. Path not found.
SEVERE: Could not start server: Debug Server.1: Can not connect to DebugServer. com.ti.ccstudio.scripting.environment.ScriptingException : Could not start server
at com.ti.debug.engine.scripting.DebugServer.openSession<DebugServer.java>
I am getting the same error when trying to run .jar file from command line. I though I am missing some classes in my .jar or manifest file is broken, but after exploring it everything looks ok. I suppose something is wrong with paths to classes - program runns from IDE but not from .jar. Does anybody has idea what can be wrong?
Thank for any help.
Kasia