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/OMAPL138B-EP: TMS320C6748

Part Number: OMAPL138B-EP
Other Parts Discussed in Thread: CCSTUDIO, OMAPL138

Tool/software: Code Composer Studio

Hi Ki-Soo Lee,

I am working for automation test for my project using DSS tool in CCSv5.5. I wrote the script to test my functions by following the example script provided by TI i.e. "Breakpoint.js".

my question is why if{} else{} statements gave syntax error and why both conditional statements executed. please show mw some solution.

I have an issue like as following.

I have gone through some threads in E2E forum . there I have seen your replays to Madam Rohini and Matthias but those posts doesn't help to me.

Please help me to resolve issue.

Thanks in Advance.

  • Hello,
    Please provide your script (or a snippet of your script with the issue) and the exact syntax error message you are getting.

    Thanks
    ki
  • Hello Ki,

    Thank you for quick reply. Here I am adding the script and request you to please take look into that.

    /************************************************************************************************************************/
    ######################################################################################################

    // 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 Servers and Sessions
    var script = ScriptingEnvironment.instance();

    // Create a log file to log script execution
    script.traceBegin("phasecompLOG.xml", "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("OMAPL138_c6748.ccxml");
    var debugSession = debugServer.openSession("Blackhawk XDS560v2-USB System Trace Emulator_0/C674X_0");

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

    // Load a program
    debugSession.memory.loadProgram(".........../drp_sim/Debug_L138/drp_c6748.out");

    //Add a breakpoint at the printf() statement
    var SP1_Address = debugSession.symbol.getAddress("Task_SP1")
    var SP1_Process = debugSession.breakpoint.add(SP1_Address);

    //Add a breakpoint at the printf() statement
    var SP23_Address = debugSession.symbol.getAddress("Task_SP23")
    var SP23_Process = debugSession.breakpoint.add(SP23_Address);

    //Restart our Target
    debugSession.target.restart()

    // Run if already not automatically halted at main. Should halt at first BP
    if(debugSession.expression.evaluate("PC") != SP1_Address)
    {
    debugSession.target.run();
    }

    // Using an expression - get the current value of the PC
    var nPC = debugSession.expression.evaluate("PC")

    // Verify we halted at the correct address. Use the Static Java method Long.toHexString() to convert the
    // result to a hex string when logging messages
    if (nPC == SP1_Address)
    {
    script.traceWrite("SUCCESS: Halted at correct location");
    }
    else
    {
    script.traceWrite("FAIL: Expected halt at 0x" + Long.toHexString(SP1_Address) + ", actually halted at 0x" + Long.toHexString(nPC))

    script.traceSetConsoleLevel(TraceLevel.INFO)
    script.traceWrite("TEST FAILED!")
    script.traceEnd()
    //java.lang.System.exit(1);
    }

    // Run again. Should halt at our breakpoint
    debugSession.target.run()

    // Using an expression - get the current value of the PC
    var nPC = debugSession.expression.evaluate("PC")

    // Verify we halted at the correct address.
    if (nPC == SP23_Address) {
    script.traceWrite("SUCCESS: Halted at correct location")
    } else {
    script.traceWrite("FAIL: Expected halt at 0x" + Long.toHexString(SP23_Address) + ", actually halted at 0x" + Long.toHexString(nPC))

    script.traceSetConsoleLevel(TraceLevel.INFO)
    script.traceWrite("TEST FAILED!")
    script.traceEnd()
    //java.lang.System.exit(1);
    }

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

    //script.traceSetConsoleLevel(TraceLevel.INFO)
    script.traceWrite("Test Succeeded");

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


    ######################################################################################################
    /************************************************************************************************************************/


    in the above script I got a syntax error at if(debugSession.expression.evaluate("PC") != SP1_Address), if (nPC == SP1_Address) , and
    if (nPC == SP23_Address).

    /************************************************************************************************************************/
    ######################################################################################################


    js:> // Run if already not automatically halted at main. Should halt at first BP

    js:> if(debugSession.expression.evaluate("PC") != SP1_Address)
    syntax error
    js:> {
    syntax error
    js:> debugSession.target.run();

    js:> }
    syntax error
    js:>

    js:> // Using an expression - get the current value of the PC

    js:> var nPC = debugSession.expression.evaluate("PC")

    js:>

    js:> // Verify we halted at the correct address. Use the Static Java method Long.toHexString() to convert the

    js:> // result to a hex string when logging messages

    js:> if (nPC == SP1_Address)
    syntax error
    js:> {
    syntax error
    js:> script.traceWrite("SUCCESS: Halted at correct location");

    js:> }
    syntax error
    js:> else
    syntax error
    js:> {
    syntax error
    js:> script.traceWrite("FAIL: Expected halt at 0x" + Long.toHexString(SP1_Address) + ", actually halted at 0x" + Long.toHexString(nPC))

    js:>

    js:> script.traceSetConsoleLevel(TraceLevel.INFO)

    js:> script.traceWrite("TEST FAILED!")

    js:> script.traceEnd()

    js:> //java.lang.System.exit(1);

    js:> }
    syntax error
    js:>

    js:> // Run again. Should halt at our breakpoint

    js:> debugSession.target.run()

    js:>

    js:> // Using an expression - get the current value of the PC

    js:> var nPC = debugSession.expression.evaluate("PC")

    js:>

    js:> // Verify we halted at the correct address.

    js:> if (nPC == SP23_Address) {
    syntax error
    js:> script.traceWrite("SUCCESS: Halted at correct location")

    js:> } else {
    syntax error
    js:> script.traceWrite("FAIL: Expected halt at 0x" + Long.toHexString(SP23_Address) + ", actually halted at 0x" + Long.toHexString(nPC))

    js:>

    js:> script.traceSetConsoleLevel(TraceLevel.INFO)

    js:> script.traceWrite("TEST FAILED!")

    js:> script.traceEnd()

    js:> //java.lang.System.exit(1);

    js:> }
    syntax error
    js:>

    js:> // All done

    js:> //debugServer.stop();

    js:>

    js:> //script.traceSetConsoleLevel(TraceLevel.INFO)

    js:> script.traceWrite("Test Succeeded");

    js:>

    js:> // Stop logging and exit.

    js:> script.traceEnd();

    ######################################################################################################
    /************************************************************************************************************************/

    please help me how to resolve those syntax errors.

    Thank you.

    Regards,
    koti.
  • Hi koti
    It looks like you are trying to load the script to the Scripting Console as a command file. Are you using the "Open Command File" button?

    You need to load your script as a javascript file:

    Example:

    js:> loadJSFile C:\path\to\file.js

    Thanks
    ki
  • Hi Ki Soo Lee,

    Thank you so much. You are correct and I am sorry for the late reply due to out of station.

    Ki Soo Lee, Can I ask one more question in this thread which is related to code coverage on OMAP device.

    if it is Okay means I will continue this thread else I stopped. Please give me reply and thank you for spending your valuable time to me.

    Regards,
    koti.
  • Hi koti,
    Please start a new thread for the code coverage issue. It helps make it easier to properly respond to threads.

    Thanks
    ki
  • Hello Ki Soo Lee,

    Sure I will start new thread for code coverage issues.

    Thanks & Regards,
    Koti.