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 5.2.0.00069: Trying to run loadti

Hello,

I would like to use loadti in order to load and run a program in my test board, but I don't get any result when running loadti. I have already checked the forum and as far as I saw maybe there are some bug passing the arguments to loadti (http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/164161/699048.aspx), so I passed the arguments in a several ways (with absolute path, with relative path, with all the files in the same directory...). I'm launching the script loadti from /opt/ti/ccsv5/ccs_base/scripting/examples/loadti

What I get when running loadti is just the following:

********************************************************************************************************

$ ./loadti.sh --cfg-file tms570ls31x.ccxml --xml-log log.xml kernel.out

flxInitLoad: client has not been protected.
flxInitLoad: client has not been protected.
Usage: loadti [OPTION]... [OUT_FILE1[+OUT_FILE2]...] [ARGUMENT]...
Load OUT_FILE executable(s) to TI target and run, passing ARGUMENT(s) to main.

Mandatory arguments to long options are mandatory for short options too.
Options:
  -a,   --async-run
  -b,   --init-bss-section[=VALUE]
  -c,   --cfg-file=CONFIG_FILE
  -h,   --help
  -l,   --load
  -mlr, --mem-load-raw="PAGE,ADDR,FILE,TYPE_SIZE,BYTE_SWAP"
  -mld, --mem-load-dat="PAGE,ADDR,FILE,LEN"
  -msr, --mem-save-raw="PAGE,ADDR,FILE,LEN,TYPE_SIZE,BYTE_SWAP"
  -msd, --mem-save-dat="PAGE,ADDR,FILE,LEN,IO_FORMAT,APPEND"
  -n,   --no-profile
  -q,   --quiet
  -r,   --reset
  -s,   --stdout-file=FILE
  -t,   --timeout=VALUE
  -v,   --verbose
  -x,   --xml-log=FILE
  -@,   --options-file=FILE
********************************************************************************************************

As I said, I tried to pass the arguments with absolute paths, but I get the same output. I also tried to run it as root with sudo, but same output as well.I also tried to write the short version of the options (i.e.,  -c instead of  --cfg-file), but no new result. I tried to use = sign to pass the argument (i.e., -c=tms570ls31x.ccxml) or to use "" like -c="tms570ls31x.ccxml", but nothing.

I read in other posts that the message "flxInitLoad: client has not been protected." is not that important.

Message "Mandatory arguments to long options are mandatory for short options too." does not give me any information.

Do you know what else can I try?

I'm using Linux kernel 3.0.57 64 bits (but I have installed libraries to use 32 bits programs) with Ubuntu 11.04.

