This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CCSTUDIO: Where is the java source for the jars in ti/ccsv8/ccs_base/DebugServer/packages/ti/dss/java

Part Number: CCSTUDIO

Tool/software: Code Composer Studio

Hi

Is the java source available for the DebugServer (java API) ? Since I can't find any documentation on how to use the Debug Server from java, source would be welcomed for debugging.

Thanks Peter

  • Hi Peter,
    Have you seen the below wiki?
    processors.wiki.ti.com/.../Java_Scripting_with_DSS

    The article is a bit dated but should still be relevant for CCSv8.

    Thanks
    ki
  • Hi Ki

    Thanks, yes I have seen this and it works when I run it from the command line:

    #!/bin/zsh
    PACKAGE="/media/p/nuage/dev/ti/ccsv8/ccs_base/DebugServer/packages/ti/dss/java"
    CMD="$PACKAGE/com.ti.ccstudio.scripting.environment_3.1.0.jar:$PACKAGE/com.ti.debug.engine_1.0.0.jar:$PACKAGE/dss.jar"
    javac -cp $CMD hotbrix/dss/DssExample.java
    java -cp ".:$PACKAGE/dss.jar" hotbrix.dss.DssExample

    I don't need to modify the $PATH var, by the way.

    However, when I run the same code from eclipse, I get:

    SEVERE: Can not connect to DebugServer. Path not found: '/media/bin'
    SEVERE: Could not start server: DebugServer.1: Can not connect to DebugServer. Path not found: '/media/bin'

    Any ideas ?

    Thanks
    Peter
  • Can I see the source (or just relevant snippets)?
  • Hi Ki

    Sorry for the late reply, somehow, I didn't get notified of your answer.

    In the meantime, I discovered, that as long as I keep the relevant jars ('com.ti.ccstudio.scripting.environment_3.1.0.jar',
    'com.ti.debug.engine_1.0.0.jar') inside the TI directory structure '<TIFolderPath>/ccsv8/ccs_base/DebugServer/packages/ti/dss/java'
    everything works fine. However, if I want to move this jar to a local repo, I get the error message as mentioned. It seems as if these jars
    have a dependency on some other files in the dir structure. Can you confirm this ?

    Thanks Peter



    Here is the java source (this works as long as I don't move the DSS jars):

    package hotbrix.dss;
    import static softbrix.lib.list.Ls.list;
    import com.ti.ccstudio.scripting.environment.ScriptingEnvironment;
    import com.ti.ccstudio.scripting.environment.ScriptingException;
    import com.ti.debug.engine.scripting.BreakpointProperties;
    import com.ti.debug.engine.scripting.DebugServer;
    import com.ti.debug.engine.scripting.DebugSession;
    public class MainMSP {
    public static void main(String[] args) {
    String deviceCCXMLFile = "<projectPath>/targetConfigs/both.ccxml";
    String programToLoad = "<projectPath>/Debug/MSP432P4111-tutorial.out";
    // Create base scripting environment.
    ScriptingEnvironment script = ScriptingEnvironment.instance();

    DebugServer debugServer = null;
    DebugSession debugSession = null;
    try {
    script.traceBegin("trace.xml", "<TIFolderPath>/ccsv8/ccs_base/scripting/examples/DebugServerExamples/DefaultStylesheet.xsl");
    debugServer = (DebugServer) script.getServer("DebugServer.1");

    } catch (ScriptingException se) {
    System.out.println("getServer: " + se);
    }
    debugServer.setConfig(deviceCCXMLFile);
    System.out.println(list(debugServer.getListOfCPUs()).join("\n"));
    try {
    debugSession = debugServer.openSession("Texas Instruments XDS110 USB Debug Probe", "CORTEX_M4_0");
    } catch (ScriptingException se) {
    System.out.println("openSession: " + se);
    }
    try {
    // Load a program

    debugSession.target.connect();
    debugSession.memory.loadProgram(programToLoad);
    BreakpointProperties Break_Point_properties = debugSession.breakpoint.createProperties(1);
    Break_Point_properties.setString("Hardware Configuration.Type", "Watchpoint");
    Break_Point_properties.setString("Hardware Configuration.Type.Location", "&testResult");
    Break_Point_properties.setString("Hardware Configuration.Type.Memory", "Write");
    debugSession.breakpoint.add(Break_Point_properties);
    // Run the program
    script.traceWrite("run ...");
    debugSession.target.run();
    // reading and writing the data
    long data = debugSession.expression.evaluate("count");
    script.traceWrite("evaluate: " + data);
    long address = debugSession.symbol.getAddress("testResult");
    data = debugSession.memory.readData(0, address, 16);
    script.traceWrite("readData: " + data);
    debugSession.terminate();
    debugServer.stop();
    script.traceWrite("finished successfully");
    } catch (ScriptingException se) {
    System.out.println(se);
    }
    }
    }

    And here is the *build.gradle* file ( I use gradle 5.0 as build tool):

    plugins { id 'application' }


    repositories {
    jcenter()
    /*
    * This doesn't work, we can't use those jars outside the TI dir tree
    * flatDir { dirs <localRepo> }
    */
    flatDir { dirs '<TIFolderPath>/ccsv8/ccs_base/DebugServer/packages/ti/dss/java' } // <-- this works
    }


    dependencies {
    compile project(':softbrix.lib')
    testCompile 'junit:junit:4.12'
    compile name: 'com.ti.ccstudio.scripting.environment_3.1.0'
    compile name: 'com.ti.debug.engine_1.0.0'
    //compile name: 'dss'
    }

    mainClassName = 'hotbrix.dss.MainMSP'
  • Peter Vittali said:
    It seems as if these jars
    have a dependency on some other files in the dir structure. Can you confirm this ?

    Yes, this is indeed true. Moving them around would certainly cause issues. I should make a note of this in the documentation.

    Thanks

    ki

  • Hi Ki
    Thank you.
    I think a note in the doc would indeed be a good idea because I believe that some java developers wouldn't expect these hidden deps.

    I think the Debug Server Scripting is a great feature and I hope that it will get a lot of love from TI in the future.
    Also , the source code would be helpful, if this is possible.

    Thanks
    Peter