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.

[CCSV4.2] Issue when attaching a CCS GUI from DSS

Other Parts Discussed in Thread: CCSTUDIO

hi,

 

I want ot launch a CCS windows from my javascript test function.

I follow steps from the web page

 

    // Create base scripting environment.
    dssScriptEnv = Packages.com.ti.ccstudio.scripting.environment.ScriptingEnvironment.instance();

    // DEBUG: Open a CCS Session to bring up the CCSv4 GUI which will share the same debug context
    try
    {
        dssScriptEnv.getServer("CCSServer.1").openSession(".*");
        dssScriptEnv.traceWrite("CCS succesfully opened");
    }
    catch (ex)
    {
        errCode = getErrorCode(ex);
        dssScriptEnv.traceWrite("Error code #" + errCode + ", failed to open CCS GUI ");
    }

But I have the following error message:

WARNING: CCSServer.openSession() failed.  DSS was unable to launch Code Composer Studio, however script execution will continue. java.lang.ClassNotFoundException: org.eclipse.equinox.launcher.Main

 

I used ccsv4.2 R1 / windows XP.

Any any of the rott cause of issue?

regards

  • Hi Claudio,

     

    would you be able to send (offline works just as well) more or your script?  Do you import the packages you need?  Have you done this successfully in the past?

     

    Cheers,
    Lisa

  • Hi Lisa,

    Yes I have modified the file to make it simpler.

    I attached a zip

    Once you unzipp the files, open a dos command under <your_dir>/reg_tests/ivahd

    launch call ivahd_boot_host1_ducati.bat -c omap4430_ES2_freerunning_with_gel_wakeUp_topsim.ccxml

    I never done the experiment before.

    Note I have multiples instances of CCSV4 / CCSV5.1 installed on my PC : could some env. variable have been overriden?

    rgds

    4621.dss_bugs.zip

     

  • Hi Claudio,

    ok let me look into this and see if we can spot the issue.

    Thanks for the zip files.   A couple quick initial things.

    - do the unmodified examples work and launch CCS?

    - at the moment my computer will not recognize your bat file as something that can be run or as a correct bat file for some reason

    Cheers,
    Lisa

  • isa,

    -no, the unmodfied was also not ok. I just remove some useless dependencies.

    - did you extract the file on a network drive or a local drive? local drive is prefered.

    Strane indeed

    rgds

  • Hi Claudio,

    I did unzip them on my local pc.  As mentioned I was not able to even run anything at all. 

    Please double check.   In the mean time I will see what we can do to start having a quick look at your .js files.


    Best Regards,
    Lisa

  • Hi Claudio,

    Ok, I have made a bit of progress.

    What I have done is the following

    - I went into my CCS4.2.4 scripting directory.  In the scripting directory I modified the dss batch file as described on this wiki page to lauch Rhino when run

    http://processors.wiki.ti.com/index.php/Debugging_Your_DSS_Script_Using_CCStudio_v4

    - In Rhino I went to File->Run and selected your omap4_dss.js file

    - as described on the wiki I put a breakpoint after the call to lauch CCS

    - I pressed "Go"

    - I got an error when get_args was called in the main function

    I commented the get_args out to try and remove the error and repeated the above.   At the breakpoint CCS did launch.

    So I think maybe you needed a breakpoint?   Please give the above a try and keep me informed.   From what I can see, your script does indeed seem capable of launching CCS.

     

    Best Regards,
    Lisa

  • Lisa,

     

    I also commented the get_arg function call. but without any success.

    So I see the difference is that you are using another .bat file than I am. So I try to modifu the file <TI_DIR>ccvs4/bin/dss.bat (is it that one you've modiifed?)to call rhino debugger

    But I can load the omap4_dss.js file but not able to run it (the Go button is not activated.)

    Sounds issue is in the bat file, no?

    I see more arguments when calling the java.exe process in the <TI_DIR>ccvs4/bin/dss.bat file than in the one used for the loadti.bat example. (the one I have modified)

    regards

  • Hi Claudio,

    In the Rhino debugger you have to go to File->Run and select your .js file.   This is what I did with your javascript file.  Then you need to set a breakpoint after the call to start CCS as mentioned in the wiki. 

    Have you done these steps?  Could you please try and let me know?

    I do not think there is a problem with the batch file.  As long as we both have the same CCS version we should have identical batch files actually.

    Best Regards,
    Lisa

     

  • hi lisa,

    ok so now I did GO-> "my js file" and  Isee the ccs GUI opened. (I was loading the js file and  I was expecting I could do a simple GO )

    However  Ihave an error logged:
    !SESSION 2011-08-16 15:09:03.969 -----------------------------------------------
    eclipse.buildId=4.2.3.00004
    java.version=1.5.0_14
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Framework arguments:  .*
    Command-line arguments:  .*

    !ENTRY com.ti.dvt.rta.RtaSolution 4 4 2011-08-16 15:09:14.969
    !MESSAGE Could not update RTA6 Solution's DP: XDCLogSource

    I have commented out the get_arg function.but  If I call it after the session is opened  I still have an error. Since the function is defined in another js file and is hence not available. In my script  I load the getarg.js file based on a environement variable SCRIPT_DIR

    By the way, if you look in the zip package the batch I am calling is the dss/loadti_omap4.bat.and is different from the one used to launch CCS when invoking the scripting/bin/dss.bat file

    I think error is in this file. since it differs from the one called when launching the one under scripting/bin directory

    I tried to modified my batch to pass more arguments to the java process , but in vain.

    regards

  • lisa,

    Finally, I am able to launch CCS after having modified the loadti_omap4.bat file. I basically copy the ds.bat present in the scripting dir.

    I have still an issue when launching rhino debugger, the js is not automatically loaded (path/ env variable issue I think)

    I attach the modified bat file in case

    @echo off
    SETLOCAL
    
    REM ===========================================================================
    REM This batch file executes LoadTI for DSS for Windows.
    REM ===========================================================================
    
    REM ===========================================================================
    REM Do not edit the lines below.
    REM ===========================================================================
    
    REM Set the DSS and DebugServer Root.
    REM this batch file can be call from local host or remote
    REM in first case use TI _DIR  var for local install of CCS
    REM otherwise gives the network name- ex CNYNC04162
    REM CAUTION the ccsv4 directory must be SHARED in that case
    
    
    REM set DEBUGSERVER_ROOT=%~dp0..\..\..\DebugServer
    @echo TI CCSV4 install directory: %TI_DIR%
    
    rem set DEBUGSERVER_ROOT=%TI_DIR%\DebugServer
    
    
    setlocal ENABLEDELAYEDEXPANSION
    
    :setccscfg4
    if "%1"=="-c" goto setccscfg1
    @echo error config file must be given as argument (%1)
    goto help
    
    :setccscfg1
    REM ccs cfg file is next argument
    SET CCS_CFG_FILE=%2
    SHIFT
    SHIFT
    
    :setccscfg2
    @echo CCS config file used: %CCS_CFG_FILE%
    
    if "%1" =="-t" goto timeout_1
    REM set timeout max value here: 240000 ms = 4 minutes
    SET TIMEOUT_MAX_MS=240000
    goto timeout_2
    :timeout_1
    SET TIMEOUT_MAX_MS=%2
    REM arg must be shifted to be aligned in all cases
    SHIFT
    SHIFT
    
    :timeout_2
    @echo Timeout value (in ms) %TIMEOUT_MAX_MS%
    
    REM This path to point to the absolute install location of the Debug Server.
    REM We're going to use the DOS macro %~dp0 which always points to the
    REM absolute path of this batch file, no matter where on the system this
    REM batch file is called from.
    
    rem set DEBUGSERVER=%~dp0..\..\DebugServer
    set DEBUGSERVER=%TI_DIR%\DebugServer
    
    if not exist "!DEBUGSERVER!" set DEBUGSERVER=%TI_DIR%\..\..\xulrunner
    
    
    REM prior to modify path, save old value, restored at this end
    set OLD_PATH=!PATH!
    
    REM Path to necessary bbinaries
    set PATH=!DEBUGSERVER!\..\eclipse\plugins\com.ti.dvt.ofssymbolmanager_1.0.0;!PATH!
    set PATH=!DEBUGSERVER!\..\eclipse\plugins\com.ti.dvt.tidisassembly_1.0.0\os\win32;!PATH!
    
    REM Path to Rhino JAR File
    set RHINO_JAR="!DEBUGSERVER!\packages\ti\dss\java\js.jar"
    
    REM Path to DVT Scripting JAR File
    set DVT_SCRIPTING_JAR="!DEBUGSERVER!\..\dvt\scripting\dvt_scripting.jar"
    
    REM Path to DebugServer JAR File
    set SCRIPTING_JARS="!DEBUGSERVER!\packages\ti\dss\java\dss.jar"
    
    REM If this is CCS (rather than stand-alone DSS) also add Eclipse's startup.jar
    REM to the app classpath
    if exist "!DEBUGSERVER!\..\eclipse\startup.jar" (
      set SCRIPTING_JARS=!SCRIPTING_JARS!;"!DEBUGSERVER!\..\eclipse\startup.jar"
    )
    
    REM Name of Rhino Shell Java Application
    set RHINO_SHELL=org.mozilla.javascript.tools.shell.Main
    
    REM Name of Rhino Debugger Java Application
    set RHINO_DEBUGGER=org.mozilla.javascript.tools.debugger.Main
    
    REM If the user chose to install the JRE with this DSS install - use that JRE. 
    if exist "!DEBUGSERVER!\..\jre" (
      set JAVA_HOME=!DEBUGSERVER!\..\jre
      set PATH=!DEBUGSERVER!\..\jre\bin;!PATH!
      goto LAUNCH_SCRIPT
    )
    
    REM If this CCS (rather than stand-alone DSS) the installed jre is in
    REM \eclipse\jre
    if exist "!DEBUGSERVER!\..\eclipse\jre" (
      set JAVA_HOME=!DEBUGSERVER!\..\eclipse\jre
      set PATH=!DEBUGSERVER!\..\eclipse\jre\bin;!PATH!
      goto LAUNCH_SCRIPT
    )
    
    REM Set full path to script
    SET LOADTI_JS=%SCRIPT_DIR%\dss\omap4_dss.js
    
    REM Launch Rhino script engine.  Import the scripting package.
    :LAUNCH_SCRIPT
    java.exe -Xms40m -Xmx256m -Dxpcom.bridge.executeOnDedicatedThread=no -Dorg.eclipse.swt.browser.XULRunnerPath="!DEBUGSERVER!\win32" -DXPCOM.RUNTIME="!DEBUGSERVER!\win32" -cp !RHINO_JAR!;!SCRIPTING_JARS!;!DVT_SCRIPTING_JAR! !RHINO_DEBUGGER! "%LOADTI_JS%" -c %CCS_CFG_FILE% -t %TIMEOUT_MAX_MS% %1 %2 %3 %4 %5 %6 %7 %8 %9
    
    REM Done.
    @echo ERROR CODE: %ERRORLEVEL%
    if ERRORLEVEL 1 goto Test_Fail
    if ERRORLEVEL 0 goto Test_Pass
    goto Test_Fail
    
    :invalidpath
    @echo %DEBUGSERVER_ROOT% does not point to a valid DSS DebugServer installation
    goto end
    
    :help 
    @echo usage: loadti_omap4  [-c {ccs cfg file}] [arg]
    @echo arg :options given to the script
    @echo   -c,   --cfg-file=CONFIG_FILE : CCS cxml configuration file
    @echo   -t,   TIME_OUT : max time before automatic exit (in ms)
    @echo   -h,   --help : to display script usage
    @echo   -mlr1,-mlr2 ="PAGE,ADDR,FILE,TYPE_SIZE,BYTE_SWAP" : Memory Raw Load , done at 
    @echo                 test inner loop entry level 1 / 2
    @echo   -mld1, --mld2 ="PAGE,ADDR,FILE,LEN" : Memory Hex Load , done at test inner 
    @echo                   loop entry level 1
    @echo   -msr1, -mssr2 ="PAGE,ADDR,FILE,LEN,TYPE_SIZE,BYTE_SWAP" : Memory Raw Save , 
    @echo                done at test inner loop level 1 / 2
    @echo   -msd1, -msd2 ="PAGE,ADDR,FILE,LEN,IO_FORMAT,APPEND" : Memory Raw Save , 
    @echo                done at test inner loop level 1 / 2
    @echo   -msll1,-msll2 : Memory length to be saved when --msr1/2 option is set with 
    @echo    length parameter equals 0
    @echo   -q,   --quiet : do not display information on console
    @echo   -r,   --reset : reset CPU at connection
    @echo   -s,   --stdout-file=FILE : save console output in a file
    @echo   -v,   --verbose : verbose mode for displayed information on console
    @echo   -x,   --xml-log=FILE : Save DSS event sequences on a xml file
    @echo   -ca9_0 : MANDATORY : open a Cortex A9 Cpu 0 session
    @echo   -ca9_1: OPTIONNAL : open a Cortex A9 Cpu 1 session
    @echo   -cm3_0: OPTIONNAL : open a Cortex M3 Cpu 0 session
    @echo   -cm3_1: OPTIONNAL : open a Cortex M3 Cpu 1 session
    @echo   -c64,: OPTIONNAL : open a Cortex Tesla C64 session
    @echo   -bkp_te: OPTIONNAL : Set a breakpoint at test entry function
    @echo   -bkp_ils1 : OPTIONNAL: Set a breakpoint at Inner loop level 1 start
    @echo               (loop on test pattern)
    @echo   -bkp_ile1: OPTIONNAL Set a breakpoint at Inner loop level 1 end
    @echo              (loop on test pattern),
    @echo   -tid_expr: Expression to evaluate prior to start test, OPTIONNAL
    @echo   -tid_gel: Gel function to execute prior to start test, OPTIONNAL
    @echo   -res: Test result structure to display, MANDATORY
    @echo    -dual_core : to launch CPU1 execution for dhrystone test
    @echo   -@,  --options-file=FILE : use input file conaaining all options
    goto end
    
    :Test_Fail
    @echo Test Fail - Error returned: %ERRORLEVEL%
    set DSS_TEST_RES=TEST_FAIL
    goto end
    
    :Test_Pass
    @echo Test Pass
    set DSS_TEST_RES=TEST_PASS
    
    :end
    set DEBUGSERVER_ROOT=
    SET CCS_CFG_FILE=
    SET TIMEOUT_MAX_MS=
    set DSS_ROOT=
    set DSS_LIB_PATH=
    set LOADTI_JS=
    set RHINO_JAR=
    set SCRIPTING_JAR=
    set RHINO_SHELL=
    set RHINO_DEBUGGER=
    set PATH=%OLD_PATH%
    
    endlocal

    thanks

  • Hi Claudio,

    It might be more of a path when you load the function.

    Eg if dss.js, omap4.js and getArgs.js are all in the same directory then it is easy ...

     

    in omap4.js just do

    load("getArgs.js);

    getArgs();

     

    This works ... the only issue becomes I think in your getArgs() you cause a script or at the very least Rhino exit.  So look into this as a next step.

    Cheers,
    Lisa

  • lisa,

    yes for the path issue it is due to the fact it can be used from multiple users with different config.

    For the 2nd point  Idon't get your point.

    In fact  Iwould like to have more info on the way we need to pass argument to the jva process: in the loadti.bat, it seems simpler than in the scripting/bin/dss.bat.

    Since  Iam not a java expert, the command line such as

    java.exe -Xms40m -Xmx256m -Dxpcom.bridge.executeOnDedicatedThread=no -Dorg.eclipse.swt.browser.XULRunnerPath="!DEBUGSERVER!\win32" -DXPCOM.RUNTIME="!DEBUGSERVER!\win32" -cp !RHINO_JAR!;!SCRIPTING_JARS!;!DVT_SCRIPTING_JAR! !RHINO_SHELL! %1 %2 %3 %4 %5 %6 %7 %8 %9

    is not very crystal clear. but it sounds to be necessary

     BTW I see the CCS5.1 M7 dss.bat has been simplified (similar the the loadti.bat example in fact.)

    rgds

     

  • Hi Claudio,

    I have a lot to learn myself.

    What exactly are you trying to do? Bind a CCS and script session?  Perhaps I should pause here and make sure that we understand.

    Best Regards,
    Lisa

  • isa,

    yes  I have developped a script to launch some test in an automatic way. Sometimes some tests are failing we need to investigate more in details, that is why the CCS GUi is usefull in these cases.

    since I do not want to maintain multiple batch files,  I want to release only 1 version that can also open [conditionnaly]  the CCS GUI.

    That is why some deepers information on how to pass argument to the java process in the batch file would be more than welcome, since we have seen by our experiments that some parameters are needed for this Use Case.

    rgds

  • HI Claudio,

    I am actually not yet a scripting expert myself but it seems the best and only sources of documentation are:

    http://processors.wiki.ti.com/index.php/Loadti

    http://processors.wiki.ti.com/index.php/Debug_Server_Scripting

    And of course the scripts and readmes in the scripting directory itself. 

    As loadti is actually an example script you should be able to continue to make modifications and hopefully will find that in the end the script you need will come out.  In the readme and loadti scripts you can see how you can pass parameters via command line or file.  Unlike dss.js, which is not really command line based, loadti is written to be passed files and arguments.

    If you have specific questions please feel free, however there is unfortunately no further documentation available.

    All the best!

    Lisa

  • Hi Claudio,

    Thanks for the invitation to this thread. I skimmed through the thread. Well, I think we are both victims of the DSS, however, I never tried to pass arguments to the scripts. So, I haven't got a good idea what's wrong. Sorry.

    Did you do a re-installation of your CCSv4? Maybe this will help to get the CCS GUI working again. Did you have a look to my files, posted in my thread ? I never used this loadTI-thing.

    Jo