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/TMS320F28335: Should I use DSS or GEL files to obtain variables values?

Part Number: TMS320F28335
Other Parts Discussed in Thread: CCSTUDIO

Tool/software: Code Composer Studio

Hi!

I need to acquire some variables values every minute (or ten minutes) during a quite long time, let's say a week. I started looking for information related to GEL files and here

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

y found the recommendation of using DSS.

After some digging I got to the conclusion that I should use a DSS script, in order to periodically call a GEL function for saving the specific locations of the controlCARD's memory I need in a file in the host PC. I thought of doing this data collection in this way because with JavaScript (DSS) I can control the time in which I will be taking the information and with the GEL script I can get it from the target's memory without halting it.

Do you think this is a good approach? I wanted to use only DSS but, as far as I understood, it is necessary to halt the processor with a breakpoint to access its memory. Is this correct? I can avoid this halt with GEL function Gel_MemorySave(), right?

Thanks in advance.

Román.

  • Román, 

    Any memory access will forcefully halt the core CPU before reading data - that is something that is built into the F28x architecture and will not change between the GEL or the DSS access. 

    Using DSS, you can enable the option "Halt the target before any debugger access" - in DSS, this is the option UseLegacyStopMode

    This is enabled in DSS using the following API with a running debug session:

    debugSession.options.setBoolean("UseLegacyStopMode",false);

    One alternative to minimize the impact of halting the core CPU is to enable the Real time mode - this will maintain interrupts running while the core is halted. References are shown below:

    https://www.youtube.com/watch?v=xEBjObfW-8Y  

    https://training.ti.com/c2000-real-time-features 

    In DSS it would be the option AllowInterruptsWhenHalted - enabled the same way as the option above. 

    Hope this helps,

    Rafael

  • With the information I found here e2e.ti.com/.../3137, I wrote the .js that is attached. It seems that it works fine. However, I have these doubts:

    -Is the memory access (from the computer) halting the processor? The script is supposed to collect data from a F28335 controlCARD that will be controlling an inverter for a solar panel so, since it should be servicing interrupts, we do not want anything to go wrong.

    -Is there a way to get the computer time and append it to the file we are writing? All the functions that I found in your API to write files takes an address from the target memory to read data from there. I thought about using periodic interrupts in the F28335 and to count them in order to track the time but I think it would be better to directly use the computer time.

    F28335.js:

    importPackage(Packages.com.ti.debug.engine.scripting);
    importPackage(Packages.com.ti.ccstudio.scripting.environment);
    importPackage(Packages.java.lang);

    var PROGRAMNAME="Example_2833xLEDBlink.out"; //Poner nombre que corresponda al .out que querramos bajar.
    var EXECUTABLE="/home/user/Workspaces/ccs/Example_2833xLEDBlink/Debug/"+PROGRAMNAME; //Acomodar directorio.

    /* Global handles to the debugger
    */
    var env = ScriptingEnvironment.instance();

    var server = env.getServer("DebugServer.1"); //En principio no modificar.
    server.setConfig("/home/user/ti/CCSTargetConfigurations/F28335.ccxml"); //Buscar, en el directorio donde estén instalados los productos de TI, el archivo de configuración correpondiente al dispositivo al cual le querramos bajar el programa.
    var session = server.openSession("Texas Instruments XDS100v1 USB Debug Probe_0/C28xx"); //Para la controlCARD F28335, no se le debiera pasar ningún argumento a esta función, simplemente llamarla así server.openSession();
    env.traceWrite("Trying to connect.");

    // Create a log file in the current directory to log script execution
    env.traceBegin("Flash28M35Log.xml", "DefaultStylesheet.xsl"); //Para creación del log file.

    // Connect to target
    env.traceWrite("Connecting to device...");

    session.target.connect();

    env.traceWrite("Connected.");

    try{
        /* Load the Program
        */
        env.traceWrite("Load Program: "+PROGRAMNAME);
        env.traceWrite("Loading...");
        session.target.reset();
        session.memory.loadProgram(EXECUTABLE);
        env.traceWrite("Program Loaded.");
        session.setDefaultDialogResponse("Yes");
        session.options.setBoolean("UseLegacyStopMode",false);
        session.options.setBoolean("AllowInterruptsWhenHalted", true);
        session.options.setBoolean("PoliteRealtimeMode",true);
        /* Get Flash Checksum
        */
        //session.flash.calculateChecksum();
    }
    catch(err)
    {
        env.traceWrite("Error in Flash Programmer.");
    }

    print("UseLegacyStopMode: " + session.options.getBoolean("UseLegacyStopMode"));
    print("AllowInterruptsWhenHalted: " + session.options.getBoolean("AllowInterruptsWhenHalted"));
    print("PoliteRealtimeMode: " + session.options.getBoolean("PoliteRealtimeMode"));

    /* End session, since the tests are done
    */

    session.target.runAsynch();


    var sym1_address = session.symbol.getAddress("prueba");
    var sym1_val = 0;
    while(1){
        //sym1_val = session.memory.readWord(0, sym1_address);
        //print("Value at symbol1 is: " + sym1_val);
        session.memory.saveData(0,sym1_address,"/home/user/Desktop/export.dat", 1, 1, true);
        Thread.sleep(1000);
    }

    env.traceWrite("Closing session.");
    server.stop();
    session.terminate();

  • Hi,

    Please apologize for the delay. 

    user5233338 said:
    -Is the memory access (from the computer) halting the processor? The script is supposed to collect data from a F28335 controlCARD that will be controlling an inverter for a solar panel so, since it should be servicing interrupts, we do not want anything to go wrong.

    As I mentioned in my previous post, any memory accesses will halt the CPU, thus potentially disrupting interrupt requests unless you use Real-time mode. 

    user5233338 said:
    -Is there a way to get the computer time and append it to the file we are writing? All the functions that I found in your API to write files takes an address from the target memory to read data from there. I thought about using periodic interrupts in the F28335 and to count them in order to track the time but I think it would be better to directly use the computer time.

    The DSS log has timestamps starting from the beginning of the execution of the script, which will be written to the file <Flash28M35Log.xml>. This file will be nicely formatted if you also have the file <DefaultStylesheet.xsl> in the same directory. Something similar to what is shown below:

    Hope this helps,

    Rafael