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.
Hello,
I'm trying to initiate a firmware build from a Perl script that is invoked from a cmd.exe command window as follows:
perl buildfirm.pl foo.pjt Debug
from the directory where the file foo.pjt resides.
I'm using ActivePerl 5.8, Build 819 and I've set PERL5LIB to C:\CCStudio_v3.3\bin\utilities\ccs_scripting.
The Script looks as follows:
#!perl
use strict;
use warnings;
use CCS_SCRIPTING_PERL;
my $nMinorISA = 0;
my $nCPUIndex = 0;
my $nVisible = 1;
my $ccs = new CCS_SCRIPTING_PERL::CCS_Scripting();
my $pjt = $ARGV[0];
my $target = $ARGV[1];
print "Building project '$pjt', target '$target'...\n";
$ccs->ScriptTraceVerbose($CCS_SCRIPTING_PERL::VERBOSE_ALL);
$ccs->CCSOpen($CCS_SCRIPTING_PERL::ISA_C28,
$nMinorISA,
$nCPUIndex,
$CCS_SCRIPTING_PERL::PLATFORM_EMULATOR,
$nVisible) == $CCS_SCRIPTING_PERL::CCS_OK or
die "Error: Can't start CCS!\n";
$ccs->ProjectOpen($pjt) == $CCS_SCRIPTING_PERL::CCS_OK or die
"Error: Can't open project '$pjt' in CCS!\n";
$ccs->ProjectBuild($target) == $CCS_SCRIPTING_PERL::CCS_OK or die
"Error: Can't build target '$target' of project $pjt!\n";
$ccs->CCSClose(1);
I want this script to do the following:
Building with the help of the Perl script acutally works but some things are odd:
Another annoying thing is that when CCS is open and the project is already open and active, I get the errror:
Exception caught during Project Open : Automation Error in Code Composer Studio
I hope someone can help me with this. Thanks in advance.
Johannes
johannes said:
3. when everything was built by invoking the script (as in step 1), executing the script a second time everything appears to be rebuilt (which I don't understand and don't want, because it takes longer than needed)
4. when I do a manual build after a "script build" as in step 1, everything appears to be rebuilt (which I don't understand)
I took a look at the CCS Scripting API Reference documentation installed with your copy of CCS (if you didn't deselect it from installing). The ProjectBuild API has a second argument called $bBuildAll, which is a boolean specifying to CCS to perform an Incremental Build (aka. F7), or Rebuild All. If this boolean is false, an incremental build occurs. If the boolean is true, a rebuild occurs.
Apparently, based on your observations and my testing, not specifying it in your call means a true, which implies a Rebuild All.
I modified your call to include a false for $bBuildAll and only an incremental build occurred. Secondly, when performing #4 as you indicated, a manual build (F7) after the perl script resulted in an incremental build. My modifications are below:
$ccs->ProjectBuild($target, 0) == $CCS_SCRIPTING_PERL::CCS_OK or die
"Error: Can't build target '$target' of project $pjt!\n";
johannes said:
Another annoying thing is that when CCS is open and the project is already open and active, I get the errror:Exception caught during Project Open : Automation Error in Code Composer Studio
Hi Brandon,
thank you for your response.
BrandonAzbell said:I took a look at the CCS Scripting API Reference documentation installed with your copy of CCS (if you didn't deselect it from installing). The ProjectBuild API has a second argument called $bBuildAll, which is a boolean specifying to CCS to perform an Incremental Build (aka. F7), or Rebuild All. If this boolean is false, an incremental build occurs. If the boolean is true, a rebuild occurs.
The CCS Scripting API Reference documentation that I have (file:///C:/CCStudio_v3.3/bin/utilities/ccs_scripting/Docs/CCSScriptingAPIReference.html, the file date is June 21st, 2006) does not mention any arguments to ProjectBuild(). I called ProjectBuild with argument $target, because it was done so in the example from which I "derived" my script.
In the meantime I have figured out that doing $ccs->ProjectClose() just before $ccs->CCSClose(1) appears to make CCS compile only the files that are needed to be built when the script is invoked the next time. It looks as if some sort of state is saved when calling CCSClose(1)...
BrandonAzbell said:
Another annoying thing is that when CCS is open and the project is already open and active, I get the errror:Exception caught during Project Open : Automation Error in Code Composer Studio
[/quote]
Is there a way to circumvent this? E.g., find out whether the project is already open and if yes don't open it a second time?
Regards
Johannes
johannes said:Is there a way to circumvent this? E.g., find out whether the project is already open and if yes don't open it a second time?
I haven't found an API to provide this status. A brute force method would be to close the project prior to opening it.