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/MSP430FR5969: Pausing Execution Via Scripting Interface?

Part Number: MSP430FR5969


Tool/software: Code Composer Studio

Hi all,

I'm currently working on a project where we need to run a program on an MSP430 for a random length of time before pausing execution. We've been using both CCS's scripting interface as well as command line DSS scripts to try to automate the process. Single stepping through thousands of instructions becomes prohibitively long. Instead, we have been launching the MSP430 to run using debugSession.target.runAsynch(), delaying a certain amount of time (using JavaScript's setTimeout function), and then issuing the debugSession.target.halt() command. 

My problem arises when the halt command is issued. Inside of CCS it pauses the execution, then returns to normal instruction when given another run command. Issuing the same command sequence using a DSS script causes the program counter on the MSP430 to jump to the address 0x00002 and then freeze. 

The project requirements are such that it's not an option to repeatedly run scripts inside CCS, so I need a way to use a script. Is there a better way to pause the processor mid-execution via the scripting interface? Is there something that CCS is doing internally that I should replicate to get the same results? I appreciate your help!

Thank you,

Matthew

  • Hello Matthew,
    All things being equal (CCS version, target configuration file, GEL file, etc), the a debugSession.target.halt() should behave the same as halting the target in CCS.

    When you halt the target in CCS, how are you doing it? Pressing the "suspend" button or 'Run _> Suspend'? Or are you entering the command in the scripting console or running your DSS script from inside the scripting console?

    Also, what is the full version number of your CCS installation?

    Thanks
    ki
  • Ki,

    Thank you for your reply!

    When I halt the target in CCS I'm entering the commands directly into the scripting console. For reference, I'm executing the following commands in both CCS (manually, not as a script) and as a DSS script:

    var script = ScriptingEnvironment.instance();

    var ds = script.getServer( "DebugServer.1" );
    ds.setConfig( deviceCCXMLFile );
    debugSession = ds.openSession( ".*" );

    debugSession.target.connect();
    debugSession.memory.loadProgram(programToLoad);

    debugSession.options.setBoolean("AddCEXITbreakpointAfterLoad",true);
    debugSession.options.setString("MSP430DownloadOptions","Erase main and information memory");
    debugSession.options.setBoolean("MSP430LPMx5Mode",false);

    debugSession.target.runAsynch();
    Thread.sleep(450);

    debugSession.target.halt();
    print("PC at: 0x"+numToHex(debugSession.memory.readRegister("PC"),regLength));

    I'm using CCS version 6.2.0.00050

    Thank you,

    Matthew