如何从t32start命令行界面启动和关闭Trace32实例?

crazyGamer

我发现Lauterbach Trace32允许从命令行启动Trace32实例。

我有一个ts2文件我正在尝试使用t32start.exe来启动和关闭Trace32实例。我大致尝试了以下方法:

t32start ts2_file_path -RUNITEM core_item_from_tree

但是,我无法使用相同的方法关闭Trace32实例。谁能告诉我他打开和关闭Trace32实例的正确方法?

更新资料

有时,在目标仍在运行时,可能不得不强制关闭GUI。(可能是因为它已挂起或DAP配置失败)。

在这些情况下,重新启动GUI时将显示以下弹出窗口:

在GUI重新启动时重置弹出窗口

This prevents using Trace32, since remote access thereafter always returns communication failure. Is there any way to automatically have the target to reset (Press "yes"), by passing a flag to the trace32.exe command or otherwise?

Holger

Starting TRACE32 from command line:

T32Start is a tool which helps you to generate a TRACE32 configuration file and then launch the actual TRACE32 application for your target architecture family with that temporarily generated configuration file.

So to start TRACE32 you can either:

  • use that command line you've suggested to start TRACE32 via T32Start (which will only work on Windows)
  • generate a permanent configuration file and start TRACE32 directly with it.

The document "installation.pdf" in the PDF sub-folder of your TRACE32 installation tells you how to create a configuration file. You can also use T32Start to create a permanent configuration file like this:

  1. Create the configuration you need with T32Start. Ensure to enable the "Advanced > Interfaces > API Port" for every core with a unique port to be able to close TRACE32 from command line later.
  2. Then right click on a core (the node with a Lauterbach logo) and choose "Show Start Environment..." from the context menu.
  3. The window, which then opens, has in the right bottom corner a button for "Save Batch Job As..." and one for "Save Config As...". Use those two buttons to save both files. Let's imagine you've saved the configuration under the name myconfig.t32.
  4. Adapt the saved batch job so that the command line calling TRACE32 points to the configuration file. In the end you should have a line in the form t32m<cpu> -c <configfile.t32> -s <startscript.cmm>, where <cpu> is the short name of the CPU architecture family you are going to debug (like ARM, PPC, RISCV - you'll see it in the batch file). E.g. c:\t32\bin\windows64\t32marm -c c:\t32\myconfig.t32 -s c:\t32\mytestcase.cmm
  5. Repeat steps 2 to 4 for all cores of your configuration, if you have an AMP multicore setup.
  6. Merge all the saved batch files an use the batch file to launch all your TRACE32 instances. (Ideally wait a few seconds afters starting the first TRACE32 GUI).

Closing TRACE32 from command line:

Ensure to enable the remote API on all of your TRACE32 GUIs you'd like to close. You'll find that setting in T32Start for each core node at "Advanced > Interfaces > API Port"
In the end, the configuration file for each TRACE32 GUI contains the following lines:

RCL=NETASSIST
PORT=20000

There must be an empty line before and after that block (while the block may also contain a line starting with PACKLEN=)
The value after PORT= defines a UDP/IP port and must be unique for every TRACE32 GUI.

If you have an open TRACE32 GUI with enabled API Port, you can send commands to it over the TRACE32 remote API. (See api_remote.pdf in your TRACE32 installation.) A command line tool which uses the remote API to send simple commands to a TRACE32 instance is t32rem.exe (you'll find it at the "bin/windows/" sub-folder of your TRACE32 installation).

Use t32rem as follows:

t32rem localhost port=<myport> <command>

For <myport> choose the port number you've used above in the configuration file after PORT=. For <command> use any TRAC32 command you'd like to send. E.g. the command QUIT to close the TRACE32 GUI.

但是,如果QUIT用于TRACE32命令,则t32rem将拼命等待一段时间,以等待刚刚关闭的GUI的响应。为了避免这种情况,请创建一个测试文件“ quit.cmm ”,并将以下行放入该脚本中:

WAIT 800.ms
QUIT

然后通过命令行关闭GUI:

c:\t32\bin\windows64\t32rem.exe localhost port=20000 "DO ""c:\t32\quit.cmm"" "

(仅当路径中包含空格时,才需要在CMM文件的路径周围加双引号。)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章