I have ascript that I use to run a program on the target. It seems after 1-3 runs, I can't connect to the board. I get "Error Initializing Emulator" errors. I ignored them to see what else I could find out in Code Composer.
I'm using the spectrum digitial560 USB emulator drivers (EVMC6424_SDXDS560R).
I reset the emulator, performed a system reset. When I try that, I get this error:
"Failed to reset the emulator: This error was generated by TI's USCIF driver. SC_ERR_OCS_ALREADY_OPEN <-110> This utility was able to open the controller, but the controller is already in use by Unified-SCIF. You must exit other debuggers and utilities that use Unified-SCIF because this utility must be the only client of Unified-SCIF and the controller. Failed Software Reset "
It seems my scripting can at some point cause the Unified SCIF to not "unuse" the controller? Anyone have any ideas why or what I may be doing wrong?
Its pretty annoying as I remotely connect to the computer and don't have a remote power switch for the jtag (which, unpowering and disconnect the USB seems to "reset" andfix this issue).
Thanks for your help.
My script posted below
#!/bin/perl
# Debug.pl
# Demonstrates some of Code Composer Studio Scripting's debugging functionality
# Pulls in the Code Composer Studio Scripting declarations and definitions
use CCS_SCRIPTING_PERL;
# Declarations and Initializations
# Create 2 new Code Composer Studio Scripting objects
my $MyCCScripting = new CCS_SCRIPTING_PERL::CCS_Scripting();
my $MyCCScripting2 = new CCS_SCRIPTING_PERL::CCS_Scripting();
my $sCurDir;
my $sLogFile;
my $sProject;
my $sProgram;
my $nPCVal;
my $nPCVal2;
my $nMainAddr;
my $nBreakpoint1;
my $nBreakpoint2;
my $sHexOutput;
my $sBoardName;
my $sCPUName;
my $sVersion;
$sProject = "L:\\Tools_TB2\\TestControl_ALM\\TestControl_ALM.pjt";
$sProgram = "L:\\Tools_TB2\\TestControl_ALM\\TestControl_ALM.out";
$sLogFile = "ccs_testControlCmd.log";
$sCurDir = ".\\";
print ("Testing...\n");
# Open log file and set to maximum level of debug output
$MyCCScripting -> ScriptTraceBegin($sLogFile);
$MyCCScripting -> ScriptTraceVerbose($CCS_SCRIPTING_PERL::VERBOSE_ALL);
# Get the current version of Code Composer Studio Scripting
$sVersion = $MyCCScripting->ScriptGetVersion();
$MyCCScripting -> ScriptTraceWrite("$sVersion\n");
print "$sVersion\n";
# The CCSConfigImport API requires an absolute pathname to the configuration file
$MyCCScripting -> CCSOpenNamed("*", "*", 0);
# Retrieve the Board name and CPU name of the current configuration
# and write names to log file
$sBoardName = $MyCCScripting -> TargetGetBoardName();
$sCPUName = $MyCCScripting -> TargetGetCPUName();
$MyCCScripting -> ScriptTraceWrite("Board Name: $sBoardName\n");
$MyCCScripting -> ScriptTraceWrite("CPU Name: $sCPUName\n\n");
# Set the Current Directory, if necessary
$MyCCScripting -> CCSSetCurrentDirectory($sCurDir);
#$MyCCScripting -> TargetEvalExpression("GEL_LoadGel(\"L:\\\\OFS\\\\Scripts\\\\GEL\\\\EDM\\\\EDM_C6424.gel\")");
$MyCCScripting -> TargetConnect();
# Open the project
$MyCCScripting -> ProjectOpen($sProject);
# Load an .out file
$MyCCScripting -> ProgramLoad($sProgram);
# Run project
$MyCCScripting -> TargetRun();
$MyCCScripting -> TargetReset();
$MyCCScripting -> TargetDisconnect();
# Close all current Code Composer Studio processes
$MyCCScripting -> CCSClose();
print "close";
# Close the log file
$MyCCScripting -> ScriptTraceEnd;