I am doing the automate regression with Trace32. Before the regression starts, if any Trace32 process is in use, I want to kill the process. The problem is, if I kill it with system OS, when regression starts, the GUI will pop up a dialog saying "TRACE32 device already in use. Reset device and connect?" I have to manually click yes to continue to regression. Is there any way to quit the currently running Trace32 properly from command line, such that the reset dialog will not show when Trace32 starts next time. Or any command I can add to the .cmm file in my regression to skip this question dialog. I have tried to put RESet initially in .cmm, which does not help.
问题:
回答1:
First of all try to end all your automated test with TRACE32 command QUIT
. This will close TRACE32. However something might go wrong in your tests and thus, the QUIT command might not get reached and TRACE32 is still running.
So secondly start TRACE32 with an open Remote-API port. Add to your TRACE32 config-file (by default this is c:\T32\config.t32) the following lines
RCL=NETASSIST
PORT=20000
Before and after the block there must be an empty line. You can also choose any other number for PORT, which specifies a UDP/IP port, which gets opened by TRACE32. (If more than one TRACE32 instance is active at the same time, use different a port number for each instance.)
If TRACE32 was started with open Remote-API port you can send a QUIT command to the still running application instead of terminating it via a kill-command. To send the QUIT command used command line tool t32rem.exe as follow:
t32rem localhost port=20000 QUIT
Finally we need a way to handle the (hopefully rarely happening) situation that TRACE32 somehow crashed and is not longer responsive. Then you have to kill it of course. For a proper reconnect use the following setting CONNECTIONMODE=AUTOCONNECT
in the PBI= section of you TRACE32 config-file (by default this is c:\T32\config.t32). This setting does the "Reset device and connect" without asking you.
Putting all together you config-file should look somehow like that:
OS=
ID=myT32
SYS=C:\T32
PBI=
USB
CONNECTIONMODE=AUTOABORT
RCL=NETASSIST
PORT=20000