脚本执行
手动创建调试器
1642.xml
修改执行脚本ccsdebug.js
- 修改脚本中的工作区 - 修改脚本中的项目位置, 和编译后的img位置
ccsdebug.js
// Import the DSS packages into our namespace to save on typing
(Packages.com.ti.debug.engine.scripting);
importPackage
(Packages.com.ti.ccstudio.scripting.environment);
importPackage
(Packages.java.lang);
importPackage
(Packages.java.io);
importPackage
(){
function run_test//*******User must specify WORKSPACE_DIR***********
= "D:/project/board/workspace_v10/";
var WORKSPACE_DIR
//*******User must specify WORKSPACE_DIR***********
= WORKSPACE_DIR+"sdk_demo/";
var PROJECT_DIR
= PROJECT_DIR+"mmw_mss_16xx/Debug/xwr16xx_mmw_mss.xer4f";
var R4F_OUT_FILE_PATH
= PROJECT_DIR+"mmw_dss_16xx/Debug/xwr16xx_mmw_dss.xe674";
var DSS_OUT_FILE_PATH
= "AWR1642.ccxml";
var CCS_TARGET_CONFIGURATION_FILE
= ScriptingEnvironment.instance();
var script
//script.traceBegin("BreakpointsTestLog.xml", "DefaultStylesheet.xsl");
//script.traceSetConsoleLevel(TraceLevel.ALL);
//script.traceSetFileLevel(TraceLevel.ALL);
.setCurrentDirectory(PROJECT_DIR);
script= script.getServer("DebugServer.1");
debugServer
.setConfig(CCS_TARGET_CONFIGURATION_FILE);
debugServer
// debug session R4F
("Debug session R4F...");
print= debugServer.openSession("*","Cortex_R4_0");
debugSession_MSS ("Connecting to R4F Core...");
print.target.connect();
debugSession_MSS.target.reset();
debugSession_MSS("Done.");
print
// debug session C674x
("Debug session C674x...");
print= debugServer.openSession("*","C674X_0");
debugSession_DSS ("Connecting to C674x Core...");
print.target.connect();
debugSession_DSS.target.reset();
debugSession_DSS("Done.");
print
// Loading program - R4F...
("Loading program - R4F...");
print.memory.loadProgram(R4F_OUT_FILE_PATH);
debugSession_MSS("load R4F Done.");
print
// Loading program - C674x...
("Loading program - C674x...");
print.memory.loadProgram(DSS_OUT_FILE_PATH);
debugSession_DSS("Loading C674x Done.");
print
// run target
= new Array();
var dsArray [0] = debugSession_MSS;
dsArray[1] = debugSession_DSS;
dsArray
//debugServer.simultaneous.run(dsArray); // Run CPUs 1 and 2
("please click run...");
print//debugServer.stop();
//script.traceEnd();
}
.addJSFunction("Run Test","run_test()"); hotmenu
View ->Scripting Console
在这里插入图片描述
在终端中输入以下指令,根据脚本所在位置填写脚本
// 脚本位置
"D:\project\board\workspace_v10\sdk_demo\ccsdebug.js" loadJSFile
>## 点击script,然后运行脚本
程序启动需手动点击run按钮
> ## 断点调试 > 需要设置
hardware breakpoint
, 普通的断点无法在mss上停止. 然后就可查看到变量和单步调试了
稍微高级点的用法可以查看tools里面的工具