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.

CCSTUDIO: DebugSession not opening after the step "Connecting to XPCOM DebugServer"

Part Number: CCSTUDIO
Other Parts Discussed in Thread: TM4C1294NCPDT,

I am trying to run dot Net VB code which calls dss scripting APIs through Java as follows


CCS v6

Tiva tm4c1294ncpdt
Eclipse Mars with JRE/JDE 1.7
Visual Studio 2019, .NET Framework 4.6.1
IKVM 7.2.4630.5 to convert jar file to dll

The Java code provides an interface which can be used by my tests written in VB. It runs succesfully from Eclipse GUI during development and testing.

Then I use IKVM tool to convert this to a DLL and follow their instructions to set up my VB project (x86). It builds everything succesfully but when I ran it, I got into several issues when trying to open a debug session.

At first it could not find DebugServer.dll and/or ti_xpcom.dll during the execution. I solved this by adding C:\ti\ccsv8\ccs_base\DebugServer\bin, C:\ti\ccsv8\ccs_base\common\bin and the eclipse subfolder with jvm.dll to PATH env variable, and then registering both the dlls using regsvr32. Now I am stuck at the error message shared below appearing in the console while running the VB project:

traceSetFileLevel: ENTRY sLevel: ALL
traceSetFileLevel: RETURN
setScriptTimeout: ENTRY nTimeout: 15000
setScriptTimeout: Timeout is 15000ms
setScriptTimeout: RETURN
getServer: ENTRY sServerName: CCSServer.1
getServer: Getting definition for: CCSServer.1
getServer: Constructing server
getServer: RETURN com.ti.ccstudio.scripting.CCSServer@1629f15
WARNING: CCSServer.openSession() failed.  DSS was unable to launch Code Composer Studio, however script execution will continue. java.lang.ClassNotFoundException: com.ti.ccstudio.apps.scripting.ScriptUtils
getServer: ENTRY sServerName: DebugServer.1
getServer: Getting definition for: DebugServer.1
getServer: Constructing server
getServer: RETURN com.ti.debug.engine.scripting.DebugServer@ff8584
setConfig: ENTRY sConfigurationFile: D:\Tiva_TM4C1294NCPDT.ccxml
setConfig: RETURN
getCurrentDirectory: ENTRY
getCurrentDirectory: RETURN E:\AKS Projects\dotNet\CCS_Automation_VB\bin\x86\Debug
openSession: ENTRY sPattern: Stellaris In-Circuit Debug Interface/CORTEX_M4_0
start: ENTRY
start: Firing: onServerStarting()
start: Connecting to XPCOM DebugServer
boost::filesystem::create_directory: The filename, directory name, or volume label syntax is incorrect: "D:\Applications\ti\ti_app_dir\C:"
If this continues, please run fsclean or set TI_APPDATA_DIR to directory you have permissions to access


At first the error was "C:\Users\AKS\AppData\Local\Texas Instruments\CCS\C:" not found. At this time there was no TI_APPDATA_DIR env var in my PC. I then created the var TI_APPDATA_DIR = "D:\Applications\ti\ti_app_dir" and now the error is "D:\Applications\ti\ti_app_dir\C:" not found. I am not able to find out how "C: is appended at the end of the path or even why this path is needed at all by the DSS runtime dlls.

I have somehow figured that this is thrown by fsutils.dll by cannot remember or find out anymore how. But if you open that dll in a textpad you can see the same error message about "TI_APPDATA_DIR" there.

The error occurs when trying to execute the following Java code (from VBS 2019). Also there is an exception thrown simultaneously in the VS GUI as in the screenshot:

            debugServer.setConfig("D:\\Tiva_TM4C1294NCPDT.ccxml");

            //debugSession = debugServer.openSession(".*");
            debugSession = (DebugSession) debugServer.openSession("Stellaris In-Circuit Debug Interface/CORTEX_M4_0");

The Java code is invoked from IKVM through the support of runtime dlls which I have included in the project. I am not sure if somehow this is also contributing to the error. But so far all the errors occured due to paths not found when trying to execute the code outside of Eclipse. Therefore I am raising this ticket with TI first.

