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.

TMS320F28377D: Looking for DSS script for loading binary file on TMS320F28377D and extract trace files

Part Number: TMS320F28377D
Other Parts Discussed in Thread: CCSTUDIO

we are trying to automate flashing and debug binary file on to target board TMS320F28377D using DSS script. also i wanted to enable trace options.

  • Using DSS to flash binaries is quite simple. But you aslo mentioned debugging binary files. What kinds of debugging?

    also i wanted to enable trace options.

    Please explain what type of "trace options" you are looking for.

    Thanks

    ki 

  • find below java script which we are using for TI 28335.. similarly we wanted for TMS320F28377D

    // 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);

    // Modify these variables to match your environment. Use forward slashes
    var ccs6InstallDir = "C:/ti/ccsv6";
    var RTRTWorksDir = "/CCS_temp";
    var TargetCCXMLfile = "/CCS_temp/NewTargetConfiguration.ccxml";
    var programToLoad = RTRTWorksDir + "/CCStest.out";
    var logFile = RTRTWorksDir + "/log.xml";

    // Create our scripting environment object - which is the main entry point
    // into any script and the factory for creating other Scriptable Servers and Sessions
    var script = ScriptingEnvironment.instance();

    // Create a log file in the current directory to log script execution
    script.traceBegin(logFile, ccs6InstallDir + "/ccs_base/scripting/examples/DebugServerExamples/DefaultStylesheet.xsl");
    // Set trace levels for console and logs
    script.traceSetConsoleLevel(TraceLevel.INFO);
    script.traceSetFileLevel(TraceLevel.ALL);

    script.traceWrite("Begin scripting session");

    // Get the Debug Server and start a Debug Session
    var debugServer = script.getServer("DebugServer.1");
    debugServer.setConfig(TargetCCXMLfile);
    var debugSession = debugServer.openSession(".*");

    script.traceWrite("Connecting the Target");

    // Connect to the CPU
    debugSession.target.connect();

    script.traceWrite("Target Connected");

    // Load a program
    debugSession.memory.loadProgram(programToLoad);

    script.traceWrite("Loading the Program");

    debugSession.expression.evaluate("GEL_LoadGel( \"/CCS_temp/rtrt28335.gel\")");

    debugSession.breakpoint.add("exit.c",85);

    script.traceWrite("Executing the Program");

    // Run the target
    debugSession.target.run();

    // All done
    debugServer.stop();
    debugServer.stop();

    script.traceWrite("End scripting session");

    // Stop logging and exit.
    script.traceEnd();

  • find below java script which we are using for TI 28335.. similarly we wanted for TMS320F28377D

    That is a fairly generic DSS script and should be easily migrated to support another device. You would just need to modify some of the parameters for your environment (GEL files, etc).

  • yes i have done those changes whereas i'm getting error as below 

    "SEVERE: Could not open session. Found 6 devices matching: .* "

    find updated script. is anything required for multi core? i mean for CPU1 nad CPU2 gel file?

    // 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);

    // Modify these variables to match your environment. Use forward slashes
    var ccs6InstallDir = "C:/ti/ccsv1040/ccs";
    var RTRTWorksDir = "/CCS_temp";
    var TargetCCXMLfile = "/CCS_temp/HeliSAS.ccxml";
    var programToLoad = RTRTWorksDir + "/CCStest.out";
    var logFile = RTRTWorksDir + "/log.xml";

    // Create our scripting environment object - which is the main entry point
    // into any script and the factory for creating other Scriptable Servers and Sessions
    var script = ScriptingEnvironment.instance();

    // Create a log file in the current directory to log script execution
    script.traceBegin(logFile, ccs6InstallDir + "/ccs_base/scripting/examples/DebugServerExamples/DefaultStylesheet.xsl");
    // Set trace levels for console and logs
    script.traceSetConsoleLevel(TraceLevel.INFO);
    script.traceSetFileLevel(TraceLevel.ALL);

    script.traceWrite("Begin scripting session");

    // Get the Debug Server and start a Debug Session
    var debugServer = script.getServer("DebugServer.1");
    debugServer.setConfig(TargetCCXMLfile);
    var debugSession = debugServer.openSession(".*");

    script.traceWrite("Connecting the Target");

    // Connect to the CPU
    debugSession.target.connect();

    script.traceWrite("Target Connected");

    // Load a program
    debugSession.memory.loadProgram(programToLoad);

    script.traceWrite("Loading the Program");

    debugSession.expression.evaluate("GEL_LoadGel( \"/CCS_temp/f28377d_cpu1.gel\")");

    debugSession.breakpoint.add("exit.c",85);

    script.traceWrite("Executing the Program");

    // Run the target
    debugSession.target.run();

    // All done
    debugServer.stop();
    debugServer.stop();

    script.traceWrite("End scripting session");

    // Stop logging and exit.
    script.traceEnd();

  • "SEVERE: Could not open session. Found 6 devices matching: .* "

    find updated script. is anything required for multi core? i mean for CPU1 nad CPU2 gel file?

    Yes. Please see:

    https://software-dl.ti.com/ccs/esd/documents/users_guide/sdto_dss_handbook.html#multiple-debug-sessions-for-multi-core-debug

    example code snippet for an F28377D on my target:

    // Get the Debug Server and start a Debug Session
    var debugServer = script.getServer("DebugServer.1");
    debugServer.setConfig(TargetCCXMLfile);
    var debugSessionCPU1 = debugServer.openSession("*", "C28xx_CPU1");
    var debugSessionCPU2 = debugServer.openSession("*", "C28xx_CPU2");
    
    // Connect to the CPU1
    debugSessionCPU1.target.connect();
    
    // Connect to the CPU2
    debugSessionCPU2.target.connect();
    

    NOTE that the CPU names need to match with what in the ccxml. Hence check the names in your ccxml file.

    Thanks

    ki

  • Thanks for your immediate response.

    // Load a program
    debugSessionCPU1.memory.loadProgram(programToLoad);

    after connecting do we need to loadprogram for both debugSessionCPU1 and debugSessionCPU2? or is it will communicate internally each other?

  • You can create a debug session for each CPU. That debug session will then only apply for that CPU. So if you want to duplicate behavior for each CPU, you must send the same command to each debug session instance.

  • i have update as below whereas i'm getting error for "var debugSessionCPU1 = debugServer.openSession("*", "C28xx_CPU1");" may i know wat is the issue?

    ccxml file:

    <cpu HW_revision="1.0" XML_version="1.2" desc="MAIN_FCC" description="C28xx CPU" deviceSim="false" id="C28xx_CPU1" isa="TMS320C28XX">
    <property Type="choicelist" Value="0" id="Slave Processor"/>
    <property Type="choicelist" Value="0" id="bypass"/>
    </cpu>

    java script:

    // Get the Debug Server and start a Debug Session
    var debugServer = script.getServer("DebugServer.1");
    debugServer.setConfig(TargetCCXMLfile);
    var debugSessionCPU1 = debugServer.openSession("*", "C28xx_CPU1");
    var debugSessionCPU2 = debugServer.openSession("*", "C28xx_CPU2");

    script.traceWrite("Connecting the Target");

    // Connect to the CPU1
    debugSessionCPU1.target.connect();

    // Connect to the CPU2
    debugSessionCPU2.target.connect();

    script.traceWrite("Target Connected");

    // Load a program
    debugSessionCPU1.memory.loadProgram(programToLoad);
    debugSessionCPU2.memory.loadProgram(programToLoad);

    script.traceWrite("Loading the Program");

    debugSessionCPU1.expression.evaluate("GEL_LoadGel( \"/CCS_temp/f28377d_cpu1.gel\")");
    debugSessionCPU2.expression.evaluate("GEL_LoadGel( \"/CCS_temp/f28377d_cpu2.gel\")");

    debugSessionCPU1.breakpoint.add("exit.c",85);
    debugSessionCPU2.breakpoint.add("exit.c",85);

    script.traceWrite("Executing the Program");

    // Run the target
    debugSessionCPU1.target.run();
    debugSessionCPU2.target.run();

    // All done
    debugSessionCPU1.stop();
    debugSessionCPU1.stop();

    debugSessionCPU2.stop();
    debugSessionCPU2.stop();

    script.traceWrite("End scripting session");

    // Stop logging and exit.
    script.traceEnd();

  • i have update as below whereas i'm getting error for "var debugSessionCPU1 = debugServer.openSession("*", "C28xx_CPU1");

    What is the exact error message?

  • Thanks for your response.. i could able to resolved this issue