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.

How to load a GEL file using DSS?

Other Parts Discussed in Thread: CCSTUDIO

I would like to load a GEL file using the Debug Sever Scripting (DSS). Therfore I am trying to use the following JavaScript exmaple:

// 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 ervers and Sessions
var script = new ScriptingEnvironment()

// Get the Debug Server and start a Debug Session
debugServer = script.getServer("DebugServer.1")
debugServer.setConfig("DSK6416myTest.ccxml")
debugSession = debugServer.openSession("Spectrum Digital DSK-EVM-eZdsp onboard USB Emulator_0/C64xx_0")
debugSession.target.connect();


// Call of my GEL file utilizing the evaluate function
debugSession.expression.evaluate("GEL_LoadGel(myGELfile.gel)")

When executing the JavaScript I get the following error:

82

1938

0

SEVERE

raise

Evaluation of expression: "GEL_LoadGel(myGELfile.gel)" failed. identifier not found: myGELfile

I thought I could use any GEL function in DSS. How about GEL_LoadGEL("myGELfile.gel")? Or do I overlook something?

  • e-schan said:
    debugSession.expression.evaluate("GEL_LoadGel(myGELfile.gel)")

    You need to wrap the GEL file being loaded in quotes also.

    Try something like:

    debugSession.expression.evaluate('GEL_LoadGel("myGELfile.gel")');

    You may want to use a full path to the GEL file also since I think otherwise it will default to the current windows directory (which changes all the time)

    Thanks

    ki

  • Hi Ki-Soo,

    thanks for your fast response (it is amazing how fast it was).

    Now I have tried your suggestion and it seems that I made one step into the right direction w/ the following result:

    80 1938 0 SEVERE onEvent C64xx_0: GEL: Error loading file 'myGELfile.gel': unable to open GEL file 'myGELfile.gel'

    My GEL file is located in the same folder as the javascript and that's the same folder from where I call it.

     

    Then I tried to copy my GEL file to C:\ and changed the command to:

    debugSession.expression.evaluate('GEL_LoadGel("C:\\myGELfile.gel")')

    with the following result:

    75 1938 0 FINER evaluate ENTRY sExpression: GEL_LoadGel("C:\myGELfile.gel")
    76 1938 0 FINER eval Requesting evaluation of expression: "GEL_LoadGel("C:\myGELfile.gel")"
    77 1938 0 FINER getScriptTimeout ENTRY
    78 1938 0 FINER getScriptTimeout RETURN 5000
    79 1938 0 FINER waitUntil ENTRY flag: GEL_LoadGel("C:\myGELfile.gel") timeout: 5000 (ms)
    80 1938 0 SEVERE onEvent C64xx_0: GEL: Error loading file 'C:myGELfile.gel': unable to open GEL file 'C:myGELfile.gel'
    81 1938 0 FINER onEvent Evaluated expression: GEL_LoadGel("C:\myGELfile.gel")

    Any further idea?

  • I can't remember how many backslashes to use (I think you might need to use four because of the escape characters). I just use a forward slash since it is easier to deal with:

    debugSession.expression.evaluate('GEL_LoadGel("C:/myGELfile.gel")');

  • Thanks a lot! It's working now.

    One last question:
    How can I call a function from my GEL file that has been loaded? Let's say  I would need to call myTESTS() from it.

    Many Thanks in advance for your great support!

  • Once a GEL file is loaded, any functions defined in it can be called directly using the same expression.evaluate call:

    debugSession.expression.evaluate("myTESTS()");