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.

[参考译文] CCS/DRA755:DSS Jython连接超时,而CCS手动运行成功

Guru**** 2239510 points
Other Parts Discussed in Thread: CCSTUDIO
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/574713/ccs-dra755-dss-jython-connection-timesout-whereas-ccs-manually-does-run-successfully

部件号:DRA755

工具/软件:Code Composer Studio

大家好,

我正在运行的项目中,使用手动CCS进行调试运行正常。

我尝试使用Jython连接到DSS端口,使用的是用于CCS连接的同一CCXML文件。

从com.ti.debug.engine.scripting导入*
从com.ti.ccStudio.scripting.environment导入*
从java.lang导入*
从java.util导入*
导入系统
导入时间

#创建脚本环境对象-它是任何脚本的主要入口点,
#创建其他可脚本服务器和会话
脚本的工厂= ScriptingEnvironment.instance

#在当前目录中创建日志文件以记录脚本执行
脚本.traceBegin("dss_py.xml","DefaultStylesheet.xsl")

#设置超时
script.setScriptTimeout(1.5万

#记录所有
脚本.traceSetopenConsoleLevel(TraceLevel.All)
script.traceSetFileLevel(TraceLevel.All)

#启动
ccccccccccsserver=调试服务器=





debugServer.setConfig(r"c:\Users\ABiswal\ti\CCSTargetConfigurations\J6.ccxml"); sgetSg1调试
服务器=


#debugSession = debugServer.openSession ("DRA75x_DRA74x_0/CortexM4_IPU_1_C0")
#debugSession = debugServer.openSession("Blackhawk XDS560v2-USB系统跟踪仿真器_0/CortexM4_IPU_2_C0")
#debugSession = debugServer.openSession ("DRA75x_DRA74x_0/IcePick_D/IPU_1_C0/CS_DAP_1_C0/CortexM4_IPU_1_C0/CortexM4_IPM4_IPU_1_C0")
debugSession = debugServer.openSession("*","*")
#debugSession = debugServer.openSession("Blackhawk XDS560v2-USB系统跟踪仿真器_0","Cortex_M4_IPU1_C0")
#debugSession = debugServer.openSession ("DRA75x_DRA74x_0","Cortex_M4_IPU1_C0")

尝试:
#连接到目标
debugSession.target.connect() 

我尝试了多种方法连接到核心M4 IPU1 C0,但连接失败。 消息超时

traceSetFileLevel:项sLevel:全部
traceSetFileLevel:返回
getServer:条目sServerName: CCSServer.1
getServer:正在获取定义: CCSServer.1
getServer:正在构建服务器
GetServer:返回com.ti.ccStudio.scripting.CCSServer@da52a7
警告:CCSServer.openSession()失败。 DSS无法启动Code Composer Studio,但脚本执行将继续。java.lang.ClassNotFoundException: COM.TI.CCStudio.apps.scripting.ScriptUtils
getServer:条目sServerName: DebugServer.1
getServer:正在获取定义: DebugServer.1
getServer:正在构建服务器
getServer:返回com.ti.debug.engine.scripting.DebugServer@1841b15
setConfig: Entry sConfigurationFile: C:\Users\ABiswal\ti\CCSTargetConfigurations\J6.CCXML
setConfig:返回
调试程序打开:条目sBoardName:* sCPUName:*
开始:输入
start:触发: onServerStarting()
开始:连接到XPCOM DebugServer
开始:使用指定的配置初始化DebugServer:"C:\Users\ABiswal\ti\CCSTargetConfigurations\J6.CCXML"
waitUntil:entry com.ti.ccStudio.scripting.environment.ScriptingEnvironment@16ec9d0超时:4.5万 (ms)
严重:4.5万ms后超时
停止:输入
disposeAndUnload:触发: onServerStop()
disposeAndUnload:正在停止DebugServer
disposeAndUnload:触发: onServerStopped()
停止:返回
严重:无法启动服务器:DebugServer.1:4.5万ms后超时
键入'com.ti.CCStudio.scripting.environment.ScriptingException'>
停止:输入
停止:返回
停止:输入
停止:返回

我已按照wiki页面设置环境。

有人能告诉我我我做错了什么吗?

提前感谢。

此致,

Biswal

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Biswal,

    我无法从提供的信息中准确判断这种情况下可能发生的情况。 此外,我没有DRA755板,但一个引起我注意的细节是,您正在尝试先连接到Cortex_M4_IPU1_C0。 是否确定在连接到任何A15内核之前,您都可以手动连接到此内核?

    我提出这个问题的原因是,通常主内核(例如A15之一)负责释放复位后的子内核,这可能包括Cortex_M4_IPU1_C0。 复位后释放子内核的过程可通过已在主板上运行的软件(例如,如果主板从SD卡启动)或分配给主内核的凝胶脚本执行。 以下参考中描述的内容:

    processors.wiki.ti.com/.../GSG:Connecting_to_slave_cores_in_SoC_devices_v5

    如果您需要连接到A15内核,通常需要在脚本中添加一些延迟,以等待GEL脚本完成其操作。

    (编辑)我刚才提到的另一个详细信息是调试服务器的调用:

    debugSession =debugServer.openSession("*","Cortex_M4_IPU1_C0")

    希望这能有所帮助,
    拉斐尔

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    @ Rafael
    感谢您的建议。
    我发现我需要延迟更长时间才能连接。 我现在已经给出了脚本超时的20万延迟时间,它似乎连接到目标,并且能够读取符号的地址。

    我现在遇到了另一个问题。
    我可以在执行target.ru之前读取符号地址。 但一旦执行target.run,我就无法读取这些值。 超时。
    请帮我找到正确的方法吗?

    脚本:

    #连接到目标
    debugSession.target.connect()

    #加载程序
    debugSession.memory.loadProgram(r"d:\WS_perforce\BMW_IuK_RAM\development \Autosar\ArcCore\Application_Jacinto6\out \elf\Application_Jacinto6.elf")

    打印"iet_com_mainrx_task_max at:",debugSession.symbol.getAddress("cet_com_mainrx_task_max")

    #重新运行。 应该在我们的断点处停止
    debugSession.target.run()

    打印调试Session.symbol.getAddress("cet_Com_mainrx_task_max")

    #使用表达式-获取PC的当前值
    CET_COM_mainrx_task_max =调试Session.expression.evaluate ("cet_com_mainrx_task_max")


    ---------------------------------------------------------------------------------------------------------------------------------------------------------
    输出:

    loadProgram:项sFileName: D:\WS_perforce\BMW IuK_RAM\development \Autosar\ArcCore\Application_Jacinto6\out \elf\Application_Jacinto6.elf
    LOAD:正在请求程序装载
    waitUntil:输入超时:20万 (毫秒)
    waitUntil:返回
    LOAD (加载):程序加载成功
    getBoolean:条目ID:AutoRunToLabelOnRestart
    getBoolean:返回true
    waitForHaltIfPropertySet:等待暂停
    waitUntil:输入超时:20万 (毫秒)
    日志:目标在0x87C93D94处停止
    waitUntil:返回
    loadProgram:返回
    CET_COM_mainrx_task_max位于:getAddress:条目sSymbol: CET_COM_mainrx_task_max
    getAddress:正在获取符号包
    getAddress:查找符号
    getAddress:正在获取地址
    getAddress:返回0x87dd6d3c
    2279435580
    运行:条目
    执行:请求目标执行
    waitUntil:输入超时:20万 (毫秒)
    严重:20万毫秒后超时
    严重:com.ti.debug.engine.scripting.Target.run():在20万毫秒后超时
    键入'com.ti.CCStudio.scripting.environment.ScriptingException'>
    终止:条目
    Terminate:触发: onSessionTerminating()
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好,

    希望我没有遗漏任何内容,但我没有看到在您的脚本片段中设置断点。 日志指示它正在到达main(),然后在该之后运行。

    要获取表达式的值,应停止目标(无论如何,它就是您所期望的)。 在这种情况下,我会在连接到核心之后在地址设置一个断点。

    希望这能有所帮助,
    拉斐尔
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    @ Rafel
    我不希望有断点,但希望定期或在更改某些符号时对其值进行采样。
    是否有办法做到这一点?

    此致,
    Biswal
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Biswal,

    我认为由于您的原始脚本中存在此条目,您可能希望设置断点:

    an Biswal 说:
    # Run Again (再次运行)。 应该在我们的断点处停止
    debugSession.target.run()

    在任何情况下,如果没有断点,您都不能从内核本身检查内存中的值,因为内存访问可能会中断执行。  

    一些备选方案包括:

    -在调试配置中启用以下选项以访问内存:

    此选项通常设置为debugSession.options.setBoolean("UseLegacyStopMode",true);  

    -创建将数据写入文件的断点。 每次代码达到特定点时,此操作将信息输出到特定文件。 类似于:

    BPproperties = debugSession.breakpoint.createProperties(0);
    BPproperties.setString("Hardware Configuration.Location","main+0x4");
    BPproperties.setString("Debugger Response.Action","将数据写入文件");
    BPproperties.setString("Debugger Response.Action.File","C:\\temp\\output_script.dat");
    BPproperties.setString("Debugger Response.Action.Format","Hex");
    BPproperties.setString("Debugger Response.Action.Start Address","my_var");
    BPproperties.setString("Debugger Response.Action.Length","my_var_length");

    testBP1 = debugSession.breakpoint.add(BPproperties);

    -创建监视点(它监视特定地址的“读取”,“写入”或“任何”访问,但停止目标)

    BPproperties = debugSession.breakpoint.createProperties(1);
    BPproperties.setString("Hardware Configuration.Type","watchpoint");
    BPproperties.setString("Hardware Configuration.Type.Location","my_var");
    BPproperties.setString("Hardware Configuration.Type.Memory","写入");

    testBP1 = debugSession.breakpoint.add(BPproperties);

    最后,您可以尝试连接到DAP并读取地址- DAP不需要停止目标,并且如果我正确地回忆,可以加载允许直接访问程序和变量的符号。  

    使用MMU时必须小心,因为DAP只能识别物理地址。  

    希望这能有所帮助,

    拉斐尔

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    @ Rafael
    谢谢。 我将尝试这些选项。