//! @file //! @brief Debug java script to load and execute App from Flash //! @cond // Import the DSS packages into our namespace to save on typing importPackage(Packages.com.ti.debug.engine.scripting) importPackage(Packages.com.ti.ccstudio.scripting.environment) importPackage(Packages.java.lang) // Configurable Parameters var deviceCCXMLFile = "../../DevConApp/targetConfigs/TMS320F28075_xds2xx.ccxml"; var programToLoad = "../../DevConApp/Debug - Flash/DevConApp.out"; var fileToLoad = "../../DevConApp/Debug - Flash/Preamble.dat"; // Create our scripting environment object - which is the main entry point into any script and // the factory for creating other Scriptable ervers and Sessions print("Creating scripting environment object ..."); var script = ScriptingEnvironment.instance(); // Create a debug server print("Creating a debug server ..."); var ds = script.getServer( "DebugServer.1" ); // Set the device ccxml print("Setting the device ccxml ..."); ds.setConfig( deviceCCXMLFile ); // Open a debug session print("Opening a debug session ..."); var debugSession = ds.openSession( "Texas Instruments XDS2xx USB Debug Probe_0/C28xx_CPU1" ); debugSession.flash.options.setString("FlashEraseSelection", "Necessary Sectors Only (for Program Load)"); debugSession.flash.options.setNumeric("FlashSPLLIMULT",24); debugSession.flash.options.setString("FlashSPLLFMULT","0 [0]"); debugSession.flash.options.setString("FlashSYSDIVSEL","1 [/2]"); // Connect to the target print("Connecting to the target ..."); debugSession.target.connect(); // Start multiload with single erase debugSession.flash.multiloadStart(); // Load the preamble into flash print("Loading the preamble ..."); debugSession.memory.loadBinaryProgram(fileToLoad, 0x88004); // Load the program print("Loading the program ..."); debugSession.memory.loadProgram( programToLoad ); // Finish multiload operation debugSession.flash.multiloadEnd(); // Run the program print("Running the program, no block ..."); debugSession.target.runAsynch(); print("Ran the program ..."); //! @endcond