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.

TMDSCNCD28035ISO: Getting "TypeError: Cannot call method "getActivity" of undefined " when trying to profile code

Part Number: TMDSCNCD28035ISO


I currently have this Piccolo TMS320F28035 Isolated controlCARD.


Docking Station:

Micro Inverter Baseboard:

I am trying to write a javascript file that I can run on the scripting console in CCS to profile my code.

I am using this user guide and supplied video (7.6 Scripting DDS Overview video) to write the script:

I was able to follow along in the video to write a javascript just like in the video. I am now trying to add profiling capabilities and dump it in a file (just like in the 7.6.11). 

I keep getting "TypeError: Cannot call method "getActivity" of undefined"  which means I am not setting up myProfileActivity correctly?

Lastly, the user guide said that in my ccs installation path of "\ccs\ccs_base\scripting\examples" would have some "DVTExamples" sample code for profiling, but this is not existing in my folder?

Any help would be appreciated, thanks!

importPackage (;

var ccs9InstallDir = "C:/Users/A/Desktop/Code Composer";
var deviceCCXMLFile = "C:/Users/A/Desktop/Code Composer/Workspace5/SolarMicroInv_F2803x/xds100v1_F28035.ccxml";
var programToLoad = "C:/Users/A/Desktop/Code Composer/Workspace5/SolarMicroInv_F2803x/F2803x_FLASH/SolarMicroInv_F2803x.out";
var logFile = "C:/Users/A/Desktop/newcontrolsuite/controlSUITE/development_kits/TMDSSOLARUINVKIT_v100/MicroInv_F2803x/log.xml";

var script = ScriptingEnvironment.instance();

script.traceBegin(logFile, "C:/Users/A/Desktop/Code Composer/ccs/ccs_base/scripting/examples/DebugServerExamples/DefaultStylesheet.xsl");

script.traceWrite("Begin scripting session");

var debugServer = script.getServer("DebugServer.1");

debugSession = debugServer.openSession("Texas Instruments XDS100v1 USB Emulator_0/C28xx");;

// array of events to be profiled ------------------take from TI user guide 
var evtNames = new Array("Events.L1D.hit.summary",

// User guide code
myProfileActivity= debugSession.profileSetup.getActivity("Profile all Functions for Total Cycles");

// enable profiling of all events in the array - User guide code
for (evtCount=0;evtCount<evtNames.length;evtCount++)
    event = myProfileActivity.getProperty(evtNames[evtCount]);


// User guide code - already set up events to profile, now set up way to export them
dvtServer = script.getServer("DVTServer.1");

// create a profile analysis session for function level profiling data collected
var profileAnalysisSession = dvtServer.openProfileAnalysisSession(debugSession, "FunctionProfile");

// use Asynch otherwise, it runs forever


var exports = profileAnalysisSession.exportData();

for (var e=0; e < exports.length; e++)
    exports[e].save(exports[e].getName() + ".csv");

// close profile session
script.traceWrite("End scripting session");