I am kind of losing my mind with spending several days solving several errors and now stuck here. As I have mentioned in the related thread, there is no other way I can pursue than trying to run the Java code from VB. Will be great to know what is happening here if someone can help. Thanks!

  • Akhil,

    The best person to help with this (Ki-Soo) is out through next week.  What you are doing here is quite unique.  I will see if I can find someone else who can help.

    Is DSS working independently?  You mentioned that you were able to run some tests within the Eclipse GUI.  I am curious if running some simple DSS scripts that just launch a debug session, connect and step work when running DSS from the command line using dss.bat.  You could even use the loadti example.  If that also gives similar errors then that may be easier for us to debug.

    Regards,

    John

  • Hi John,

    thanks for the response. Yes, Ki-Soo was helpful and directed me to DSS path from CCS scripting used in CCSv3.

    I could launch a debug session and set breakpoint, read variable value etc. from Eclipse. Today I tried to make a runnable Jar and execute it like 'Java -jar <jar-filename>' from command prompt and got the same error due to DebugServer path not found.

    start: Firing: onServerStarting()
    start: Connecting to XPCOM DebugServer
    SEVERE: Can not connect to DebugServer. Path not found: 'null\bin'
    stop: ENTRY
    stop: RETURN
    SEVERE: Could not start server: DebugServer.1: Can not connect to DebugServer. Path not found: 'null\bin'
    ERROR in opening debug session!
    ERROR in opening debug session!
    com.ti.ccstudio.scripting.environment.ScriptingException: Could not start server: DebugServer.1: Can not connect to DebugServer. Path not found: 'null\bin'
            at com.ti.debug.engine.scripting.DebugServer$SessionFactory.<init>(DebugServer.java:158)
            at com.ti.debug.engine.scripting.DebugServer.openSession(DebugServer.java:1062)
            at dssInterface.DSS_Scripting.CCSOpen(DSS_Scripting.java:92)
            at dssInterface.DSS_Scripting.testDebugConnection(DSS_Scripting.java:503)
            at dssInterface.DSS_Scripting.main(DSS_Scripting.java:547)
    Exception in thread "main" java.lang.NullPointerException
            at dssInterface.DSS_Scripting.CCSSymbolLoad(DSS_Scripting.java:155)
            at dssInterface.DSS_Scripting.testDebugConnection(DSS_Scripting.java:505)
            at dssInterface.DSS_Scripting.main(DSS_Scripting.java:547)

    This now takes Visual Studio /IKVM out of the equation. My undestanding is that it is trying to find the path "C:\ti\ccsv8\ccs_base\DebugServer\bin" relative to some other location. For visual studio this was relative to the .vbproj path and when running from cmd it looks for "null/bin" as shown above.

    I am wondering if this has something to do with the external library reference added in Eclipse like dss.jar which contains additional classpaths. I am now experimenting with classpath in a Manifest file while exporting the jar file from Eclipse. I am also not familiar with Java programming concepts and I could be doing something wrong in the jar export.

    Hope you find this new information helpful. I will update if I make some progress.

  • When running from within the Eclipse/CCS UI there will be some environment settings automatically setup.  I am curious if you run dss with a simple .js file from the windows command prompt if that works.  One option for a quick test would be the loadti example.  It is in \scripting\examples\loadti.  It has a bunch of options but for the easiest test you can just call loadti.bat and pass it your .ccxml file and the .out to load.

    Regards,

    John

  • I will try this next week, as I need to create a js which does not flash anything into the board. But I have once executed a js file from command prompt using dss.bat without any error message as far as I remember. But there was no output from this script as well. Maybe I can find and execute it again next week.

    Wish you a nice weekend!

  • Akhil,

    I would probably do this:

    1. Try loadti with just the .ccxml and .out
    2. Then try your own simple .js

    If those work then we know there is nothing fundamentally broken with running DSS outside of CCS.  I am hoping that those fail as that would be easier to debug.

    Enjoy your weekend.

    Regards,

    John

  • Hi John,

    sorry about the delay to get back to you, but I have been working on an alternate solution using Lauterbach debugger since we are getting close to the deadline date. The Lauterbach T32 APIs support dotNet and it seems to be working with another debug cable. Now we have ordered the ones for TM320 and awaiting to do final integration.

    I have today did what you have told with a small example I had from  TI workshop I attended years ago, with my tm4c1294xl board. I get the below error message when trying loadti.bat as you have mentioned:

    ***** DSS Generic Loader *****
    
    START: 15:43:45 GMT+0200 (CEST)
    
    Configuring Debug Server for specified target...
    Done
    TARGET: Stellaris In-Circuit Debug Interface_0
    Connecting to target...
    Failed to load dynamic library: 'ftd2xx.dll'
    testEnv.outFiles: TiVA_test.out
    Loading TiVA_test.out
    Done
    Target running...
    Interrupt to abort . . .
    SEVERE: Profile Clock event id <-1> is invalid.  Valid events are:
    Error code #4013, error encountered during program execution!
    Aborting!
    
    END: 15:43:52 GMT+0200 (CEST)

  • It looks like some issue configuring the profile clock for your device. I recall such issues with older versions of CCS.

    Assuming that you do not need the profiling enabled, you can disable it by passing in the -n option to loadti.

    Thanks

    ki

  • Thanks Ki. I am actually spending less time on this solution now since the Lauterbach solution seems way forward.

    But I tried last week in my office PC where I am building this env by calling my sample Js script using DSS.bat. It is actually working from both CMD prompt and when invoking it as a CMD via Visual Basic Process.Start Method. The script is able to create a Debug Session and Server, connect to target, read breakpoint etc. I beleive the difference is in running the Js script using eclipsec.exe via the DSS.bat, but you might know better about this :-)

    At the moment I am not sure how I can go ahead in my VB world with CCS - an idea is perhaps to pass a DebugServer and DebugSession object somehow from VB -> CMD -> DSS -> Js and then use the returned instance with my Java DLL code for rest of the program, if at all this is possible. But I keep this low priority as long as the Lauterbach solution works for us and is less complex.

    I might continue with this little project in my free time in future (or in immediate future in case something does not work when the new Lauterbach debug cable arrives :-( ).

    Thanks for all the support provided so far!

  • Thanks for the update.

    At the moment I am not sure how I can go ahead in my VB world with CCS - an idea is perhaps to pass a DebugServer and DebugSession object somehow from VB -> CMD -> DSS -> Js and then use the returned instance with my Java DLL code for rest of the program, if at all this is possible. But I keep this low priority as long as the Lauterbach solution works for us and is less complex.

    Unfortunately we will not be able to provide much assistance here since this is an unsupported configuration. But best of luck with your investigations if you do choose to pursue this further and please keep us posted of yoru progress.

    Thanks

    ki