I have found out that Lauterbach Trace32 allows to launch Trace32 instances from the command line.
I have a ts2 file. I am trying to use the t32start.exe to start and close Trace32 instances. I have roughly tried the following:
t32start ts2_file_path -RUNITEM core_item_from_tree
However I am unable to close a Trace32 instance with the same. Can anyone tell me he correct way to open and close Trace32 instances?
Update
Sometimes, the GUI may have to be force closed, while the target is still running. (Perhaps because it is hung or the DAP configuration has failed).
In these cases, the following pop-up appears when restarting the 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?
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:
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:
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
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:
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:
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 commandQUIT
to close the TRACE32 GUI.However if you use
QUIT
for the TRACE32 command, t32rem will wait some time desperately for a response form the GUI you've just closed. To avoid that create a test file "quit.cmm" and put the following lines in that script:Then close the GUI via the command line:
(The doubled double-quotes around the path of the CMM file are only require if the path contains blanks.)