Any help will be appreciated. Thank you very much in advance.

  • Hello,

    Vicente Nicolau said:
    .I also tried to write the short version of the options (i.e.,  -c instead of  --cfg-file), but no new result. I tried to use = sign to pass the argument (i.e., -c=tms570ls31x.ccxml) or to use "" like -c="tms570ls31x.ccxml", but nothing.

    In the past, if you used the short form, you did not use the "=" sign. If you used the long form, you did.

    ex:

    ./loadti.sh --cfg-file=tms570ls31x.ccxml --xml-log=log.xml kernel.out

    ./loadti.sh -c tms570ls31x.ccxml -x log.xml kernel.out

    But the script has been updated so I don't think it matters anymore.

    Vicente Nicolau said:
    $ ./loadti.sh --cfg-file tms570ls31x.ccxml --xml-log log.xml kernel.out

    I tried calling loadti using a similar format and that seemed to work for me. Could you try specifying the out file with the -o / --out-file option?

  • Thank you for your answer.

    Ki-Soo Lee said:

    In the past, if you used the short form, you did not use the "=" sign. If you used the long form, you did.

    ex:

    ./loadti.sh --cfg-file=tms570ls31x.ccxml --xml-log=log.xml kernel.out

    ./loadti.sh -c tms570ls31x.ccxml -x log.xml kernel.out

    Regarding this issue, I tried all the combinations, included the previous ones.

    Ki-Soo Lee said:
    Could you try specifying the out file with the -o / --out-file option?

    I had already tried the -o parameter since I have read that some version (don't remember if newer or older versions) included this option.

    So the following examples does not work either (same output):

    ./loadti.sh -c tms570ls31x.ccxml -x log.xml kernel.out

    ./loadti.sh --cfg-file=tms570ls31x.ccxml --xml-log=log.xml kernel.out

    ./loadti.sh -c tms570ls31x.ccxml -x log.xml -o kernel.out

    ./loadti.sh --cfg-file=tms570ls31x.ccxml --xml-log=log.xml --out-file=kernel.out

    The output is:

    ************************************************************************

    flxInitLoad: client has not been protected.
    flxInitLoad: client has not been protected.
    Usage: loadti [OPTION]... [OUT_FILE1[+OUT_FILE2]...] [ARGUMENT]...
    Load OUT_FILE executable(s) to TI target and run, passing ARGUMENT(s) to main.

    Mandatory arguments to long options are mandatory for short options too.
    Options:
      -a,   --async-run
      -b,   --init-bss-section[=VALUE]
      -c,   --cfg-file=CONFIG_FILE
      -h,   --help
      -l,   --load
      -mlr, --mem-load-raw="PAGE,ADDR,FILE,TYPE_SIZE,BYTE_SWAP"
      -mld, --mem-load-dat="PAGE,ADDR,FILE,LEN"
      -msr, --mem-save-raw="PAGE,ADDR,FILE,LEN,TYPE_SIZE,BYTE_SWAP"
      -msd, --mem-save-dat="PAGE,ADDR,FILE,LEN,IO_FORMAT,APPEND"
      -n,   --no-profile
      -q,   --quiet
      -r,   --reset
      -s,   --stdout-file=FILE
      -t,   --timeout=VALUE
      -v,   --verbose
      -x,   --xml-log=FILE
      -@,   --options-file=FILE
    ************************************************************************

    And is the same ouput if I launch loadti with wrong parameters, for example:

    ./loadti.sh

    ./loadti.sh -cxx tms570ls31x.ccxml -xxx log.xml kernel.out

    ./loadti.sh -c notExistingFile.ccxml -x notExistingFile.xml notExistingFile.out

    Obviously there is something I'm doing wrong.

    -Do I have to execute CCS before calling loadti? (I already tried to do it with CCS opened and closed)

    -Is there any requirement for loadti that CCS does not required? (I can load and debug the program through CCS)

    Thank you again.

  • Vicente,

    I'm not sure why you are having issues. Your usage looks correct to me, at least in regard to syntax. The only thing I can see of difference is that you are using an older version of CCS. I am using 5.3.0 and it is working well for me. Updating you CCS version is one thing you can try.

    Vicente Nicolau said:
    -Do I have to execute CCS before calling loadti? (I already tried to do it with CCS opened and closed)

    No

    Vicente Nicolau said:
    -Is there any requirement for loadti that CCS does not required? (I can load and debug the program through CCS)

    It should be defined in the loadti.sh file.

    Are you using the original loadti.sh file in the original location?

    Thanks

    ki

  • Hi Ki,

    Ki-Soo Lee said:
    Are you using the original loadti.sh file in the original location?

    Yes, I'm using loadti.sh from the original installation location (  /opt/ti/ccsv5/ccs_base/scripting/examples/loadti  ).

    Ki-Soo Lee said:
    Updating you CCS version is one thing you can try.

    Ok, I will update CCS to 5.3.

    Thank you very much.

  • Hi again,

    I'm afraid but after updating CCS to version 5.3, I have got no new results.

    I don't know what else I can do.

    -Do you recommend some specific version of linux kernel to run CCS or loadti?

    -Is any way to download somewhere the last version of loadti?

    Thank you once more.

  • Vicente Nicolau said:
    -Do you recommend some specific version of linux kernel to run CCS or loadti?

    I am using ubuntu 10. I believe you are using ubuntu 11. That should not be an issue. Anyway I don't think the issue is the linux version.

    Vicente Nicolau said:
    -Is any way to download somewhere the last version of loadti?

    The latest version comes with CCS

    COuld you try running the loadti script in the debugger? Should should be able to step through the script that way and see if the parameters are being passed in correctly.

    Please do the following:

    1) download the attached file (dss.txt) and put it in:

    <INSTALL DIR>\ccsv5\ccs_base\scripting\bin

    2) rename dss.txt to dss.sh (you can overwrite the previous file)

    3) Go to: <INSTALL DIR>\ccsv5\ccs_base\scripting\examples\loadti and open up loadti.sh in an editor

    4) Modify line 5 so that it looks like:

    $LOADTI_PATH/../../bin/dss.sh -dss.debug $LOADTI_PATH/main.js $@

    The part in bold is the changes.

    Then rerun the loadti command. When you do so, it should launch the rhino debugger and you should be able to step through the loadti scripts to see exactly where in the script the issue lies.

    ki

  • Thank you Ki for your ideas.

    I followed all the steps, and thanks to the Rhino debugger I think where we have the problem: main.js is executed with no arguments, i.e., this.arguments.length is equal to 0, so the program shows the loadti usage and returns (exitWithHelp();).

    I execute this command in the shell in order to see what happen with the arguments:

    ./../../bin/dss.sh -dss.debug ./main.js hello bye

    i.e., just the command that runs loadti at the end. And the result was the same: main.js receive no arguments.

    Then I run:

    ./../../bin/dss.sh -dss.debug "./main.js hello bye"

    And the result is that main.js receives 2 arguments! "hello" and "bye"

    So I modified the loadti script to check if the solution was to use quotation marks:

    $LOADTI_PATH/../../bin/dss.sh "$LOADTI_PATH/main.js $@"

    But main.js only receives one argument: "-c"

    So the next step (in order to progress a little bit) was to hardcode the arguments, in my case (inside the loadti script):

    $LOADTI_PATH/../../bin/dss.sh "$LOADTI_PATH/main.js -c tms570ls31x.cscxml -x log.xml kernel.out"

    In this case, main.js get all the arguments correctly, but I get errors (at last!). The error say:

    Configuring Debug Server for specified target...
    Done
    SEVERE: Cannot read System Setup data from XML file /opt/ti/ccsv5/ccs_base/scripting/examples/loadti/tms570ls31x.cscxml
    ... (and continues)

    The debug session with Rhino ends in the next instruction:

    debugSession = debugServer.openSession("*", "*");

    In short: the main problem I have is that main.js doesn't receive any argument in the original script. I tried to fix it with quotation marks, but it doesn't solve completely the problem.

    The second problem is that passing the arguments hardcoded, I have some errors, but for the moment I think is better to solve the first problem. Regading the second one, I will look in the forum for some solution or ideas.

    Thank you again.

  • Hi again,

    regarding the second problem, it is already solved. It was a mistake in the file extension of xml configuration file: tms570ls31x.cscxml (the correct is tms570ls31x.ccxml)

    So I can load and run the program on the target, but only hardcoding the arguments inside the loadti.sh script:

    $LOADTI_PATH/../../bin/dss.sh "$LOADTI_PATH/main.js -c tms570ls31x.ccxml kernel.out"

    But I still have the first problem.

    Thank you!

  • Vicente - what shell are you using?

  • Hi,

    Ki-Soo Lee said:
    Vicente - what shell are you using?

    I'm using bash:

    $ bash --version
    GNU bash, versión 4.2.8(1)-release (x86_64-pc-linux-gnu)
    Copyright (C) 2011 Free Software Foundation, Inc.

    But the good news is that I fixed it (at least for my shell). In loadti.sh, instead of using:

    $LOADTI_PATH/../../bin/dss.sh $LOADTI_PATH/main.js $@

    I use:

    $LOADTI_PATH/../../bin/dss.sh "$LOADTI_PATH/main.js $*"

    In this way, main.js gets the arguments correctly.

    Besides, I made a little change in dss.sh. Altough it worked when launched, I always got this error/warning:

    [: 42: ./main.js: unexpected operator

    So I changed in dss.sh this (line 31):

    if [ $1 = "-dss.debug" ]; then

    by the following (notice the quotation marks around $1):

    if [ "$1" = "-dss.debug" ]; then

    In this way I don't get that error/warning, at least in my shell. I attach the two scripts:

    #! /bin/sh
    # This script executes LoadTI for DSS Linux
    
    export LOADTI_PATH=$(dirname $(which $0))
    
    # Original:
    # $LOADTI_PATH/../../bin/dss.sh $LOADTI_PATH/main.js $@
    
    # Customized:
    $LOADTI_PATH/../../bin/dss.sh "$LOADTI_PATH/main.js $*"
    
    # In order to debug:
    # $LOADTI_PATH/../../bin/dss.sh -dss.debug $LOADTI_PATH/main.js $@
    # $LOADTI_PATH/../../bin/dss.sh -dss.debug "$LOADTI_PATH/main.js $*"
    
    # Example:
    # ./loadti.sh -c /home/vnicolau/workspaceCCSv5_2/loaderARM/tms570ls31x.ccxml -r -t 20000 -x /home/vnicolau/workspaceCCSv5_2/loaderARM/imageToLoad/log.xml  /home/vnicolau/workspaceCCSv5_2/loaderARM/imageToLoad/kernel.out
    

    #! /bin/sh
    
    # usage > dss.sh example.js (using Rhino Shell)
    #       > dss.sh -dss.debug example.js (using Rhino debugger)
    
    # DebugServer root directory.
    DEBUGSERVER_ROOT=$(cd $(dirname "$0"); pwd)/../../DebugServer
    
    # Java class paths
    CLASSPATH=$DEBUGSERVER_ROOT/packages/ti/dss/java/js.jar:$CLASSPATH
    CLASSPATH=$DEBUGSERVER_ROOT/packages/ti/dss/java/dss.jar:$CLASSPATH
    # Path to DVT Scripting JAR File
    CLASSPATH=$DEBUGSERVER_ROOT/../dvt/scripting/dvt_scripting.jar:$CLASSPATH
    export CLASSPATH
    
    # Use product JRE
    if [ -d "$DEBUGSERVER_ROOT/../jre" ]; then
      export JAVA_HOME=$DEBUGSERVER_ROOT/../jre
      export PATH=$DEBUGSERVER_ROOT/../jre/bin:$PATH
    elif [ -d "$DEBUGSERVER_ROOT/../eclipse/jre" ]; then
      export JAVA_HOME=$DEBUGSERVER_ROOT/../eclipse/jre
      export PATH=$DEBUGSERVER_ROOT/../eclipse/jre/bin:$PATH
    elif [ -d "$DEBUGSERVER_ROOT/../../eclipse/jre" ]; then
      export JAVA_HOME=$DEBUGSERVER_ROOT/../../eclipse/jre
      export PATH=$DEBUGSERVER_ROOT/../../eclipse/jre/bin:$PATH
    fi
    
    # Run Tcl test script
    if [  -e "$DEBUGSERVER_ROOT/../../eclipse/eclipse" ]; then
      # determine if we want to run in Rhino debug mode
      if [ "$1" = "-dss.debug" ]; then
        # user can add additional parameters at the back as required
        shift
        $DEBUGSERVER_ROOT/../../eclipse/eclipse -nosplash -application com.ti.ccstudio.apps.runScript -dss.debug -dss.rhinoArgs "$@"
      else
        $DEBUGSERVER_ROOT/../../eclipse/eclipse -nosplash -application com.ti.ccstudio.apps.runScript -dss.rhinoArgs "$@"
      fi
    else
      # fall back into the legacy method
      java org.mozilla.javascript.tools.shell.Main $@
    fi
    

    I will mark this as answer.

    Thank you very much for your help.

    Best regards.

  • I'm glad you found the issue

    Vicente Nicolau said:

    I'm using bash:

    $ bash --version
    GNU bash, versión 4.2.8(1)-release (x86_64-pc-linux-gnu)
    Copyright (C) 2011 Free Software Foundation, Inc.

    I am using bash version 4.1.5(1).

    Vicente Nicolau said:

    $LOADTI_PATH/../../bin/dss.sh $LOADTI_PATH/main.js $@

    I use:

    $LOADTI_PATH/../../bin/dss.sh "$LOADTI_PATH/main.js $*"

    In this way, main.js gets the arguments correctly.

    The funny thing is that for me, I have to use the first... the second causes problems for me!

    Could it be a shell version issue? I do have a ubuntu 11.04 machine to try out. I'll give that a try...

  • I don't have any other machine to try out the behavior.

    Please, post the result if you try in a Ubuntu 11.04 machine.

    Thank you.